erigon-pulse/cmd/tg/main.go

40 lines
759 B
Go
Raw Normal View History

package main
import (
"fmt"
"os"
"github.com/ledgerwatch/turbo-geth/eth/stagedsync"
"github.com/ledgerwatch/turbo-geth/log"
"github.com/ledgerwatch/turbo-geth/turbo/node"
turbocli "github.com/ledgerwatch/turbo-geth/turbo/cli"
"github.com/urfave/cli"
)
var (
2020-09-11 16:42:33 +00:00
gitCommit string
)
func main() {
app := turbocli.MakeApp(runTurboGeth, turbocli.DefaultFlags)
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func runTurboGeth(ctx *cli.Context) {
sync := stagedsync.New(
stagedsync.DefaultStages(),
stagedsync.DefaultUnwindOrder(),
)
2020-09-11 16:42:33 +00:00
tg := node.New(ctx, sync, node.Params{GitCommit: gitCommit})
err := tg.Serve()
if err != nil {
log.Error("error while serving a turbo-geth node", "err", err)
}
}