addressing leo and chao comments

pull/601/head
ak 6 years ago
parent dd65bf4673
commit d0832dbbb1
  1. 9
      cmd/harmony/main.go
  2. 2
      internal/configs/node/config.go
  3. 1
      node/node.go
  4. 1
      node/node_syncing.go
  5. 2
      test/deploy.sh

@ -8,7 +8,6 @@ import (
"path"
"runtime"
"strconv"
"sync"
"time"
"github.com/ethereum/go-ethereum/ethdb"
@ -31,7 +30,6 @@ var (
builtBy string
builtAt string
commit string
stateMutex sync.Mutex
)
// InitLDBDatabase initializes a LDBDatabase. isBeacon=true will return the beacon chain database for normal shard nodes
@ -86,9 +84,9 @@ var (
keyFile = flag.String("key", "./.hmykey", "the private key file of the harmony node")
// isBeacon indicates this node is a beacon chain node
isBeacon = flag.Bool("is_beacon", false, "true means this node is a beacon chain node")
// isArchival indicates this node is a archival node that will save and archive current blockchain
// isArchival indicates this node is an archival node that will save and archive current blockchain
isArchival = flag.Bool("is_archival", false, "true means this node is a archival node")
// isNewNode indicates this node is a new node
//isNewNode indicates this node is a new node
isNewNode = flag.Bool("is_newnode", false, "true means this node is a new node")
accountIndex = flag.Int("account_index", 0, "the index of the staking account to use")
// isLeader indicates this node is a beacon chain leader node during the bootstrap process
@ -263,7 +261,6 @@ func main() {
if *isArchival {
currentNode, nodeConfig = setupArchivalNode(nodeConfig)
loggingInit(*logFolder, nodeConfig.StringRole, *ip, *port, *onlyLogTps)
log.Info("New Harmony Node ====", "Role", currentNode.NodeConfig.Role(), "multiaddress", fmt.Sprintf("/ip4/%s/tcp/%s/p2p/%s", *ip, *port, nodeConfig.Host.GetID().Pretty()))
go currentNode.DoBeaconSyncing()
} else {
// Start Profiler for leader if profile argument is on
@ -280,9 +277,9 @@ func main() {
}
// Init logging.
loggingInit(*logFolder, nodeConfig.StringRole, *ip, *port, *onlyLogTps)
log.Info("New Harmony Node ====", "Role", currentNode.NodeConfig.Role(), "multiaddress", fmt.Sprintf("/ip4/%s/tcp/%s/p2p/%s", *ip, *port, nodeConfig.Host.GetID().Pretty()))
go currentNode.SupportSyncing()
}
log.Info("New Harmony Node ====", "Role", currentNode.NodeConfig.Role(), "multiaddress", fmt.Sprintf("/ip4/%s/tcp/%s/p2p/%s", *ip, *port, nodeConfig.Host.GetID().Pretty()))
currentNode.ServiceManagerSetup()
currentNode.RunServices()
currentNode.StartServer()

@ -143,7 +143,7 @@ func (conf *ConfigType) SetIsLeader(b bool) {
conf.isLeader = b
}
// SetIsArchival set the isLeader configuration
// SetIsArchival set the isArchival configuration
func (conf *ConfigType) SetIsArchival(b bool) {
conf.isArchival = b
}

@ -247,7 +247,6 @@ func New(host p2p.Host, consensusObj *consensus.Consensus, db ethdb.Database) *N
node.BlockChannel = make(chan *types.Block)
node.ConfirmedBlockChannel = make(chan *types.Block)
node.BeaconBlockChannel = make(chan *types.Block)
utils.GetLogInstance().Debug("All Channels setup for ", "node", node.SelfPeer)
node.TxPool = core.NewTxPool(core.DefaultTxPoolConfig, params.TestChainConfig, chain)
node.Worker = worker.New(params.TestChainConfig, chain, node.Consensus, pki.GetAddressFromPublicKey(node.SelfPeer.ConsensusPubKey), node.Consensus.ShardID)

@ -70,7 +70,6 @@ func (node *Node) DoBeaconSyncing() {
for {
select {
case beaconBlock := <-node.BeaconBlockChannel:
utils.GetLogInstance().Debug("[SYNC] Received BeaconBlockChannel Ping for Sync")
if node.beaconSync == nil {
node.beaconSync = syncing.CreateStateSync(node.SelfPeer.IP, node.SelfPeer.Port)
node.beaconSync.CreateSyncConfig(node.GetBeaconSyncingPeers())

@ -177,7 +177,7 @@ else
sleep $DURATION
fi
#save bc_config.json
# save bc_config.json
[ -e bc_config.json ] && cp -f bc_config.json $log_folder
cleanup

Loading…
Cancel
Save