update for tendermint 0.11

This commit is contained in:
Ethan Buchman 2017-10-02 14:40:42 -04:00
parent 0307321051
commit 1f151d1232
6 changed files with 21 additions and 14 deletions

View File

@ -57,7 +57,7 @@ func (app *Basecoin) GetState() sm.SimpleDB {
} }
// Info - ABCI // Info - ABCI
func (app *Basecoin) Info() abci.ResponseInfo { func (app *Basecoin) Info(req abci.RequestInfo) abci.ResponseInfo {
resp := app.state.Info() resp := app.state.Info()
app.height = resp.LastBlockHeight app.height = resp.LastBlockHeight
return abci.ResponseInfo{ return abci.ResponseInfo{
@ -157,14 +157,14 @@ func (app *Basecoin) Commit() (res abci.Result) {
} }
// InitChain - ABCI // InitChain - ABCI
func (app *Basecoin) InitChain(validators []*abci.Validator) { func (app *Basecoin) InitChain(req abci.RequestInitChain) {
// for _, plugin := range app.plugins.GetList() { // for _, plugin := range app.plugins.GetList() {
// plugin.InitChain(app.state, validators) // plugin.InitChain(app.state, validators)
// } // }
} }
// BeginBlock - ABCI // BeginBlock - ABCI
func (app *Basecoin) BeginBlock(hash []byte, header *abci.Header) { func (app *Basecoin) BeginBlock(req abci.RequestBeginBlock) {
app.height++ app.height++
// for _, plugin := range app.plugins.GetList() { // for _, plugin := range app.plugins.GetList() {
// plugin.BeginBlock(app.state, hash, header) // plugin.BeginBlock(app.state, hash, header)

View File

@ -73,7 +73,7 @@ func TestEndBlock(t *testing.T) {
} }
for i, tc := range cases { for i, tc := range cases {
app.BeginBlock(nil, nil) app.BeginBlock(abci.RequestBeginBlock{})
for _, c := range tc.changes { for _, c := range tc.changes {
tx := base.ValChangeTx{c}.Wrap() tx := base.ValChangeTx{c}.Wrap()
txBytes := wire.BinaryBytes(tx) txBytes := wire.BinaryBytes(tx)

View File

@ -46,7 +46,7 @@ func getGenesisJSON(chainID string) string {
"genesis_time": "0001-01-01T00:00:00.000Z", "genesis_time": "0001-01-01T00:00:00.000Z",
"validators": [ "validators": [
{ {
"amount": 10, "power": 10,
"name": "", "name": "",
"pub_key": { "pub_key": {
"type": "ed25519", "type": "ed25519",

12
glide.lock generated
View File

@ -1,5 +1,5 @@
hash: 647d25291b8e9a85cb4a49abc972a41537e8a286514bf41180845785e3b180a4 hash: 647d25291b8e9a85cb4a49abc972a41537e8a286514bf41180845785e3b180a4
updated: 2017-09-13T14:11:46.879460282+02:00 updated: 2017-10-02T13:37:10.048025454-04:00
imports: imports:
- name: github.com/bgentry/speakeasy - name: github.com/bgentry/speakeasy
version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd
@ -107,7 +107,7 @@ imports:
- leveldb/table - leveldb/table
- leveldb/util - leveldb/util
- name: github.com/tendermint/abci - name: github.com/tendermint/abci
version: a0724296592f63c0b7fdbc4eec1a7e53b6f4eb55 version: 191c4b6d176169ffc7f9972d490fa362a3b7d940
subpackages: subpackages:
- client - client
- example/dummy - example/dummy
@ -119,7 +119,7 @@ imports:
- edwards25519 - edwards25519
- extra25519 - extra25519
- name: github.com/tendermint/go-crypto - name: github.com/tendermint/go-crypto
version: 50e7c078170975532ca52004cb03a473afdebbff version: 0418d32276d7d0f080e4c0e58b49c6ba2f717954
subpackages: subpackages:
- keys - keys
- keys/cryptostore - keys/cryptostore
@ -132,7 +132,7 @@ imports:
- data - data
- data/base58 - data/base58
- name: github.com/tendermint/iavl - name: github.com/tendermint/iavl
version: a3ec7707c4eacabd33b7c510df364bfce1eb33e6 version: 2d3ca4f466c32953641d4c49cad3d93eb7876a5e
- name: github.com/tendermint/light-client - name: github.com/tendermint/light-client
version: ac2e4bf47b31aaf5d3d336691ac786ec751bfc32 version: ac2e4bf47b31aaf5d3d336691ac786ec751bfc32
subpackages: subpackages:
@ -145,7 +145,7 @@ imports:
subpackages: subpackages:
- iavl - iavl
- name: github.com/tendermint/tendermint - name: github.com/tendermint/tendermint
version: cc50dc076a21df40477b1ce77348010f3f3defc4 version: 7448c4addebf02881158a6c30d5dbee01b6e1d96
subpackages: subpackages:
- blockchain - blockchain
- cmd/tendermint/commands - cmd/tendermint/commands
@ -172,7 +172,7 @@ imports:
- types - types
- version - version
- name: github.com/tendermint/tmlibs - name: github.com/tendermint/tmlibs
version: bfec1ff1cd7fda9f5b2d8b570e3bec163e5f9149 version: 9997e3a3b46db1d2f88aa9816ed0e7915dad6ac1
subpackages: subpackages:
- autofile - autofile
- cli - cli

View File

@ -148,7 +148,7 @@ func GetGenesisJSON(chainID, addr string, options string) string {
"genesis_time": "0001-01-01T00:00:00.000Z", "genesis_time": "0001-01-01T00:00:00.000Z",
"validators": [ "validators": [
{ {
"amount": 10, "power": 10,
"name": "", "name": "",
"pub_key": { "pub_key": {
"type": "ed25519", "type": "ed25519",

View File

@ -118,8 +118,15 @@ func startTendermint(dir string, basecoinApp *app.Basecoin) error {
} }
// Create & start tendermint node // Create & start tendermint node
privValidator := types.LoadOrGenPrivValidator(cfg.PrivValidatorFile(), logger) n, err := node.NewNode(cfg,
n := node.NewNode(cfg, privValidator, proxy.NewLocalClientCreator(basecoinApp), logger.With("module", "node")) types.LoadOrGenPrivValidatorFS(cfg.PrivValidatorFile()),
proxy.NewLocalClientCreator(basecoinApp),
node.DefaultGenesisDocProviderFunc(cfg),
node.DefaultDBProvider,
logger.With("module", "node"))
if err != nil {
return err
}
_, err = n.Start() _, err = n.Start()
if err != nil { if err != nil {