|
|
@ -408,7 +408,7 @@ func New(host p2p.Host, consensusObj *consensus.Consensus, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
networkType := node.NodeConfig.GetNetworkType() |
|
|
|
networkType := node.NodeConfig.GetNetworkType() |
|
|
|
chainConfig := ChainConfigForNetworkType(networkType) |
|
|
|
chainConfig := networkType.ChainConfig() |
|
|
|
node.chainConfig = chainConfig |
|
|
|
node.chainConfig = chainConfig |
|
|
|
|
|
|
|
|
|
|
|
collection := shardchain.NewCollection( |
|
|
|
collection := shardchain.NewCollection( |
|
|
@ -483,17 +483,6 @@ func New(host p2p.Host, consensusObj *consensus.Consensus, |
|
|
|
return &node |
|
|
|
return &node |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func ChainConfigForNetworkType(t nodeconfig.NetworkType) params.ChainConfig { |
|
|
|
|
|
|
|
switch t { |
|
|
|
|
|
|
|
case nodeconfig.Mainnet: |
|
|
|
|
|
|
|
return *params.MainnetChainConfig |
|
|
|
|
|
|
|
case nodeconfig.Pangaea: |
|
|
|
|
|
|
|
return *params.PangaeaChainConfig |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return *params.TestnetChainConfig |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// InitConsensusWithValidators initialize shard state from latest epoch and update committee pub
|
|
|
|
// InitConsensusWithValidators initialize shard state from latest epoch and update committee pub
|
|
|
|
// keys for consensus and drand
|
|
|
|
// keys for consensus and drand
|
|
|
|
func (node *Node) InitConsensusWithValidators() (err error) { |
|
|
|
func (node *Node) InitConsensusWithValidators() (err error) { |
|
|
|