From 343b4e9ff5db9dd46a0ae18cecd2cda1e7335653 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 18 Sep 2019 03:53:27 +0000 Subject: [PATCH] Revert "[cleanup] remove is_genesis flag" This reverts commit 97880b2c3a38a6b5c208c060e80b175427f1cde2. --- cmd/harmony/main.go | 4 +++- scripts/docker/run | 2 +- scripts/node.sh | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index ff396b6cd..3455508fd 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -42,7 +42,7 @@ var ( commit string ) -// InitLDBDatabase initializes a LDBDatabase. will return the beacon chain database for normal shard nodes +// InitLDBDatabase initializes a LDBDatabase. isGenesis=true will return the beacon chain database for normal shard nodes func InitLDBDatabase(ip string, port string, freshDB bool, isBeacon bool) (*ethdb.LDBDatabase, error) { var dbFileName string if isBeacon { @@ -80,6 +80,8 @@ var ( minPeers = flag.Int("min_peers", 32, "Minimal number of Peers in shard") // Key file to store the private key keyFile = flag.String("key", "./.hmykey", "the p2p key file of the harmony node") + // isGenesis indicates this node is a genesis node + isGenesis = flag.Bool("is_genesis", true, "true means this node is a genesis node") // isArchival indicates this node is an archival node that will save and archive current blockchain isArchival = flag.Bool("is_archival", true, "false makes node faster by turning caching off") // delayCommit is the commit-delay timer, used by Harmony nodes diff --git a/scripts/docker/run b/scripts/docker/run index e932f9c41..6cb97fa4f 100755 --- a/scripts/docker/run +++ b/scripts/docker/run @@ -31,6 +31,6 @@ if [ -z "$NODE_ACCOUNT_ID" ]; then exit 2 fi -harmony -log_folder log -bootnodes $BN_MA -ip $PUB_IP -port $NODE_PORT -account_index $NODE_ACCOUNT_ID +harmony -log_folder log -bootnodes $BN_MA -ip $PUB_IP -port $NODE_PORT -is_genesis -account_index $NODE_ACCOUNT_ID # vim: ai ts=2 sw=2 et sts=2 ft=sh diff --git a/scripts/node.sh b/scripts/node.sh index 3e93e4b1a..84af82400 100755 --- a/scripts/node.sh +++ b/scripts/node.sh @@ -491,6 +491,7 @@ do -bootnodes "${BN_MA}" -ip "${PUB_IP}" -port "${NODE_PORT}" + -is_genesis -blskey_file "${BLSKEYFILE}" -network_type="${network_type}" -dns_zone="${dns_zone}"