diff --git a/acm/acm.pb.go b/acm/acm.pb.go index 9c508767c..a5f44adaf 100644 --- a/acm/acm.pb.go +++ b/acm/acm.pb.go @@ -5,15 +5,14 @@ package acm import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" crypto "github.com/hyperledger/burrow/crypto" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" permission "github.com/hyperledger/burrow/permission" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/acm/balance/balance.pb.go b/acm/balance/balance.pb.go index 1e52810f1..dcf845e9e 100644 --- a/acm/balance/balance.pb.go +++ b/acm/balance/balance.pb.go @@ -5,12 +5,11 @@ package balance import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/acm/validator/validator.pb.go b/acm/validator/validator.pb.go index 14decd2a3..2487af8d4 100644 --- a/acm/validator/validator.pb.go +++ b/acm/validator/validator.pb.go @@ -5,14 +5,13 @@ package validator import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" crypto "github.com/hyperledger/burrow/crypto" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/bcm/bcm.pb.go b/bcm/bcm.pb.go index 9173306b5..4c0f45b50 100644 --- a/bcm/bcm.pb.go +++ b/bcm/bcm.pb.go @@ -5,10 +5,6 @@ package bcm import ( fmt "fmt" - io "io" - math "math" - time "time" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" @@ -16,6 +12,9 @@ import ( _ "github.com/golang/protobuf/ptypes/duration" _ "github.com/golang/protobuf/ptypes/timestamp" github_com_hyperledger_burrow_binary "github.com/hyperledger/burrow/binary" + io "io" + math "math" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/cmd/burrow/commands/configure.go b/cmd/burrow/commands/configure.go index 1ff30b9a9..c51edec42 100644 --- a/cmd/burrow/commands/configure.go +++ b/cmd/burrow/commands/configure.go @@ -6,14 +6,13 @@ import ( "io/ioutil" "strings" - "github.com/hyperledger/burrow/dump" - + "github.com/hyperledger/burrow/config/deployment" "github.com/hyperledger/burrow/config/source" + "github.com/hyperledger/burrow/consensus/tendermint" "github.com/hyperledger/burrow/crypto" - "github.com/hyperledger/burrow/deployment" + "github.com/hyperledger/burrow/dump" "github.com/hyperledger/burrow/execution" "github.com/hyperledger/burrow/execution/state" - "github.com/hyperledger/burrow/genesis" "github.com/hyperledger/burrow/genesis/spec" "github.com/hyperledger/burrow/keys" "github.com/hyperledger/burrow/logging" @@ -22,10 +21,8 @@ import ( "github.com/hyperledger/burrow/rpc" cli "github.com/jawher/mow.cli" amino "github.com/tendermint/go-amino" - tmEd25519 "github.com/tendermint/tendermint/crypto/ed25519" cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/libs/db" - "github.com/tendermint/tendermint/p2p" ) // Configure generates burrow configuration(s) @@ -43,15 +40,11 @@ func Configure(output Output) func(cmd *cli.Cmd) { keysDir := cmd.StringOpt("keys-dir", "", "Directory where keys are stored") - generateNodeKeys := cmd.BoolOpt("generate-node-keys", false, "Generate node keys for validators") - configTemplateIn := cmd.StringsOpt("config-template-in", nil, - fmt.Sprintf("Go text/template template input filename (left delim: %s right delim: %s) to generate config "+ - "file specified with --config-out", deployment.LeftTemplateDelim, deployment.RightTemplateDelim)) + "Go text/template input filename to generate config file specified with --config-out") - configOut := cmd.StringsOpt("config-out", nil, - "Go text/template template output file. Template filename specified with --config-template-in "+ - "file specified with --config-out") + configTemplateOut := cmd.StringsOpt("config-out", nil, + "Go text/template output filename. Template filename specified with --config-template-in") separateGenesisDoc := cmd.StringOpt("w separate-genesis-doc", "", "Emit a separate genesis doc as JSON or TOML") @@ -79,9 +72,8 @@ func Configure(output Output) func(cmd *cli.Cmd) { cmd.Spec = "[--keys-url= | --keys-dir=] " + "[ --config-template-in= --config-out=]... " + "[--genesis-spec=] [--separate-genesis-doc=] " + - "[--chain-name=] [--generate-node-keys] [--restore-dump=] " + - "[--logging=] [--describe-logging] [--empty-blocks=<'always','never',duration>] " + - "[--json] [--debug] [--pool]" + "[--chain-name=] [--restore-dump=] [--json] [--debug] [--pool] " + + "[--logging=] [--describe-logging] [--empty-blocks=<'always','never',duration>]" // no sourcing logs source.LogWriter = ioutil.Discard @@ -109,11 +101,11 @@ func Configure(output Output) func(cmd *cli.Cmd) { conf.Keys.RemoteAddress = *keysURLOpt } - if len(*configTemplateIn) != len(*configOut) { + if len(*configTemplateIn) != len(*configTemplateOut) { output.Fatalf("--config-template-in and --config-out must be specified the same number of times") } - pkg := deployment.Config{} + pkg := deployment.Config{Keys: make(map[crypto.Address]deployment.Key)} // Genesis Spec if *genesisSpecOpt != "" { @@ -130,9 +122,9 @@ func Configure(output Output) func(cmd *cli.Cmd) { keyStore := keys.NewKeyStore(dir, conf.Keys.AllowBadFilePermissions) keyClient := keys.NewLocalKeyClient(keyStore, logging.NewNoopLogger()) - conf.GenesisDoc, err = genesisSpec.GenesisDoc(keyClient, *generateNodeKeys || *pool) + conf.GenesisDoc, err = genesisSpec.GenesisDoc(keyClient) if err != nil { - output.Fatalf("Could not generate GenesisDoc from GenesisSpec using MockKeyClient: %v", err) + output.Fatalf("could not generate GenesisDoc from GenesisSpec using MockKeyClient: %v", err) } allNames, err := keyStore.GetAllNames() @@ -140,56 +132,27 @@ func Configure(output Output) func(cmd *cli.Cmd) { output.Fatalf("could get all keys: %v", err) } - cdc := amino.NewCodec() - cryptoAmino.RegisterAmino(cdc) - - pkg = deployment.Config{Keys: make(map[crypto.Address]deployment.Key)} - for k := range allNames { addr, err := crypto.AddressFromHexString(allNames[k]) if err != nil { - output.Fatalf("Address %s not valid: %v", k, err) + output.Fatalf("address %s not valid: %v", k, err) } key, err := keyStore.GetKey("", addr[:]) if err != nil { - output.Fatalf("Failed to get key: %s: %v", k, err) + output.Fatalf("failed to get key: %s: %v", k, err) } - - // Is this is a validator node key? - nodeKey := false - for _, a := range conf.GenesisDoc.Validators { - if a.NodeAddress != nil && addr == *a.NodeAddress { - nodeKey = true - break - } - } - - if nodeKey { - privKey := tmEd25519.GenPrivKey() - copy(privKey[:], key.PrivateKey.PrivateKey) - nodeKey := &p2p.NodeKey{ - PrivKey: privKey, - } - - json, err := cdc.MarshalJSON(nodeKey) - if err != nil { - output.Fatalf("go-amino failed to json marshall private key: %v", err) - } - pkg.Keys[addr] = deployment.Key{Name: k, Address: addr, KeyJSON: json} - } else { - json, err := json.Marshal(key) - if err != nil { - output.Fatalf("Failed to json marshal key: %s: %v", k, err) - } - pkg.Keys[addr] = deployment.Key{Name: k, Address: addr, KeyJSON: json} + json, err := json.Marshal(key) + if err != nil { + output.Fatalf("failed to json marshal key: %s: %v", k, err) } + pkg.Keys[addr] = deployment.Key{Name: k, Address: addr, KeyJSON: json} } } else { keyClient, err := keys.NewRemoteKeyClient(conf.Keys.RemoteAddress, logging.NewNoopLogger()) if err != nil { - output.Fatalf("Could not create remote key client: %v", err) + output.Fatalf("could not create remote key client: %v", err) } - conf.GenesisDoc, err = genesisSpec.GenesisDoc(keyClient, *generateNodeKeys || *pool) + conf.GenesisDoc, err = genesisSpec.GenesisDoc(keyClient) if err != nil { output.Fatalf("could not realise GenesisSpec: %v", err) } @@ -199,7 +162,7 @@ func Configure(output Output) func(cmd *cli.Cmd) { if *chainNameOpt != "" { if conf.GenesisDoc == nil { - output.Fatalf("Unable to set ChainName since no GenesisDoc/GenesisSpec provided.") + output.Fatalf("unable to set ChainName since no GenesisDoc/GenesisSpec provided.") } conf.GenesisDoc.ChainName = *chainNameOpt } @@ -210,12 +173,12 @@ func Configure(output Output) func(cmd *cli.Cmd) { } if len(conf.GenesisDoc.Validators) == 0 { - output.Fatalf("On restore, validators must be provided in GenesisDoc or GenesisSpec") + output.Fatalf("on restore, validators must be provided in GenesisDoc or GenesisSpec") } reader, err := dump.NewFileReader(*restoreDumpOpt) if err != nil { - output.Fatalf("Failed to read restore dump: %v", err) + output.Fatalf("failed to read restore dump: %v", err) } st, err := state.MakeGenesisState(db.NewMemDB(), conf.GenesisDoc) @@ -231,30 +194,6 @@ func Configure(output Output) func(cmd *cli.Cmd) { conf.GenesisDoc.AppHash = st.Hash() } - if conf.GenesisDoc != nil { - pkg.Config = conf.GenesisDoc - - for _, v := range conf.GenesisDoc.Validators { - tmplV := deployment.Validator{ - Name: v.Name, - Address: v.Address, - } - - if v.NodeAddress != nil { - tmplV.NodeAddress = *v.NodeAddress - } - - pkg.Validators = append(pkg.Validators, tmplV) - } - - for ind := range *configTemplateIn { - err := processTemplate(&pkg, conf.GenesisDoc, (*configTemplateIn)[ind], (*configOut)[ind]) - if err != nil { - output.Fatalf("could not template from %s to %s: %v", (*configTemplateIn)[ind], (*configOut)[ind], err) - } - } - } - // Logging if *loggingOpt != "" { ops := strings.Split(*loggingOpt, ",") @@ -276,15 +215,15 @@ func Configure(output Output) func(cmd *cli.Cmd) { if *separateGenesisDoc != "" { if conf.GenesisDoc == nil { - output.Fatalf("Cannot write separate genesis doc since no GenesisDoc/GenesisSpec provided.") + output.Fatalf("cannot write separate genesis doc since no GenesisDoc/GenesisSpec was provided") } genesisDocJSON, err := conf.GenesisDoc.JSONBytes() if err != nil { - output.Fatalf("Could not form GenesisDoc JSON: %v", err) + output.Fatalf("could not form GenesisDoc JSON: %v", err) } err = ioutil.WriteFile(*separateGenesisDoc, genesisDocJSON, 0644) if err != nil { - output.Fatalf("Could not write GenesisDoc JSON: %v", err) + output.Fatalf("could not write GenesisDoc JSON: %v", err) } conf.GenesisDoc = nil } @@ -293,19 +232,54 @@ func Configure(output Output) func(cmd *cli.Cmd) { conf.Tendermint.CreateEmptyBlocks = *emptyBlocksOpt } + peers := make([]string, 0) + if conf.GenesisDoc != nil { + cdc := amino.NewCodec() + cryptoAmino.RegisterAmino(cdc) + pkg.GenesisDoc = conf.GenesisDoc + + for _, val := range conf.GenesisDoc.Validators { + nodeKey := tendermint.NewNodeKey() + nodeAddress, _ := crypto.AddressFromHexString(string(nodeKey.ID())) + + json, err := cdc.MarshalJSON(nodeKey) + if err != nil { + output.Fatalf("go-amino failed to json marshal private key: %v", err) + } + pkg.Keys[nodeAddress] = deployment.Key{Name: val.Name, Address: nodeAddress, KeyJSON: json} + + pkg.Validators = append(pkg.Validators, deployment.Validator{ + Name: val.Name, + Address: val.Address, + NodeAddress: nodeAddress, + }) + } + + for ind := range *configTemplateIn { + err := processTemplate(&pkg, (*configTemplateIn)[ind], (*configTemplateOut)[ind]) + if err != nil { + output.Fatalf("could not template from %s to %s: %v", (*configTemplateIn)[ind], (*configTemplateOut)[ind], err) + } + } + } + if *pool { - peers := make([]string, 0) - for i, val := range conf.GenesisDoc.Validators { - if val.NodeAddress == nil { - continue + for i, val := range pkg.Validators { + tmConf, err := conf.Tendermint.Config(fmt.Sprintf(".burrow%03d", i), conf.Execution.TimeoutFactor) + if err != nil { + output.Fatalf("could not obtain config for %03d: %v", i, err) } - peers = append(peers, fmt.Sprintf("tcp://%s@127.0.0.1:%d", strings.ToLower(val.NodeAddress.String()), 26656+i)) + nodeKey := pkg.Keys[val.NodeAddress] + err = tendermint.WriteNodeKey(tmConf.NodeKeyFile(), nodeKey.KeyJSON) + if err != nil { + output.Fatalf("failed to create node key for %03d: %v", i, err) + } + peers = append(peers, fmt.Sprintf("tcp://%s@127.0.0.1:%d", nodeKey.Address.String(), 26656+i)) } for i, acc := range conf.GenesisDoc.Accounts { // set stuff conf.Address = &acc.Address conf.Tendermint.PersistentPeers = strings.Join(peers, ",") - conf.BurrowDir = fmt.Sprintf(".burrow%03d", i) conf.Tendermint.ListenHost = rpc.LocalHost conf.Tendermint.ListenPort = fmt.Sprint(26656 + i) @@ -334,7 +308,7 @@ func Configure(output Output) func(cmd *cli.Cmd) { } } -func processTemplate(pkg *deployment.Config, config *genesis.GenesisDoc, templateIn, templateOut string) error { +func processTemplate(pkg *deployment.Config, templateIn, templateOut string) error { data, err := ioutil.ReadFile(templateIn) if err != nil { return err diff --git a/cmd/burrow/commands/keys.go b/cmd/burrow/commands/keys.go index 2b6b26443..12d03641b 100644 --- a/cmd/burrow/commands/keys.go +++ b/cmd/burrow/commands/keys.go @@ -12,8 +12,8 @@ import ( "github.com/howeyc/gopass" "github.com/hyperledger/burrow/config" + "github.com/hyperledger/burrow/config/deployment" "github.com/hyperledger/burrow/crypto" - "github.com/hyperledger/burrow/deployment" "github.com/hyperledger/burrow/keys" cli "github.com/jawher/mow.cli" "google.golang.org/grpc" diff --git a/deployment/config.go b/config/deployment/config.go similarity index 70% rename from deployment/config.go rename to config/deployment/config.go index ff935f05d..6e5342bb5 100644 --- a/deployment/config.go +++ b/config/deployment/config.go @@ -33,12 +33,9 @@ type Key struct { type Config struct { Keys map[crypto.Address]Key Validators []Validator - Config *genesis.GenesisDoc + *genesis.GenesisDoc } -const LeftTemplateDelim = "<<" -const RightTemplateDelim = ">>" - var templateFuncs template.FuncMap = map[string]interface{}{ "base64": func(rv reflect.Value) string { return encode(rv, base64.StdEncoding.EncodeToString) @@ -57,20 +54,18 @@ var templateFuncs template.FuncMap = map[string]interface{}{ } const DefaultKeysExportFormat = `{ - "CurveType": "<< .CurveType>>", - "Address": "<< .Address >>", - "PublicKey": "<< hex .PublicKey >>", - "PrivateKey": "<< hex .PrivateKey >>" -} -` + "CurveType": "{{ .CurveType }}", + "Address": "{{ .Address }}", + "PublicKey": "{{ hex .PublicKey }}", + "PrivateKey": "{{ hex .PrivateKey }}" +}` -var DefaultKeyExportTemplate = template.Must(template.New("KeysExport").Funcs(templateFuncs). - Delims(LeftTemplateDelim, RightTemplateDelim). - Parse(DefaultKeysExportFormat)) +var DefaultKeyExportTemplate = template.Must(template.New("KeysExport"). + Funcs(templateFuncs).Parse(DefaultKeysExportFormat)) -func (pkg *Config) Dump(templateName, templateString string) (string, error) { - tmpl, err := template.New(templateName).Delims(LeftTemplateDelim, RightTemplateDelim).Funcs(templateFuncs). - Parse(templateString) +// Dump a configuration to a template +func (pkg *Config) Dump(templateName, templateData string) (string, error) { + tmpl, err := template.New(templateName).Funcs(templateFuncs).Parse(templateData) if err != nil { return "", errors.Wrap(err, "could not dump config to template") } @@ -82,9 +77,9 @@ func (pkg *Config) Dump(templateName, templateString string) (string, error) { return buf.String(), nil } -func (key *Key) Dump(templateString string) (string, error) { - tmpl, err := template.New("ExportKey").Delims(LeftTemplateDelim, RightTemplateDelim).Funcs(templateFuncs). - Parse(templateString) +// Dump a key file to a template +func (key *Key) Dump(templateData string) (string, error) { + tmpl, err := template.New("ExportKey").Funcs(templateFuncs).Parse(templateData) if err != nil { return "", errors.Wrap(err, "could not export key to template") } diff --git a/consensus/tendermint/tendermint.go b/consensus/tendermint/tendermint.go index c87fceda1..ca53a1e76 100644 --- a/consensus/tendermint/tendermint.go +++ b/consensus/tendermint/tendermint.go @@ -1,6 +1,8 @@ package tendermint import ( + "encoding/json" + "io/ioutil" "os" "path" @@ -45,27 +47,15 @@ func (n *Node) Close() { } func NewNode(conf *config.Config, privValidator tmTypes.PrivValidator, genesisDoc *tmTypes.GenesisDoc, - app *abci.App, metricsProvider node.MetricsProvider, marmotNodeKey *crypto.PrivateKey, logger *logging.Logger) (*Node, error) { + app *abci.App, metricsProvider node.MetricsProvider, logger *logging.Logger) (*Node, error) { var err error // disable Tendermint's RPC conf.RPC.ListenAddress = "" - var nodeKey *p2p.NodeKey - if marmotNodeKey != nil && marmotNodeKey.CurveType == crypto.CurveTypeEd25519 { - var pkey ed25519.PrivKeyEd25519 - copy(pkey[:], marmotNodeKey.PrivateKey) - nodeKey = &p2p.NodeKey{PrivKey: pkey} - } else { - err = os.MkdirAll(path.Dir(conf.NodeKeyFile()), 0777) - if err != nil { - return nil, err - } - - nodeKey, err = p2p.LoadOrGenNodeKey(conf.NodeKeyFile()) - if err != nil { - return nil, err - } + nodeKey, err := EnsureNodeKey(conf.NodeKeyFile()) + if err != nil { + return nil, err } nde := &Node{} @@ -122,3 +112,27 @@ func NewNodeInfo(ni p2p.DefaultNodeInfo) *NodeInfo { TxIndex: ni.Other.TxIndex, } } + +func NewNodeKey() *p2p.NodeKey { + privKey := ed25519.GenPrivKey() + return &p2p.NodeKey{ + PrivKey: privKey, + } +} + +func WriteNodeKey(nodeKeyFile string, key json.RawMessage) error { + err := os.MkdirAll(path.Dir(nodeKeyFile), 0777) + if err != nil { + return err + } + return ioutil.WriteFile(nodeKeyFile, key, 0600) +} + +func EnsureNodeKey(nodeKeyFile string) (*p2p.NodeKey, error) { + err := os.MkdirAll(path.Dir(nodeKeyFile), 0777) + if err != nil { + return nil, err + } + + return p2p.LoadOrGenNodeKey(nodeKeyFile) +} diff --git a/consensus/tendermint/tendermint.pb.go b/consensus/tendermint/tendermint.pb.go index f3bf40096..feb604bdf 100644 --- a/consensus/tendermint/tendermint.pb.go +++ b/consensus/tendermint/tendermint.pb.go @@ -5,14 +5,13 @@ package tendermint import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" github_com_hyperledger_burrow_binary "github.com/hyperledger/burrow/binary" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/core/config.go b/core/config.go index 2944b8b37..ae38b4b93 100644 --- a/core/config.go +++ b/core/config.go @@ -7,7 +7,6 @@ import ( "github.com/hyperledger/burrow/config" "github.com/hyperledger/burrow/consensus/abci" "github.com/hyperledger/burrow/consensus/tendermint" - "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/execution" "github.com/hyperledger/burrow/keys" "github.com/hyperledger/burrow/logging/lifecycle" @@ -77,22 +76,6 @@ func (kern *Kernel) LoadTendermintFromConfig(conf *config.BurrowConfig, privVal genesisDoc := kern.Blockchain.GenesisDoc() - // find node key - var nodeKey *crypto.PrivateKey - for _, v := range genesisDoc.Validators { - thisAddress, err := crypto.AddressFromHexString(privVal.GetPubKey().Address().String()) - if err != nil { - break - } - if v.Address == thisAddress && v.NodeAddress != nil { - k, err := kern.keyStore.GetKey("", v.NodeAddress.Bytes()) - if err == nil { - nodeKey = &k.PrivateKey - } - break - } - } - tmGenesisDoc := tendermint.DeriveGenesisDoc(&genesisDoc, kern.Blockchain.AppHashAfterLastBlock()) heightValuer := log.Valuer(func() interface{} { return kern.Blockchain.LastBlockHeight() }) tmLogger := kern.Logger.With(structure.CallerKey, log.Caller(LoggingCallerDepth+1)).With("height", heightValuer) @@ -100,7 +83,7 @@ func (kern *Kernel) LoadTendermintFromConfig(conf *config.BurrowConfig, privVal if err != nil { return fmt.Errorf("could not build Tendermint config: %v", err) } - kern.Node, err = tendermint.NewNode(tmConf, privVal, tmGenesisDoc, app, metricsProvider, nodeKey, tmLogger) + kern.Node, err = tendermint.NewNode(tmConf, privVal, tmGenesisDoc, app, metricsProvider, tmLogger) return err } diff --git a/crypto/crypto.pb.go b/crypto/crypto.pb.go index a7bce82f6..4b0490195 100644 --- a/crypto/crypto.pb.go +++ b/crypto/crypto.pb.go @@ -5,13 +5,12 @@ package crypto import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" github_com_hyperledger_burrow_binary "github.com/hyperledger/burrow/binary" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/docs/arch/state.md b/docs/architecture/state.md similarity index 100% rename from docs/arch/state.md rename to docs/architecture/state.md diff --git a/dump/dump.pb.go b/dump/dump.pb.go index 4b3c5f45c..5078268ec 100644 --- a/dump/dump.pb.go +++ b/dump/dump.pb.go @@ -5,10 +5,6 @@ package dump import ( fmt "fmt" - io "io" - math "math" - time "time" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" @@ -19,6 +15,9 @@ import ( github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" exec "github.com/hyperledger/burrow/execution/exec" names "github.com/hyperledger/burrow/execution/names" + io "io" + math "math" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/execution/contexts/governance_context.go b/execution/contexts/governance_context.go index 62ce355a1..0de857342 100644 --- a/execution/contexts/governance_context.go +++ b/execution/contexts/governance_context.go @@ -94,10 +94,6 @@ func (ctx *GovernanceContext) UpdateAccount(account *acm.Account, update *spec.T if update.Balances().HasNative() { account.Balance = update.Balances().GetNative(0) } - if update.NodeAddress != nil { - // TODO: can we do something useful if provided with a NodeAddress for an account about to become a validator - // like add it to persistent peers or pre gossip so it gets inbound connections? If so under which circumstances? - } if update.Balances().HasPower() { if update.PublicKey == nil { err = fmt.Errorf("updateAccount should have PublicKey by this point but appears not to for "+ diff --git a/execution/errors/errors.pb.go b/execution/errors/errors.pb.go index a75c80951..97fb131a2 100644 --- a/execution/errors/errors.pb.go +++ b/execution/errors/errors.pb.go @@ -5,12 +5,11 @@ package errors import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/execution/exec/exec.pb.go b/execution/exec/exec.pb.go index eeab4d2a5..de5c18e22 100644 --- a/execution/exec/exec.pb.go +++ b/execution/exec/exec.pb.go @@ -5,10 +5,6 @@ package exec import ( fmt "fmt" - io "io" - math "math" - time "time" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" @@ -24,6 +20,9 @@ import ( txs "github.com/hyperledger/burrow/txs" github_com_hyperledger_burrow_txs_payload "github.com/hyperledger/burrow/txs/payload" types "github.com/tendermint/tendermint/abci/types" + io "io" + math "math" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. @@ -500,8 +499,8 @@ func (*BlockExecution) XXX_MessageName() string { type TxExecutionKey struct { // The block height Height uint64 `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"` - // The offset of the TxExecution - Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + // The offset of the TxExecution in bytes + Offset uint64 `protobuf:"varint,2,opt,name=Offset,proto3" json:"Offset,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1358,83 +1357,83 @@ func init() { golang_proto.RegisterFile("exec.proto", fileDescriptor_4d737c7315c var fileDescriptor_4d737c7315c25422 = []byte{ // 1252 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xef, 0xda, 0xeb, 0x7f, 0x63, 0xa7, 0x94, 0x51, 0xa9, 0xac, 0x1c, 0xec, 0xb0, 0x85, 0x52, - 0x42, 0xbb, 0xae, 0x02, 0x01, 0x14, 0x24, 0x44, 0xdc, 0x44, 0x49, 0x68, 0x68, 0x61, 0xea, 0x16, + 0x14, 0xef, 0xda, 0xeb, 0x7f, 0x63, 0xa7, 0x94, 0x51, 0xa9, 0xac, 0x1e, 0xec, 0xb0, 0x85, 0x52, + 0x42, 0xbb, 0xae, 0x02, 0x01, 0x14, 0x24, 0x44, 0xdc, 0x44, 0x49, 0x68, 0x68, 0x60, 0xea, 0x16, 0x81, 0xe0, 0xb0, 0xde, 0x9d, 0xac, 0x57, 0xb5, 0x77, 0x57, 0xbb, 0xe3, 0xb0, 0xfe, 0x02, 0x1c, 0x10, 0x07, 0xb8, 0x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 0x03, 0x55, 0x84, 0xd4, 0x4b, 0x9a, - 0x05, 0x01, 0x5f, 0xc8, 0xc0, 0x7b, 0x09, 0x51, 0x56, 0xfc, 0x05, 0xaa, 0x6e, 0xfa, 0xfb, 0x74, - 0x18, 0x84, 0xb4, 0x59, 0x04, 0x24, 0x0f, 0x53, 0x29, 0xbb, 0xe6, 0x93, 0x69, 0x7b, 0x39, 0x93, - 0xad, 0xc1, 0x24, 0xa4, 0xd1, 0x90, 0x3a, 0x2e, 0x8d, 0x3a, 0xfd, 0x71, 0x14, 0x05, 0xdf, 0x74, - 0xb2, 0x78, 0x92, 0xba, 0xc3, 0xaf, 0xa2, 0x92, 0x08, 0xbf, 0xa9, 0x0b, 0xbf, 0x75, 0x19, 0x81, - 0x50, 0x11, 0x69, 0x11, 0x10, 0xdf, 0xe9, 0x25, 0xcd, 0x52, 0x0e, 0xc2, 0x55, 0x44, 0x5a, 0xf0, - 0x32, 0x0f, 0xd0, 0x91, 0x2f, 0x2f, 0x0b, 0xd4, 0xf9, 0x14, 0x25, 0xdf, 0x9d, 0xda, 0xd7, 0xf4, - 0x83, 0x47, 0x6d, 0xcd, 0xb8, 0x95, 0xcd, 0x16, 0xbe, 0x84, 0xca, 0xdb, 0xd4, 0x73, 0x07, 0x4c, - 0xe4, 0x4d, 0x27, 0x20, 0xe1, 0xd7, 0xb9, 0xde, 0x72, 0x68, 0x94, 0x26, 0x48, 0x96, 0x59, 0x2a, - 0x09, 0x18, 0x0d, 0x63, 0xf6, 0xf7, 0xcf, 0x73, 0x65, 0x7c, 0xaf, 0xa5, 0xd9, 0xe6, 0xe1, 0xf6, - 0x12, 0x70, 0xac, 0x65, 0xc3, 0x55, 0x5a, 0x92, 0xda, 0xf1, 0x6b, 0xa8, 0x4c, 0x68, 0x3c, 0x1e, - 0x32, 0x08, 0xa1, 0x21, 0x91, 0x52, 0x47, 0xc0, 0x86, 0x3b, 0xa8, 0xb6, 0x99, 0xd8, 0x34, 0x64, - 0x5e, 0xe0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x96, 0x66, 0x9b, 0x87, 0xdb, + 0x4b, 0xc0, 0xb1, 0x96, 0x0d, 0x57, 0x69, 0x49, 0x6a, 0xc7, 0xaf, 0xa1, 0x32, 0xa1, 0xf1, 0x78, + 0xc8, 0x20, 0x84, 0x86, 0x44, 0x4a, 0x1d, 0x01, 0x1b, 0xee, 0xa0, 0xda, 0x46, 0x62, 0xd3, 0x90, + 0x79, 0x81, 0x0f, 0xa9, 0x7c, 0xd9, 0x04, 0x92, 0xa5, 0x06, 0x32, 0xc3, 0x18, 0xf7, 0x21, 0xa9, + 0xf8, 0x13, 0x54, 0xee, 0x25, 0x5b, 0x56, 0x3c, 0x10, 0x95, 0x6d, 0x74, 0x57, 0x0e, 0xa6, 0xed, + 0x73, 0x4f, 0xa6, 0xed, 0x1b, 0x27, 0x97, 0xb3, 0xef, 0xf9, 0x56, 0x34, 0x31, 0xb7, 0x68, 0xd2, + 0x9d, 0x30, 0x1a, 0x13, 0x70, 0x62, 0xfc, 0xad, 0xcd, 0xde, 0x86, 0x3f, 0xe6, 0xbe, 0x7b, 0x93, + 0x90, 0x8a, 0x57, 0x2e, 0x74, 0x97, 0x8f, 0xa6, 0x6d, 0xf3, 0x54, 0x9a, 0x74, 0x42, 0x6b, 0x32, + 0x0c, 0x2c, 0xc7, 0xe4, 0x37, 0x09, 0x78, 0xc8, 0xc4, 0x59, 0x38, 0x83, 0x38, 0x33, 0x65, 0x2a, + 0xe6, 0x2a, 0x7e, 0x11, 0x95, 0xb6, 0x7d, 0x87, 0x26, 0x22, 0x89, 0x3a, 0x91, 0x02, 0x2f, 0xc2, + 0x6e, 0xe4, 0xb9, 0x9e, 0x0f, 0x1c, 0x84, 0x22, 0x48, 0x1d, 0x01, 0x9b, 0xf1, 0xad, 0x86, 0xce, + 0x0b, 0x12, 0x6c, 0x24, 0xd4, 0x1e, 0xf3, 0x34, 0xcf, 0x49, 0x2c, 0xbc, 0x82, 0x1a, 0xbd, 0x24, + 0xf5, 0x16, 0x37, 0x8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0x57, 0x4c, 0xf1, 0xbd, 0xde, 0xa3, 0xa3, 0x70, 0x68, 0x31, + 0x0a, 0x10, 0x92, 0xc7, 0x1a, 0x5f, 0x21, 0x34, 0xeb, 0xea, 0xb3, 0xa6, 0x9a, 0xf1, 0x35, 0xaa, + 0x67, 0x46, 0xc1, 0x99, 0xbb, 0xff, 0xa9, 0x80, 0x72, 0x95, 0xe5, 0x67, 0x18, 0x6c, 0xff, 0xb9, + 0xb2, 0xd2, 0x47, 0xea, 0x8d, 0xce, 0xc7, 0x13, 0xe9, 0x23, 0x6d, 0xb9, 0xe2, 0xfc, 0x2d, 0x77, + 0x11, 0x95, 0xee, 0x5b, 0xc3, 0x31, 0x55, 0xdf, 0x88, 0x42, 0xc0, 0x17, 0x50, 0x71, 0xd3, 0x8a, + 0x61, 0x83, 0xf0, 0x63, 0xb7, 0x7b, 0x70, 0xd8, 0xd2, 0x1e, 0x1f, 0xb6, 0xb4, 0x3f, 0x0e, 0x5b, + 0xda, 0xaf, 0x4f, 0x5b, 0xda, 0xc1, 0xd3, 0x96, 0xf6, 0xe5, 0x29, 0xe1, 0x53, 0xf5, 0x41, 0x20, + 0x4e, 0xfd, 0xb2, 0xd8, 0xd5, 0x6f, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xba, 0x03, 0xcc, 0x65, 0xcd, 0x0e, 0x00, 0x00, } diff --git a/execution/names/names.pb.go b/execution/names/names.pb.go index c6e76166f..0c6b9dd23 100644 --- a/execution/names/names.pb.go +++ b/execution/names/names.pb.go @@ -5,13 +5,12 @@ package names import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/genesis/genesis.go b/genesis/genesis.go index 11e9a2646..170b1248f 100644 --- a/genesis/genesis.go +++ b/genesis/genesis.go @@ -52,9 +52,8 @@ type Account struct { type Validator struct { BasicAccount - NodeAddress *crypto.Address `json:",omitempty" toml:",omitempty" yaml:",omitempty"` - Name string - UnbondTo []BasicAccount + Name string + UnbondTo []BasicAccount } //------------------------------------------------------------ @@ -197,9 +196,8 @@ func (gv *Validator) Clone() Validator { PublicKey: gv.PublicKey, Amount: gv.Amount, }, - Name: gv.Name, - UnbondTo: unbondToClone, - NodeAddress: gv.NodeAddress, + Name: gv.Name, + UnbondTo: unbondToClone, } } diff --git a/genesis/spec/genesis_spec.go b/genesis/spec/genesis_spec.go index a925b1e36..db13d1928 100644 --- a/genesis/spec/genesis_spec.go +++ b/genesis/spec/genesis_spec.go @@ -47,7 +47,7 @@ func (gs *GenesisSpec) RealiseKeys(keyClient keys.KeyClient) error { } // Produce a fully realised GenesisDoc from a template GenesisDoc that may omit values -func (gs *GenesisSpec) GenesisDoc(keyClient keys.KeyClient, generateNodeKeys bool) (*genesis.GenesisDoc, error) { +func (gs *GenesisSpec) GenesisDoc(keyClient keys.KeyClient) (*genesis.GenesisDoc, error) { genesisDoc := new(genesis.GenesisDoc) if gs.GenesisTime == nil { genesisDoc.GenesisTime = time.Now() @@ -94,7 +94,7 @@ func (gs *GenesisSpec) GenesisDoc(keyClient keys.KeyClient, generateNodeKeys boo if templateAccount.Balances().HasPower() { // Note this does not modify the input template templateAccount.Address = &account.Address - validator, err := templateAccount.Validator(keyClient, i, generateNodeKeys) + validator, err := templateAccount.Validator(keyClient, i) if err != nil { return nil, fmt.Errorf("could not create Validator from template: %v", err) } diff --git a/genesis/spec/genesis_spec_test.go b/genesis/spec/genesis_spec_test.go index 1d52df39a..f40d93b53 100644 --- a/genesis/spec/genesis_spec_test.go +++ b/genesis/spec/genesis_spec_test.go @@ -22,7 +22,7 @@ func TestGenesisSpec_GenesisDoc(t *testing.T) { }}, } - genesisDoc, err := genesisSpec.GenesisDoc(keyClient, false) + genesisDoc, err := genesisSpec.GenesisDoc(keyClient) require.NoError(t, err) require.Len(t, genesisDoc.Accounts, 1) // Should create validator @@ -52,7 +52,7 @@ func TestGenesisSpec_GenesisDoc(t *testing.T) { }}, } - genesisDoc, err = genesisSpec.GenesisDoc(keyClient, false) + genesisDoc, err = genesisSpec.GenesisDoc(keyClient) require.NoError(t, err) require.Len(t, genesisDoc.Accounts, 2) @@ -67,7 +67,7 @@ func TestGenesisSpec_GenesisDoc(t *testing.T) { // Try an empty spec genesisSpec = GenesisSpec{} - genesisDoc, err = genesisSpec.GenesisDoc(keyClient, false) + genesisDoc, err = genesisSpec.GenesisDoc(keyClient) require.NoError(t, err) // Similar assersions to first case - should generate our default single identity chain diff --git a/genesis/spec/presets_test.go b/genesis/spec/presets_test.go index 1c11015f9..155fb706b 100644 --- a/genesis/spec/presets_test.go +++ b/genesis/spec/presets_test.go @@ -13,7 +13,7 @@ import ( func TestMergeGenesisSpecAccounts(t *testing.T) { keyClient := mock.NewKeyClient() gs := MergeGenesisSpecs(FullAccount("0"), ParticipantAccount("1"), ParticipantAccount("2")) - gd, err := gs.GenesisDoc(keyClient, false) + gd, err := gs.GenesisDoc(keyClient) require.NoError(t, err) assert.Len(t, gd.Validators, 1) assert.Len(t, gd.Accounts, 3) diff --git a/genesis/spec/spec.pb.go b/genesis/spec/spec.pb.go index 378b441ca..47170ba4a 100644 --- a/genesis/spec/spec.pb.go +++ b/genesis/spec/spec.pb.go @@ -5,9 +5,6 @@ package spec import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" @@ -15,6 +12,8 @@ import ( balance "github.com/hyperledger/burrow/acm/balance" crypto "github.com/hyperledger/burrow/crypto" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -32,12 +31,11 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type TemplateAccount struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` Address *github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,2,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:",omitempty" toml:",omitempty"` - NodeAddress *github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,3,opt,name=NodeAddress,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:",omitempty" toml:",omitempty"` - PublicKey *crypto.PublicKey `protobuf:"bytes,4,opt,name=PublicKey,proto3" json:",omitempty" toml:",omitempty"` - Amounts []balance.Balance `protobuf:"bytes,5,rep,name=Amounts,proto3" json:",omitempty" toml:",omitempty"` - Permissions []string `protobuf:"bytes,6,rep,name=Permissions,proto3" json:",omitempty" toml:",omitempty"` - Roles []string `protobuf:"bytes,7,rep,name=Roles,proto3" json:",omitempty" toml:",omitempty"` - Code *github_com_hyperledger_burrow_acm.Bytecode `protobuf:"bytes,8,opt,name=Code,proto3,customtype=github.com/hyperledger/burrow/acm.Bytecode" json:"Code,omitempty"` + PublicKey *crypto.PublicKey `protobuf:"bytes,3,opt,name=PublicKey,proto3" json:",omitempty" toml:",omitempty"` + Amounts []balance.Balance `protobuf:"bytes,4,rep,name=Amounts,proto3" json:",omitempty" toml:",omitempty"` + Permissions []string `protobuf:"bytes,5,rep,name=Permissions,proto3" json:",omitempty" toml:",omitempty"` + Roles []string `protobuf:"bytes,6,rep,name=Roles,proto3" json:",omitempty" toml:",omitempty"` + Code *github_com_hyperledger_burrow_acm.Bytecode `protobuf:"bytes,7,opt,name=Code,proto3,customtype=github.com/hyperledger/burrow/acm.Bytecode" json:"Code,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -121,33 +119,32 @@ func init() { proto.RegisterFile("spec.proto", fileDescriptor_423806180556987f) func init() { golang_proto.RegisterFile("spec.proto", fileDescriptor_423806180556987f) } var fileDescriptor_423806180556987f = []byte{ - // 411 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0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6, 0x46, 0x3f, 0x37, 0x36, 0xfa, 0x7e, 0x67, 0xa3, 0xe6, 0xce, 0x46, 0x1f, 0xff, 0xa3, - 0x98, 0x42, 0x01, 0x2a, 0x53, 0xfe, 0xf6, 0x6b, 0xc4, 0x07, 0xe6, 0x55, 0xbf, 0xfa, 0x13, 0x00, - 0x00, 0xff, 0xff, 0xcf, 0x67, 0x15, 0x5d, 0x35, 0x03, 0x00, 0x00, + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x8f, 0xd3, 0x30, + 0x14, 0xc7, 0x6b, 0x9a, 0xbb, 0x52, 0xf7, 0x10, 0x9c, 0xa7, 0xe8, 0x86, 0x38, 0x2a, 0x03, 0x11, + 0x3a, 0x12, 0xa9, 0x4c, 0xdc, 0x44, 0x83, 0x60, 0x41, 0x42, 0xa7, 0xdc, 0x4d, 0x6c, 0x89, 0xf3, + 0xc8, 0x45, 0x8a, 0xe3, 0xc8, 0x76, 0x84, 0xf2, 0x2d, 0x90, 0x58, 0x98, 0xef, 0x93, 0x30, 0x66, + 0x64, 0xee, 0x10, 0xa1, 0x76, 0x63, 0xe4, 0x13, 0xa0, 0x3a, 0x2d, 0xed, 0x04, 0x99, 0xfc, 0xfe, + 0x7e, 0xfa, 0xff, 0xde, 0xb3, 0xdf, 0xc3, 0x58, 0x55, 0xc0, 0xfc, 0x4a, 0x0a, 0x2d, 0x88, 0xb5, + 0x8d, 0x2f, 0x5e, 0x64, 0xb9, 0xbe, 0xab, 0x13, 0x9f, 0x09, 0x1e, 0x64, 0x22, 0x13, 0x81, 0x49, + 0x26, 0xf5, 0x27, 0xa3, 0x8c, 0x30, 0x51, 0x6f, 0xba, 0x38, 0x63, 0xb2, 0xa9, 0xf4, 0x5e, 0x3d, + 0x4a, 0xe2, 0x22, 0x2e, 0x19, 0xf4, 0x72, 0xfe, 0xd5, 0xc2, 0x8f,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6d, 0x47, 0xd1, 0xaa, 0xa3, 0xcf, 0xff, 0x3d, 0x9c, 0x98, 0x71, 0x3f, 0x6c, 0x34, 0x30, 0x91, + 0x42, 0x64, 0xfc, 0x57, 0x0f, 0xbf, 0xdc, 0xd3, 0xd1, 0xb7, 0x7b, 0x3a, 0x0a, 0x5f, 0xb7, 0x6b, + 0x07, 0xfd, 0x58, 0x3b, 0xe8, 0xe7, 0xda, 0x41, 0xdf, 0x37, 0x0e, 0x6a, 0x37, 0x0e, 0xfa, 0xf8, + 0x1f, 0x62, 0x06, 0x25, 0xa8, 0x5c, 0x05, 0xdb, 0x1d, 0x4d, 0x4e, 0xcd, 0x7a, 0xbd, 0xfc, 0x13, + 0x00, 0x00, 0xff, 0xff, 0x3b, 0xf1, 0x47, 0x6d, 0xbe, 0x02, 0x00, 0x00, } func (m *TemplateAccount) Marshal() (dAtA []byte, err error) { @@ -181,29 +178,19 @@ func (m *TemplateAccount) MarshalTo(dAtA []byte) (int, error) { } i += n1 } - if m.NodeAddress != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintSpec(dAtA, i, uint64(m.NodeAddress.Size())) - n2, err := m.NodeAddress.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } if m.PublicKey != nil { - dAtA[i] = 0x22 + dAtA[i] = 0x1a i++ i = encodeVarintSpec(dAtA, i, uint64(m.PublicKey.Size())) - n3, err := m.PublicKey.MarshalTo(dAtA[i:]) + n2, err := m.PublicKey.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n2 } if len(m.Amounts) > 0 { for _, msg := range m.Amounts { - dAtA[i] = 0x2a + dAtA[i] = 0x22 i++ i = encodeVarintSpec(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) @@ -215,7 +202,7 @@ func (m *TemplateAccount) MarshalTo(dAtA []byte) (int, error) { } if len(m.Permissions) > 0 { for _, s := range m.Permissions { - dAtA[i] = 0x32 + dAtA[i] = 0x2a i++ l = len(s) for l >= 1<<7 { @@ -230,7 +217,7 @@ func (m *TemplateAccount) MarshalTo(dAtA []byte) (int, error) { } if len(m.Roles) > 0 { for _, s := range m.Roles { - dAtA[i] = 0x3a + dAtA[i] = 0x32 i++ l = len(s) for l >= 1<<7 { @@ -244,14 +231,14 @@ func (m *TemplateAccount) MarshalTo(dAtA []byte) (int, error) { } } if m.Code != nil { - dAtA[i] = 0x42 + dAtA[i] = 0x3a i++ i = encodeVarintSpec(dAtA, i, uint64(m.Code.Size())) - n4, err := m.Code.MarshalTo(dAtA[i:]) + n3, err := m.Code.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n3 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -282,10 +269,6 @@ func (m *TemplateAccount) Size() (n int) { l = m.Address.Size() n += 1 + l + sovSpec(uint64(l)) } - if m.NodeAddress != nil { - l = m.NodeAddress.Size() - n += 1 + l + sovSpec(uint64(l)) - } if m.PublicKey != nil { l = m.PublicKey.Size() n += 1 + l + sovSpec(uint64(l)) @@ -428,41 +411,6 @@ func (m *TemplateAccount) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v github_com_hyperledger_burrow_crypto.Address - m.NodeAddress = &v - if err := m.NodeAddress.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } @@ -498,7 +446,7 @@ func (m *TemplateAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) } @@ -532,7 +480,7 @@ func (m *TemplateAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } @@ -564,7 +512,7 @@ func (m *TemplateAccount) Unmarshal(dAtA []byte) error { } m.Permissions = append(m.Permissions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) } @@ -596,7 +544,7 @@ func (m *TemplateAccount) Unmarshal(dAtA []byte) error { } m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 8: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } diff --git a/genesis/spec/template_account.go b/genesis/spec/template_account.go index 6848d4ca6..7ac6804cf 100644 --- a/genesis/spec/template_account.go +++ b/genesis/spec/template_account.go @@ -10,21 +10,13 @@ import ( "github.com/hyperledger/burrow/permission" ) -func (ta TemplateAccount) Validator(keyClient keys.KeyClient, index int, generateNodeKeys bool) (*genesis.Validator, error) { +func (ta TemplateAccount) Validator(keyClient keys.KeyClient, index int) (*genesis.Validator, error) { var err error gv := new(genesis.Validator) gv.PublicKey, gv.Address, err = ta.RealisePublicKeyAndAddress(keyClient) if err != nil { return nil, err } - if generateNodeKeys && ta.NodeAddress == nil { - // If neither PublicKey or Address set then generate a new one - address, err := keyClient.Generate("nodekey-"+ta.Name, crypto.CurveTypeEd25519) - if err != nil { - return nil, err - } - ta.NodeAddress = &address - } gv.Amount = ta.Balances().GetPower(DefaultPower) if ta.Name == "" { gv.Name = accountNameFromIndex(index) @@ -37,7 +29,6 @@ func (ta TemplateAccount) Validator(keyClient keys.KeyClient, index int, generat PublicKey: gv.PublicKey, Amount: gv.Amount, }} - gv.NodeAddress = ta.NodeAddress return gv, nil } diff --git a/keys/keys.pb.go b/keys/keys.pb.go index d38370086..5a262dce5 100644 --- a/keys/keys.pb.go +++ b/keys/keys.pb.go @@ -6,14 +6,13 @@ package keys import ( context "context" fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" crypto "github.com/hyperledger/burrow/crypto" grpc "google.golang.org/grpc" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/permission/permission.pb.go b/permission/permission.pb.go index b91f0d764..bb07ce156 100644 --- a/permission/permission.pb.go +++ b/permission/permission.pb.go @@ -5,13 +5,12 @@ package permission import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/protobuf/spec.proto b/protobuf/spec.proto index c7119306e..b28f8a827 100644 --- a/protobuf/spec.proto +++ b/protobuf/spec.proto @@ -22,11 +22,10 @@ message TemplateAccount { string Name = 1; bytes Address = 2 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address", (gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; - bytes NodeAddress = 3 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address", (gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; - crypto.PublicKey PublicKey = 4 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; - repeated balance.Balance Amounts = 5 [(gogoproto.nullable) = false, (gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; - repeated string Permissions = 6 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; - repeated string Roles = 7 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; - bytes Code = 8 [(gogoproto.nullable) = true, (gogoproto.customtype) = "github.com/hyperledger/burrow/acm.Bytecode"]; + crypto.PublicKey PublicKey = 3 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; + repeated balance.Balance Amounts = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; + repeated string Permissions = 5 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; + repeated string Roles = 6 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "toml:\",omitempty\""]; + bytes Code = 7 [(gogoproto.nullable) = true, (gogoproto.customtype) = "github.com/hyperledger/burrow/acm.Bytecode"]; } diff --git a/rpc/rpc.pb.go b/rpc/rpc.pb.go index ad538aa98..61aac4f75 100644 --- a/rpc/rpc.pb.go +++ b/rpc/rpc.pb.go @@ -5,9 +5,6 @@ package rpc import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" @@ -15,6 +12,8 @@ import ( bcm "github.com/hyperledger/burrow/bcm" github_com_hyperledger_burrow_binary "github.com/hyperledger/burrow/binary" tendermint "github.com/hyperledger/burrow/consensus/tendermint" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/rpc/rpcdump/rpcdump.pb.go b/rpc/rpcdump/rpcdump.pb.go index 22a0239d7..79ec1923e 100644 --- a/rpc/rpcdump/rpcdump.pb.go +++ b/rpc/rpcdump/rpcdump.pb.go @@ -6,14 +6,13 @@ package rpcdump import ( context "context" fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" dump "github.com/hyperledger/burrow/dump" grpc "google.golang.org/grpc" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/rpc/rpcevents/rpcevents.pb.go b/rpc/rpcevents/rpcevents.pb.go index ea0229c54..db293aaea 100644 --- a/rpc/rpcevents/rpcevents.pb.go +++ b/rpc/rpcevents/rpcevents.pb.go @@ -6,15 +6,14 @@ package rpcevents import ( context "context" fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" github_com_hyperledger_burrow_binary "github.com/hyperledger/burrow/binary" exec "github.com/hyperledger/burrow/execution/exec" grpc "google.golang.org/grpc" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/rpc/rpcquery/rpcquery.pb.go b/rpc/rpcquery/rpcquery.pb.go index 0001ec590..a0bf24bd4 100644 --- a/rpc/rpcquery/rpcquery.pb.go +++ b/rpc/rpcquery/rpcquery.pb.go @@ -6,9 +6,6 @@ package rpcquery import ( context "context" fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" @@ -21,6 +18,8 @@ import ( payload "github.com/hyperledger/burrow/txs/payload" types "github.com/tendermint/tendermint/abci/types" grpc "google.golang.org/grpc" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/rpc/rpctransact/rpctransact.pb.go b/rpc/rpctransact/rpctransact.pb.go index ea6523360..915e0c193 100644 --- a/rpc/rpctransact/rpctransact.pb.go +++ b/rpc/rpctransact/rpctransact.pb.go @@ -6,10 +6,6 @@ package rpctransact import ( context "context" fmt "fmt" - io "io" - math "math" - time "time" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" @@ -21,6 +17,9 @@ import ( txs "github.com/hyperledger/burrow/txs" payload "github.com/hyperledger/burrow/txs/payload" grpc "google.golang.org/grpc" + io "io" + math "math" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/txs/payload/payload.pb.go b/txs/payload/payload.pb.go index 7d8e45569..e17302550 100644 --- a/txs/payload/payload.pb.go +++ b/txs/payload/payload.pb.go @@ -5,9 +5,6 @@ package payload import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" @@ -15,6 +12,8 @@ import ( github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" spec "github.com/hyperledger/burrow/genesis/spec" permission "github.com/hyperledger/burrow/permission" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/txs/txs.pb.go b/txs/txs.pb.go index 0e9ac84c0..e95880013 100644 --- a/txs/txs.pb.go +++ b/txs/txs.pb.go @@ -5,9 +5,6 @@ package txs import ( fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" @@ -15,6 +12,8 @@ import ( crypto "github.com/hyperledger/burrow/crypto" github_com_hyperledger_burrow_crypto "github.com/hyperledger/burrow/crypto" github_com_hyperledger_burrow_txs_payload "github.com/hyperledger/burrow/txs/payload" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used.