Files
prysm/beacon-chain/main.go
Raul Jordan 4d5d229f0f beacon: Define a Core Blockchain Package and Persisted Structure for Beacon (#278)
Former-commit-id: bbd5b46e7f64f762350d6fb496492207e70d7130 [formerly 43a37f7139b7d1d90f0c27a7406b63bdf390ad96]
Former-commit-id: bb7a2ff0a7619f8de0bd38cd2c9eb0de7c189edb
2018-07-19 11:31:50 -05:00

60 lines
1.4 KiB
Go

package main
import (
"os"
"runtime"
"github.com/prysmaticlabs/geth-sharding/beacon-chain/node"
"github.com/prysmaticlabs/geth-sharding/beacon-chain/utils"
"github.com/prysmaticlabs/geth-sharding/shared/cmd"
"github.com/prysmaticlabs/geth-sharding/shared/debug"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
func startNode(ctx *cli.Context) error {
beacon, err := node.New(ctx)
if err != nil {
return err
}
beacon.Start()
return nil
}
func main() {
app := cli.NewApp()
cli.AppHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}
{{if len .Authors}}
AUTHOR:
{{range .Authors}}{{ . }}{{end}}
{{end}}{{if .Commands}}
GLOBAL OPTIONS:
{{range .VisibleFlags}}{{.}}
{{end}}{{end}}{{if .Copyright }}
COPYRIGHT:
{{.Copyright}}
{{end}}{{if .Version}}
VERSION:
{{.Version}}
{{end}}
`
app.Name = "beacon-chain"
app.Usage = "this is a beacon chain implementation for Ethereum 2.0"
app.Action = startNode
app.Flags = []cli.Flag{cmd.DataDirFlag, utils.VrcContractFlag, utils.PubKeyFlag, utils.Web3ProviderFlag, debug.PProfFlag, debug.PProfAddrFlag, debug.PProfPortFlag, debug.MemProfileRateFlag, debug.CPUProfileFlag, debug.TraceFlag}
app.Before = func(ctx *cli.Context) error {
runtime.GOMAXPROCS(runtime.NumCPU())
return debug.Setup(ctx)
}
if err := app.Run(os.Args); err != nil {
log.Error(err.Error())
os.Exit(1)
}
}