|
|
@ -50,7 +50,7 @@ var ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func printVersion() { |
|
|
|
func printVersion() { |
|
|
|
fmt.Fprintln(os.Stderr, nodeconfig.GetVersion()) |
|
|
|
_, _ = fmt.Fprintln(os.Stderr, nodeconfig.GetVersion()) |
|
|
|
os.Exit(0) |
|
|
|
os.Exit(0) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -171,7 +171,7 @@ func passphraseForBls() { |
|
|
|
} |
|
|
|
} |
|
|
|
passphrase, err := utils.GetPassphraseFromSource(*blsPass) |
|
|
|
passphrase, err := utils.GetPassphraseFromSource(*blsPass) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
fmt.Fprintf(os.Stderr, "ERROR when reading passphrase file: %v\n", err) |
|
|
|
_, _ = fmt.Fprintf(os.Stderr, "ERROR when reading passphrase file: %v\n", err) |
|
|
|
os.Exit(100) |
|
|
|
os.Exit(100) |
|
|
|
} |
|
|
|
} |
|
|
|
blsPassphrase = passphrase |
|
|
|
blsPassphrase = passphrase |
|
|
@ -211,7 +211,7 @@ func setupInitialAccount() (isLeader bool) { |
|
|
|
func setupConsensusKey(nodeConfig *nodeconfig.ConfigType) *bls.PublicKey { |
|
|
|
func setupConsensusKey(nodeConfig *nodeconfig.ConfigType) *bls.PublicKey { |
|
|
|
consensusPriKey, err := blsgen.LoadBlsKeyWithPassPhrase(*blsKeyFile, blsPassphrase) |
|
|
|
consensusPriKey, err := blsgen.LoadBlsKeyWithPassPhrase(*blsKeyFile, blsPassphrase) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
fmt.Fprintf(os.Stderr, "ERROR when loading bls key, err :%v\n", err) |
|
|
|
_, _ = fmt.Fprintf(os.Stderr, "ERROR when loading bls key, err :%v\n", err) |
|
|
|
os.Exit(100) |
|
|
|
os.Exit(100) |
|
|
|
} |
|
|
|
} |
|
|
|
pubKey := consensusPriKey.GetPublicKey() |
|
|
|
pubKey := consensusPriKey.GetPublicKey() |
|
|
@ -284,7 +284,7 @@ func setupConsensusAndNode(nodeConfig *nodeconfig.ConfigType) *node.Node { |
|
|
|
currentConsensus.SelfAddress = common.ParseAddr(initialAccount.Address) |
|
|
|
currentConsensus.SelfAddress = common.ParseAddr(initialAccount.Address) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
fmt.Fprintf(os.Stderr, "Error :%v \n", err) |
|
|
|
_, _ = fmt.Fprintf(os.Stderr, "Error :%v \n", err) |
|
|
|
os.Exit(1) |
|
|
|
os.Exit(1) |
|
|
|
} |
|
|
|
} |
|
|
|
commitDelay, err := time.ParseDuration(*delayCommit) |
|
|
|
commitDelay, err := time.ParseDuration(*delayCommit) |
|
|
@ -401,7 +401,7 @@ func main() { |
|
|
|
case "explorer": |
|
|
|
case "explorer": |
|
|
|
break |
|
|
|
break |
|
|
|
default: |
|
|
|
default: |
|
|
|
fmt.Fprintf(os.Stderr, "Unknown node type: %s\n", *nodeType) |
|
|
|
_, _ = fmt.Fprintf(os.Stderr, "Unknown node type: %s\n", *nodeType) |
|
|
|
os.Exit(1) |
|
|
|
os.Exit(1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|