[node] set right client group id for non-beacon explorer nodes

Signed-off-by: Leo Chen <leo@harmony.one>
pull/3256/head
Leo Chen 4 years ago
parent 83b70a0a9d
commit d829d227dc
  1. 14
      cmd/harmony/main.go

@ -486,22 +486,12 @@ func setupConsensusAndNode(nodeConfig *nodeconfig.ConfigType) *node.Node {
case "explorer":
nodeconfig.SetDefaultRole(nodeconfig.ExplorerNode)
currentNode.NodeConfig.SetRole(nodeconfig.ExplorerNode)
currentNode.NodeConfig.SetShardGroupID(
nodeconfig.NewGroupIDByShardID(nodeconfig.ShardID(*shardID)),
)
currentNode.NodeConfig.SetClientGroupID(
nodeconfig.NewClientGroupIDByShardID(nodeconfig.ShardID(*shardID)),
)
case "validator":
nodeconfig.SetDefaultRole(nodeconfig.Validator)
currentNode.NodeConfig.SetRole(nodeconfig.Validator)
if nodeConfig.ShardID == shard.BeaconChainShardID {
currentNode.NodeConfig.SetShardGroupID(nodeconfig.NewGroupIDByShardID(shard.BeaconChainShardID))
} else {
currentNode.NodeConfig.SetShardGroupID(nodeconfig.NewGroupIDByShardID(nodeconfig.ShardID(nodeConfig.ShardID)))
}
currentNode.NodeConfig.SetClientGroupID(nodeconfig.NewClientGroupIDByShardID(shard.BeaconChainShardID))
}
currentNode.NodeConfig.SetShardGroupID(nodeconfig.NewGroupIDByShardID(nodeconfig.ShardID(nodeConfig.ShardID)))
currentNode.NodeConfig.SetClientGroupID(nodeconfig.NewClientGroupIDByShardID(shard.BeaconChainShardID))
currentNode.NodeConfig.ConsensusPriKey = nodeConfig.ConsensusPriKey
// This needs to be executed after consensus setup

Loading…
Cancel
Save