From 706e2881e2c25a1d5cb34b75f24f8582144a5ec7 Mon Sep 17 00:00:00 2001 From: Jaynti Kanani Date: Sat, 14 Nov 2020 13:58:03 +0530 Subject: [PATCH] new: heimdall flags --- cmd/geth/chaincmd.go | 6 +++++- cmd/geth/config.go | 2 +- cmd/geth/main.go | 8 ++++++-- cmd/utils/bor_flags.go | 6 ++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index b98597e307..788d10ae95 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -74,7 +74,7 @@ The dumpgenesis command dumps the genesis block configuration in JSON format to Action: utils.MigrateFlags(importChain), Name: "import", Usage: "Import a blockchain file", - ArgsUsage: " ( ... ) ", + ArgsUsage: " ( ... ) ", Flags: []cli.Flag{ utils.DataDirFlag, utils.CacheFlag, @@ -94,6 +94,10 @@ The dumpgenesis command dumps the genesis block configuration in JSON format to utils.MetricsInfluxDBPasswordFlag, utils.MetricsInfluxDBTagsFlag, utils.TxLookupLimitFlag, + + // bor related flags + utils.HeimdallURLFlag, + utils.WithoutHeimdallFlag, }, Category: "BLOCKCHAIN COMMANDS", Description: ` diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 6b51843aa4..2e2c189fd5 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -111,7 +111,7 @@ func defaultNodeConfig() node.Config { cfg.Version = params.VersionWithCommit(gitCommit, gitDate) cfg.HTTPModules = append(cfg.HTTPModules, "eth") cfg.WSModules = append(cfg.WSModules, "eth") - cfg.IPCPath = "geth.ipc" + cfg.IPCPath = clientIdentifier + ".ipc" return cfg } diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 8c1f7c4c22..a96443bdad 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -46,7 +46,8 @@ import ( ) const ( - clientIdentifier = "geth" // Client identifier to advertise over the network + clientIdentifier = "bor" // Client identifier to advertise over the network + repositoryIdentifier = "go-bor" ) var ( @@ -54,7 +55,7 @@ var ( gitCommit = "" gitDate = "" // The app that holds all commands and flags. - app = flags.NewApp(gitCommit, gitDate, "the go-ethereum command line interface") + app = flags.NewApp(gitCommit, gitDate, fmt.Sprintf("the %s command line interface", repositoryIdentifier)) // flags that configure the node nodeFlags = []cli.Flag{ utils.IdentityFlag, @@ -259,6 +260,9 @@ func init() { app.Flags = append(app.Flags, whisperFlags...) app.Flags = append(app.Flags, metricsFlags...) + // add bor flags + app.Flags = append(app.Flags, utils.BorFlags...) + app.Before = func(ctx *cli.Context) error { return debug.Setup(ctx) } diff --git a/cmd/utils/bor_flags.go b/cmd/utils/bor_flags.go index 5e2b31395e..27e19302e6 100644 --- a/cmd/utils/bor_flags.go +++ b/cmd/utils/bor_flags.go @@ -29,6 +29,12 @@ var ( Name: "bor.withoutheimdall", Usage: "Run without Heimdall service (for testing purpose)", } + + // BorFlags all bor related flags + BorFlags = []cli.Flag{ + HeimdallURLFlag, + WithoutHeimdallFlag, + } ) func getGenesis(genesisPath string) (*core.Genesis, error) {