erigon-pulse/cmd/tg/main.go

41 lines
795 B
Go

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 (
GitCommit string
GitDate 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(),
)
tg := node.New(ctx, sync, node.Params{GitCommit: GitCommit, GitDate: GitDate})
err := tg.Serve()
if err != nil {
log.Error("error while serving a turbo-geth node", "err", err)
}
}