From 1f151d1232b4971aa68ebbda15ee0d7aa45c89bd Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 2 Oct 2017 14:40:42 -0400 Subject: [PATCH] update for tendermint 0.11 --- app/app.go | 6 +++--- app/app_val_test.go | 2 +- examples/eyes/cmd/eyes/init.go | 2 +- glide.lock | 12 ++++++------ server/commands/init.go | 2 +- server/commands/start.go | 11 +++++++++-- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/app.go b/app/app.go index 17fa1cfdd..eebc816e8 100644 --- a/app/app.go +++ b/app/app.go @@ -57,7 +57,7 @@ func (app *Basecoin) GetState() sm.SimpleDB { } // Info - ABCI -func (app *Basecoin) Info() abci.ResponseInfo { +func (app *Basecoin) Info(req abci.RequestInfo) abci.ResponseInfo { resp := app.state.Info() app.height = resp.LastBlockHeight return abci.ResponseInfo{ @@ -157,14 +157,14 @@ func (app *Basecoin) Commit() (res abci.Result) { } // InitChain - ABCI -func (app *Basecoin) InitChain(validators []*abci.Validator) { +func (app *Basecoin) InitChain(req abci.RequestInitChain) { // for _, plugin := range app.plugins.GetList() { // plugin.InitChain(app.state, validators) // } } // BeginBlock - ABCI -func (app *Basecoin) BeginBlock(hash []byte, header *abci.Header) { +func (app *Basecoin) BeginBlock(req abci.RequestBeginBlock) { app.height++ // for _, plugin := range app.plugins.GetList() { // plugin.BeginBlock(app.state, hash, header) diff --git a/app/app_val_test.go b/app/app_val_test.go index 644744ea7..95ea77674 100644 --- a/app/app_val_test.go +++ b/app/app_val_test.go @@ -73,7 +73,7 @@ func TestEndBlock(t *testing.T) { } for i, tc := range cases { - app.BeginBlock(nil, nil) + app.BeginBlock(abci.RequestBeginBlock{}) for _, c := range tc.changes { tx := base.ValChangeTx{c}.Wrap() txBytes := wire.BinaryBytes(tx) diff --git a/examples/eyes/cmd/eyes/init.go b/examples/eyes/cmd/eyes/init.go index 8fba62997..0fbe5f51c 100644 --- a/examples/eyes/cmd/eyes/init.go +++ b/examples/eyes/cmd/eyes/init.go @@ -46,7 +46,7 @@ func getGenesisJSON(chainID string) string { "genesis_time": "0001-01-01T00:00:00.000Z", "validators": [ { - "amount": 10, + "power": 10, "name": "", "pub_key": { "type": "ed25519", diff --git a/glide.lock b/glide.lock index 4e7d6804c..a5965fac5 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: 647d25291b8e9a85cb4a49abc972a41537e8a286514bf41180845785e3b180a4 -updated: 2017-09-13T14:11:46.879460282+02:00 +updated: 2017-10-02T13:37:10.048025454-04:00 imports: - name: github.com/bgentry/speakeasy version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd @@ -107,7 +107,7 @@ imports: - leveldb/table - leveldb/util - name: github.com/tendermint/abci - version: a0724296592f63c0b7fdbc4eec1a7e53b6f4eb55 + version: 191c4b6d176169ffc7f9972d490fa362a3b7d940 subpackages: - client - example/dummy @@ -119,7 +119,7 @@ imports: - edwards25519 - extra25519 - name: github.com/tendermint/go-crypto - version: 50e7c078170975532ca52004cb03a473afdebbff + version: 0418d32276d7d0f080e4c0e58b49c6ba2f717954 subpackages: - keys - keys/cryptostore @@ -132,7 +132,7 @@ imports: - data - data/base58 - name: github.com/tendermint/iavl - version: a3ec7707c4eacabd33b7c510df364bfce1eb33e6 + version: 2d3ca4f466c32953641d4c49cad3d93eb7876a5e - name: github.com/tendermint/light-client version: ac2e4bf47b31aaf5d3d336691ac786ec751bfc32 subpackages: @@ -145,7 +145,7 @@ imports: subpackages: - iavl - name: github.com/tendermint/tendermint - version: cc50dc076a21df40477b1ce77348010f3f3defc4 + version: 7448c4addebf02881158a6c30d5dbee01b6e1d96 subpackages: - blockchain - cmd/tendermint/commands @@ -172,7 +172,7 @@ imports: - types - version - name: github.com/tendermint/tmlibs - version: bfec1ff1cd7fda9f5b2d8b570e3bec163e5f9149 + version: 9997e3a3b46db1d2f88aa9816ed0e7915dad6ac1 subpackages: - autofile - cli diff --git a/server/commands/init.go b/server/commands/init.go index 96267dcc3..f913798d3 100644 --- a/server/commands/init.go +++ b/server/commands/init.go @@ -148,7 +148,7 @@ func GetGenesisJSON(chainID, addr string, options string) string { "genesis_time": "0001-01-01T00:00:00.000Z", "validators": [ { - "amount": 10, + "power": 10, "name": "", "pub_key": { "type": "ed25519", diff --git a/server/commands/start.go b/server/commands/start.go index 92f50fdbb..949e57f06 100644 --- a/server/commands/start.go +++ b/server/commands/start.go @@ -118,8 +118,15 @@ func startTendermint(dir string, basecoinApp *app.Basecoin) error { } // Create & start tendermint node - privValidator := types.LoadOrGenPrivValidator(cfg.PrivValidatorFile(), logger) - n := node.NewNode(cfg, privValidator, proxy.NewLocalClientCreator(basecoinApp), logger.With("module", "node")) + n, err := node.NewNode(cfg, + types.LoadOrGenPrivValidatorFS(cfg.PrivValidatorFile()), + proxy.NewLocalClientCreator(basecoinApp), + node.DefaultGenesisDocProviderFunc(cfg), + node.DefaultDBProvider, + logger.With("module", "node")) + if err != nil { + return err + } _, err = n.Start() if err != nil {