|
|
@ -139,12 +139,6 @@ var ( |
|
|
|
"Do not propose view change (testing only)") |
|
|
|
"Do not propose view change (testing only)") |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
|
|
|
|
MainNet = "mainnet" |
|
|
|
|
|
|
|
TestNet = "testnet" |
|
|
|
|
|
|
|
DevNet = "devnet" |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func initSetup() { |
|
|
|
func initSetup() { |
|
|
|
// Set port and ip to global config.
|
|
|
|
// Set port and ip to global config.
|
|
|
|
nodeconfig.GetDefaultConfig().Port = *port |
|
|
|
nodeconfig.GetDefaultConfig().Port = *port |
|
|
@ -260,11 +254,11 @@ func createGlobalConfig() *nodeconfig.ConfigType { |
|
|
|
|
|
|
|
|
|
|
|
// Set network type
|
|
|
|
// Set network type
|
|
|
|
switch *networkType { |
|
|
|
switch *networkType { |
|
|
|
case MainNet: |
|
|
|
case nodeconfig.Mainnet: |
|
|
|
nodeConfig.SetNetworkType(nodeconfig.Mainnet) |
|
|
|
nodeConfig.SetNetworkType(nodeconfig.Mainnet) |
|
|
|
case TestNet: |
|
|
|
case nodeconfig.Testnet: |
|
|
|
nodeConfig.SetNetworkType(nodeconfig.Testnet) |
|
|
|
nodeConfig.SetNetworkType(nodeconfig.Testnet) |
|
|
|
case DevNet: |
|
|
|
case nodeconfig.Devnet: |
|
|
|
nodeConfig.SetNetworkType(nodeconfig.Devnet) |
|
|
|
nodeConfig.SetNetworkType(nodeconfig.Devnet) |
|
|
|
default: |
|
|
|
default: |
|
|
|
panic(fmt.Sprintf("invalid network type: %s", *networkType)) |
|
|
|
panic(fmt.Sprintf("invalid network type: %s", *networkType)) |
|
|
@ -495,7 +489,7 @@ func main() { |
|
|
|
currentNode.ServiceManagerSetup() |
|
|
|
currentNode.ServiceManagerSetup() |
|
|
|
|
|
|
|
|
|
|
|
// RPC for SDK not supported for mainnet.
|
|
|
|
// RPC for SDK not supported for mainnet.
|
|
|
|
if *networkType != MainNet { |
|
|
|
if *networkType != nodeconfig.Mainnet { |
|
|
|
if err := currentNode.StartRPC(*port); err != nil { |
|
|
|
if err := currentNode.StartRPC(*port); err != nil { |
|
|
|
ctxerror.Warn(utils.GetLogger(), err, "StartRPC failed") |
|
|
|
ctxerror.Warn(utils.GetLogger(), err, "StartRPC failed") |
|
|
|
} |
|
|
|
} |
|
|
|