|
|
|
@ -224,6 +224,7 @@ func setupConsensusKey(nodeConfig *nodeconfig.ConfigType) *bls.PublicKey { |
|
|
|
|
os.Exit(100) |
|
|
|
|
} |
|
|
|
|
pubKey := consensusPriKey.GetPublicKey() |
|
|
|
|
|
|
|
|
|
// Consensus keys are the BLS12-381 keys used to sign consensus messages
|
|
|
|
|
nodeConfig.ConsensusPriKey, nodeConfig.ConsensusPubKey = consensusPriKey, consensusPriKey.GetPublicKey() |
|
|
|
|
if nodeConfig.ConsensusPriKey == nil || nodeConfig.ConsensusPubKey == nil { |
|
|
|
@ -235,6 +236,7 @@ func setupConsensusKey(nodeConfig *nodeconfig.ConfigType) *bls.PublicKey { |
|
|
|
|
|
|
|
|
|
func createGlobalConfig() *nodeconfig.ConfigType { |
|
|
|
|
var err error |
|
|
|
|
|
|
|
|
|
nodeConfig := nodeconfig.GetShardConfig(initialAccount.ShardID) |
|
|
|
|
if *nodeType == "validator" { |
|
|
|
|
// Set up consensus keys.
|
|
|
|
@ -308,7 +310,6 @@ func setupConsensusAndNode(nodeConfig *nodeconfig.ConfigType) *node.Node { |
|
|
|
|
|
|
|
|
|
// Current node.
|
|
|
|
|
chainDBFactory := &shardchain.LDBFactory{RootDir: nodeConfig.DBDir} |
|
|
|
|
|
|
|
|
|
currentNode := node.New(myHost, currentConsensus, chainDBFactory, *isArchival) |
|
|
|
|
|
|
|
|
|
switch { |
|
|
|
@ -339,6 +340,7 @@ func setupConsensusAndNode(nodeConfig *nodeconfig.ConfigType) *node.Node { |
|
|
|
|
currentNode.NodeConfig.SetPushgatewayIP(nodeConfig.PushgatewayIP) |
|
|
|
|
currentNode.NodeConfig.SetPushgatewayPort(nodeConfig.PushgatewayPort) |
|
|
|
|
currentNode.NodeConfig.SetMetricsFlag(nodeConfig.MetricsFlag) |
|
|
|
|
|
|
|
|
|
currentNode.NodeConfig.SetBeaconGroupID(nodeconfig.NewGroupIDByShardID(0)) |
|
|
|
|
|
|
|
|
|
switch *nodeType { |
|
|
|
@ -494,7 +496,6 @@ func main() { |
|
|
|
|
currentNode.ServiceManagerSetup() |
|
|
|
|
|
|
|
|
|
currentNode.RunServices() |
|
|
|
|
|
|
|
|
|
// RPC for SDK not supported for mainnet.
|
|
|
|
|
if err := currentNode.StartRPC(*port); err != nil { |
|
|
|
|
utils.Logger().Warn(). |
|
|
|
|