diff --git a/cmd/burrow/main.go b/cmd/burrow/main.go index 61c270aee1928791df6b64e372978520844ef1ad..5074510fd81418f55fc01b7ce01e5ce6b0359a4e 100644 --- a/cmd/burrow/main.go +++ b/cmd/burrow/main.go @@ -82,8 +82,9 @@ func main() { rootOpt := cmd.IntOpt("r root-accounts", 0, "Number of preset Root type accounts") developerOpt := cmd.IntOpt("d developer-accounts", 0, "Number of preset Developer type accounts") participantsOpt := cmd.IntOpt("p participant-accounts", 1, "Number of preset Participant type accounts") + chainNameOpt := cmd.StringOpt("n chain-name", "", "Default chain name") - cmd.Spec = "[--full-accounts] [--validator-accounts] [--root-accounts] [--developer-accounts] [--participant-accounts] [--toml]" + cmd.Spec = "[--full-accounts] [--validator-accounts] [--root-accounts] [--developer-accounts] [--participant-accounts] [--chain-name] [--toml]" cmd.Action = func() { specs := make([]spec.GenesisSpec, 0, *participantsOpt+*fullOpt) @@ -103,6 +104,7 @@ func main() { specs = append(specs, spec.ParticipantAccount(i)) } genesisSpec := spec.MergeGenesisSpecs(specs...) + genesisSpec.ChainName = *chainNameOpt if *tomlOpt { os.Stdout.WriteString(source.TOMLString(genesisSpec)) } else { @@ -142,9 +144,11 @@ func main() { "including logging opcodes and dumping EVM tokens to disk these can be later pruned from the "+ "generated config.") + chainNameOpt := cmd.StringOpt("n chain-name", "", "Default chain name") + cmd.Spec = "[--keys-url=<keys URL>] [--genesis-spec=<GenesisSpec file> | --genesis-doc=<GenesisDoc file>] " + - "[--validator-index=<index>] [--toml-in] [--json-out] [--logging=<logging program>] " + - "[--describe-logging] [--debug]" + "[--validator-index=<index>] [--chain-name] [--toml-in] [--json-out] " + + "[--logging=<logging program>] [--describe-logging] [--debug]" cmd.Action = func() { conf := config.DefaultBurrowConfig() @@ -225,6 +229,8 @@ func main() { } } + conf.GenesisDoc.ChainName = *chainNameOpt + if *jsonOutOpt { os.Stdout.WriteString(conf.JSONString()) } else { diff --git a/genesis/spec/genesis_spec.go b/genesis/spec/genesis_spec.go index 5d09df5b9e717aa14057c7f5751ff829517fbbd4..c037c5c4f7e6eab92241caed7c41eb1b7d68d1fb 100644 --- a/genesis/spec/genesis_spec.go +++ b/genesis/spec/genesis_spec.go @@ -127,11 +127,12 @@ func (ta TemplateAccount) RealisePubKeyAndAddress(keyClient keys.KeyClient) (pub return } } else { - address := ta.PublicKey.Address() + address = ta.PublicKey.Address() if ta.Address != nil && *ta.Address != address { err = fmt.Errorf("template address %s does not match public key derived address %s", ta.Address, ta.PublicKey) } + pubKey = *ta.PublicKey } return }