diff options
author | Sonic <sonic@cobinhood.com> | 2018-10-22 11:49:29 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:16 +0800 |
commit | c87eec6ae59687d8a041140bf02add6ad1ef9788 (patch) | |
tree | fd15076ae1edc55128d4d1c60967d216e8ebd84f /cmd/geth/main.go | |
parent | 5f1b306988f331695de76d4a1e6ff1ad26d83649 (diff) | |
download | go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.tar go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.tar.gz go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.tar.bz2 go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.tar.lz go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.tar.xz go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.tar.zst go-tangerine-c87eec6ae59687d8a041140bf02add6ad1ef9788.zip |
geth: add propose flag to enable/disable proposing
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 956469b9e..05f5c45b6 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -31,6 +31,7 @@ import ( "github.com/dexon-foundation/dexon/accounts/keystore" "github.com/dexon-foundation/dexon/cmd/utils" "github.com/dexon-foundation/dexon/console" + "github.com/dexon-foundation/dexon/dex" "github.com/dexon-foundation/dexon/eth" "github.com/dexon-foundation/dexon/ethclient" "github.com/dexon-foundation/dexon/internal/debug" @@ -96,6 +97,7 @@ var ( utils.ListenPortFlag, utils.MaxPeersFlag, utils.MaxPendingPeersFlag, + utils.ProposingEnabledFlag, utils.MiningEnabledFlag, utils.MinerThreadsFlag, utils.MinerLegacyThreadsFlag, @@ -355,4 +357,17 @@ func startNode(ctx *cli.Context, stack *node.Node) { utils.Fatalf("Failed to start mining: %v", err) } } + + if ctx.GlobalBool(utils.ProposingEnabledFlag.Name) { + if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" { + utils.Fatalf("Light clients do not support proposing") + } + var dexon *dex.Dexon + if err := stack.Service(&dexon); err != nil { + utils.Fatalf("Dexon service not running: %v", err) + } + if err := dexon.StartProposing(); err != nil { + utils.Fatalf("Failed to string proposing: %v", err) + } + } } |