From c147b41013b88ec0b6ed0350cf1ed41bb0e59faf Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 15:53:32 -0500 Subject: [PATCH 1/4] TMSP -> ABCI --- README.md | 2 +- cmd/tendermint/flags.go | 6 ++--- config/tendermint/config.go | 2 +- config/tendermint_test/config.go | 2 +- consensus/common_test.go | 24 ++++++++--------- consensus/mempool_test.go | 32 +++++++++++------------ consensus/reactor_test.go | 2 +- consensus/state.go | 2 +- glide.lock | 23 +++++++++-------- glide.yaml | 5 ++-- mempool/mempool.go | 30 +++++++++++----------- mempool/mempool_test.go | 6 ++--- mempool/reactor.go | 4 +-- node/node.go | 4 +-- proxy/app_conn.go | 44 ++++++++++++++++---------------- proxy/app_conn_test.go | 22 ++++++++-------- proxy/client.go | 22 ++++++++-------- proxy/multi_app_conn.go | 10 ++++---- rpc/core/mempool.go | 16 ++++++------ rpc/core/pipe.go | 4 +-- rpc/core/routes.go | 12 ++++----- rpc/core/tmsp.go | 8 +++--- rpc/core/types/responses.go | 22 ++++++++-------- rpc/grpc/types.pb.go | 2 +- rpc/grpc/types.proto | 2 +- rpc/test/client_test.go | 28 ++++++++++---------- scripts/install_tmsp_apps.sh | 10 ++++---- state/execution.go | 26 +++++++++---------- state/execution_test.go | 2 +- test/app/dummy_test.sh | 16 ++++++------ test/app/test.sh | 8 +++--- test/docker/Dockerfile | 2 +- test/p2p/data/app/init.sh | 2 +- test/p2p/data/core/init.sh | 2 +- test/test_libs.sh | 2 +- types/events.go | 4 +-- types/protobuf.go | 2 +- version/version.go | 2 +- 38 files changed, 208 insertions(+), 206 deletions(-) diff --git a/README.md b/README.md index 807b9531c..89c61472f 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Yay open source! Please see our [contributing guidelines](https://github.com/ten ### Sub-projects -* [TMSP](http://github.com/tendermint/tmsp) +* [ABCI](http://github.com/tendermint/abci) * [Mintnet](http://github.com/tendermint/mintnet) * [Go-Wire](http://github.com/tendermint/go-wire) * [Go-P2P](http://github.com/tendermint/go-p2p) diff --git a/cmd/tendermint/flags.go b/cmd/tendermint/flags.go index 1cc41c4c9..9e014c678 100644 --- a/cmd/tendermint/flags.go +++ b/cmd/tendermint/flags.go @@ -19,7 +19,7 @@ func parseFlags(config cfg.Config, args []string) { grpcLaddr string logLevel string proxyApp string - tmspTransport string + abciTransport string ) // Declare flags @@ -35,7 +35,7 @@ func parseFlags(config cfg.Config, args []string) { flags.StringVar(&logLevel, "log_level", config.GetString("log_level"), "Log level") flags.StringVar(&proxyApp, "proxy_app", config.GetString("proxy_app"), "Proxy app address, or 'nilapp' or 'dummy' for local testing.") - flags.StringVar(&tmspTransport, "tmsp", config.GetString("tmsp"), "Specify tmsp transport (socket | grpc)") + flags.StringVar(&abciTransport, "abci", config.GetString("abci"), "Specify abci transport (socket | grpc)") flags.Parse(args) if printHelp { flags.PrintDefaults() @@ -52,5 +52,5 @@ func parseFlags(config cfg.Config, args []string) { config.Set("grpc_laddr", grpcLaddr) config.Set("log_level", logLevel) config.Set("proxy_app", proxyApp) - config.Set("tmsp", tmspTransport) + config.Set("abci", abciTransport) } diff --git a/config/tendermint/config.go b/config/tendermint/config.go index 2e8d90254..7c058877d 100644 --- a/config/tendermint/config.go +++ b/config/tendermint/config.go @@ -54,7 +54,7 @@ func GetConfig(rootDir string) cfg.Config { mapConfig.SetRequired("chain_id") // blows up if you try to use it before setting. mapConfig.SetDefault("genesis_file", rootDir+"/genesis.json") mapConfig.SetDefault("proxy_app", "tcp://127.0.0.1:46658") - mapConfig.SetDefault("tmsp", "socket") + mapConfig.SetDefault("abci", "socket") mapConfig.SetDefault("moniker", "anonymous") mapConfig.SetDefault("node_laddr", "tcp://0.0.0.0:46656") mapConfig.SetDefault("seeds", "") diff --git a/config/tendermint_test/config.go b/config/tendermint_test/config.go index 421c0017b..b5c60a587 100644 --- a/config/tendermint_test/config.go +++ b/config/tendermint_test/config.go @@ -70,7 +70,7 @@ func ResetConfig(localPath string) cfg.Config { mapConfig.SetDefault("chain_id", "tendermint_test") mapConfig.SetDefault("genesis_file", rootDir+"/genesis.json") mapConfig.SetDefault("proxy_app", "dummy") - mapConfig.SetDefault("tmsp", "socket") + mapConfig.SetDefault("abci", "socket") mapConfig.SetDefault("moniker", "anonymous") mapConfig.SetDefault("node_laddr", "tcp://0.0.0.0:36656") mapConfig.SetDefault("fast_sync", false) diff --git a/consensus/common_test.go b/consensus/common_test.go index 2082ff73a..c345fe663 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -20,11 +20,11 @@ import ( mempl "github.com/tendermint/tendermint/mempool" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" - tmspcli "github.com/tendermint/tmsp/client" - tmsp "github.com/tendermint/tmsp/types" + abcicli "github.com/tendermint/abci/client" + abci "github.com/tendermint/abci/types" - "github.com/tendermint/tmsp/example/counter" - "github.com/tendermint/tmsp/example/dummy" + "github.com/tendermint/abci/example/counter" + "github.com/tendermint/abci/example/dummy" ) var config cfg.Config // NOTE: must be reset for each _test.go file @@ -229,19 +229,19 @@ func readVotes(ch chan interface{}, reads int) chan struct{} { //------------------------------------------------------------------------------- // consensus states -func newConsensusState(state *sm.State, pv *types.PrivValidator, app tmsp.Application) *ConsensusState { +func newConsensusState(state *sm.State, pv *types.PrivValidator, app abci.Application) *ConsensusState { return newConsensusStateWithConfig(config, state, pv, app) } -func newConsensusStateWithConfig(thisConfig cfg.Config, state *sm.State, pv *types.PrivValidator, app tmsp.Application) *ConsensusState { +func newConsensusStateWithConfig(thisConfig cfg.Config, state *sm.State, pv *types.PrivValidator, app abci.Application) *ConsensusState { // Get BlockStore blockDB := dbm.NewMemDB() blockStore := bc.NewBlockStore(blockDB) // one for mempool, one for consensus mtx := new(sync.Mutex) - proxyAppConnMem := tmspcli.NewLocalClient(mtx, app) - proxyAppConnCon := tmspcli.NewLocalClient(mtx, app) + proxyAppConnMem := abcicli.NewLocalClient(mtx, app) + proxyAppConnCon := abcicli.NewLocalClient(mtx, app) // Make Mempool mempool := mempl.NewMempool(thisConfig, proxyAppConnMem) @@ -312,7 +312,7 @@ func ensureNoNewStep(stepCh chan interface{}) { //------------------------------------------------------------------------------- // consensus nets -func randConsensusNet(nValidators int, testName string, tickerFunc func() TimeoutTicker, appFunc func() tmsp.Application) []*ConsensusState { +func randConsensusNet(nValidators int, testName string, tickerFunc func() TimeoutTicker, appFunc func() abci.Application) []*ConsensusState { genDoc, privVals := randGenesisDoc(nValidators, false, 10) css := make([]*ConsensusState, nValidators) for i := 0; i < nValidators; i++ { @@ -328,7 +328,7 @@ func randConsensusNet(nValidators int, testName string, tickerFunc func() Timeou } // nPeers = nValidators + nNotValidator -func randConsensusNetWithPeers(nValidators, nPeers int, testName string, tickerFunc func() TimeoutTicker, appFunc func() tmsp.Application) []*ConsensusState { +func randConsensusNetWithPeers(nValidators, nPeers int, testName string, tickerFunc func() TimeoutTicker, appFunc func() abci.Application) []*ConsensusState { genDoc, privVals := randGenesisDoc(nValidators, false, int64(testMinPower)) css := make([]*ConsensusState, nPeers) for i := 0; i < nPeers; i++ { @@ -440,11 +440,11 @@ func (m *mockTicker) Chan() <-chan timeoutInfo { //------------------------------------ -func newCounter() tmsp.Application { +func newCounter() abci.Application { return counter.NewCounterApplication(true) } -func newPersistentDummy() tmsp.Application { +func newPersistentDummy() abci.Application { dir, _ := ioutil.TempDir("/tmp", "persistent-dummy") return dummy.NewPersistentDummyApplication(dir) } diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index 58f46c7de..d12388727 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/tendermint/config/tendermint_test" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" ) @@ -66,10 +66,10 @@ func TestRmBadTx(t *testing.T) { cbCh := make(chan struct{}) go func() { // Try to send the tx through the mempool. - // CheckTx should not err, but the app should return a bad tmsp code + // CheckTx should not err, but the app should return a bad abci code // and the tx should get removed from the pool - err := cs.mempool.CheckTx(txBytes, func(r *tmsp.Response) { - if r.GetCheckTx().Code != tmsp.CodeType_BadNonce { + err := cs.mempool.CheckTx(txBytes, func(r *abci.Response) { + if r.GetCheckTx().Code != abci.CodeType_BadNonce { t.Fatalf("expected checktx to return bad nonce, got %v", r) } cbCh <- struct{}{} @@ -122,45 +122,45 @@ func NewCounterApplication() *CounterApplication { return &CounterApplication{} } -func (app *CounterApplication) Info() tmsp.ResponseInfo { - return tmsp.ResponseInfo{Data: Fmt("txs:%v", app.txCount)} +func (app *CounterApplication) Info() abci.ResponseInfo { + return abci.ResponseInfo{Data: Fmt("txs:%v", app.txCount)} } func (app *CounterApplication) SetOption(key string, value string) (log string) { return "" } -func (app *CounterApplication) AppendTx(tx []byte) tmsp.Result { +func (app *CounterApplication) AppendTx(tx []byte) abci.Result { return runTx(tx, &app.txCount) } -func (app *CounterApplication) CheckTx(tx []byte) tmsp.Result { +func (app *CounterApplication) CheckTx(tx []byte) abci.Result { return runTx(tx, &app.mempoolTxCount) } -func runTx(tx []byte, countPtr *int) tmsp.Result { +func runTx(tx []byte, countPtr *int) abci.Result { count := *countPtr tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(count) { - return tmsp.ErrBadNonce.AppendLog(Fmt("Invalid nonce. Expected %v, got %v", count, txValue)) + return abci.ErrBadNonce.AppendLog(Fmt("Invalid nonce. Expected %v, got %v", count, txValue)) } *countPtr += 1 - return tmsp.OK + return abci.OK } -func (app *CounterApplication) Commit() tmsp.Result { +func (app *CounterApplication) Commit() abci.Result { app.mempoolTxCount = app.txCount if app.txCount == 0 { - return tmsp.OK + return abci.OK } else { hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return tmsp.NewResultOK(hash, "") + return abci.NewResultOK(hash, "") } } -func (app *CounterApplication) Query(query []byte) tmsp.Result { - return tmsp.NewResultOK(nil, Fmt("Query is not supported")) +func (app *CounterApplication) Query(query []byte) abci.Result { + return abci.NewResultOK(nil, Fmt("Query is not supported")) } diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index ae6a6fc49..bc26ffc05 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -11,7 +11,7 @@ import ( "github.com/tendermint/go-events" "github.com/tendermint/go-p2p" "github.com/tendermint/tendermint/types" - "github.com/tendermint/tmsp/example/dummy" + "github.com/tendermint/abci/example/dummy" ) func init() { diff --git a/consensus/state.go b/consensus/state.go index bc3eb18fa..78e6c0eaa 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -354,7 +354,7 @@ func (cs *ConsensusState) OnStart() error { return err } - // If the latest block was applied in the tmsp handshake, + // If the latest block was applied in the abci handshake, // we may not have written the current height to the wal, // so check here and write it if not found. // TODO: remove this and run the handhsake/replay diff --git a/glide.lock b/glide.lock index 2a272378a..4652ea0b3 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 8e2e970c04c55b02740daa62647bb637964504a65c45cf274ffed5b0b1930ae4 -updated: 2017-01-12T14:56:02.152843341-05:00 +hash: 25681f005f0b9b1816cd5c5f0a0fd013395a7477c656c6010bb570b5aebd2d0a +updated: 2017-01-12T15:52:43.856786013-05:00 imports: - name: github.com/btcsuite/btcd version: afec1bd1245a4a19e6dfe1306974b733e7cbb9b8 @@ -48,6 +48,16 @@ imports: - leveldb/storage - leveldb/table - leveldb/util +- name: github.com/tendermint/abci + version: 3a5e63e987a50cf74a16fe0a5e18e74eb82b2031 + repo: https://github.com/tendermint/tmsp + subpackages: + - client + - example/counter + - example/dummy + - example/nil + - server + - types - name: github.com/tendermint/ed25519 version: 1f52c6f8b8a5c7908aff4497c186af344b428925 subpackages: @@ -93,15 +103,6 @@ imports: version: ae0f3d6450da9eac7074b439c8e1c3cabf0d5ce6 subpackages: - term -- name: github.com/tendermint/tmsp - version: f8167872d8ddd3a2362452ef1414991b5afa8862 - subpackages: - - client - - example/counter - - example/dummy - - example/nil - - server - - types - name: golang.org/x/crypto version: ede567c8e044a5913dad1d1af3696d9da953104c subpackages: diff --git a/glide.yaml b/glide.yaml index 7fd71aa5f..8273fb186 100644 --- a/glide.yaml +++ b/glide.yaml @@ -28,8 +28,9 @@ import: - package: github.com/tendermint/go-wire version: develop - package: github.com/tendermint/log15 -- package: github.com/tendermint/tmsp - version: develop +- package: github.com/tendermint/abci + version: rename + repo: https://github.com/tendermint/tmsp - package: golang.org/x/crypto subpackages: - ripemd160 diff --git a/mempool/mempool.go b/mempool/mempool.go index 80841b171..6fe4d7049 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -13,7 +13,7 @@ import ( cfg "github.com/tendermint/go-config" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) /* @@ -40,7 +40,7 @@ Garbage collection of old elements from mempool.txs is handlde via the DetachPrev() call, which makes old elements not reachable by peer broadcastTxRoutine() automatically garbage collected. -TODO: Better handle tmsp client errors. (make it automatically handle connection errors) +TODO: Better handle abci client errors. (make it automatically handle connection errors) */ @@ -139,17 +139,17 @@ func (mem *Mempool) TxsFrontWait() *clist.CElement { // cb: A callback from the CheckTx command. // It gets called from another goroutine. // CONTRACT: Either cb will get called, or err returned. -func (mem *Mempool) CheckTx(tx types.Tx, cb func(*tmsp.Response)) (err error) { +func (mem *Mempool) CheckTx(tx types.Tx, cb func(*abci.Response)) (err error) { mem.proxyMtx.Lock() defer mem.proxyMtx.Unlock() // CACHE if mem.cache.Exists(tx) { if cb != nil { - cb(&tmsp.Response{ - Value: &tmsp.Response_CheckTx{ - &tmsp.ResponseCheckTx{ - Code: tmsp.CodeType_BadNonce, // TODO or duplicate tx + cb(&abci.Response{ + Value: &abci.Response_CheckTx{ + &abci.ResponseCheckTx{ + Code: abci.CodeType_BadNonce, // TODO or duplicate tx Log: "Duplicate transaction (ignored)", }, }, @@ -180,8 +180,8 @@ func (mem *Mempool) CheckTx(tx types.Tx, cb func(*tmsp.Response)) (err error) { return nil } -// TMSP callback function -func (mem *Mempool) resCb(req *tmsp.Request, res *tmsp.Response) { +// ABCI callback function +func (mem *Mempool) resCb(req *abci.Request, res *abci.Response) { if mem.recheckCursor == nil { mem.resCbNormal(req, res) } else { @@ -189,10 +189,10 @@ func (mem *Mempool) resCb(req *tmsp.Request, res *tmsp.Response) { } } -func (mem *Mempool) resCbNormal(req *tmsp.Request, res *tmsp.Response) { +func (mem *Mempool) resCbNormal(req *abci.Request, res *abci.Response) { switch r := res.Value.(type) { - case *tmsp.Response_CheckTx: - if r.CheckTx.Code == tmsp.CodeType_OK { + case *abci.Response_CheckTx: + if r.CheckTx.Code == abci.CodeType_OK { mem.counter++ memTx := &mempoolTx{ counter: mem.counter, @@ -214,15 +214,15 @@ func (mem *Mempool) resCbNormal(req *tmsp.Request, res *tmsp.Response) { } } -func (mem *Mempool) resCbRecheck(req *tmsp.Request, res *tmsp.Response) { +func (mem *Mempool) resCbRecheck(req *abci.Request, res *abci.Response) { switch r := res.Value.(type) { - case *tmsp.Response_CheckTx: + case *abci.Response_CheckTx: memTx := mem.recheckCursor.Value.(*mempoolTx) if !bytes.Equal(req.GetCheckTx().Tx, memTx.tx) { PanicSanity(Fmt("Unexpected tx response from proxy during recheck\n"+ "Expected %X, got %X", r.CheckTx.Data, memTx.tx)) } - if r.CheckTx.Code == tmsp.CodeType_OK { + if r.CheckTx.Code == abci.CodeType_OK { // Good, nothing to do. } else { // Tx became invalidated due to newly committed block. diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index 4755bf096..d5816371f 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/tendermint/config/tendermint_test" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - "github.com/tendermint/tmsp/example/counter" + "github.com/tendermint/abci/example/counter" ) func TestSerialReap(t *testing.T) { @@ -16,8 +16,8 @@ func TestSerialReap(t *testing.T) { app := counter.NewCounterApplication(true) app.SetOption("serial", "on") cc := proxy.NewLocalClientCreator(app) - appConnMem, _ := cc.NewTMSPClient() - appConnCon, _ := cc.NewTMSPClient() + appConnMem, _ := cc.NewABCIClient() + appConnCon, _ := cc.NewABCIClient() mempool := NewMempool(config, appConnMem) appendTxsRange := func(start, end int) { diff --git a/mempool/reactor.go b/mempool/reactor.go index 626315de9..0c5cc9f85 100644 --- a/mempool/reactor.go +++ b/mempool/reactor.go @@ -12,7 +12,7 @@ import ( "github.com/tendermint/go-p2p" "github.com/tendermint/go-wire" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) const ( @@ -85,7 +85,7 @@ func (memR *MempoolReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte) { } // Just an alias for CheckTx since broadcasting happens in peer routines -func (memR *MempoolReactor) BroadcastTx(tx types.Tx, cb func(*tmsp.Response)) error { +func (memR *MempoolReactor) BroadcastTx(tx types.Tx, cb func(*abci.Response)) error { return memR.Mempool.CheckTx(tx, cb) } diff --git a/node/node.go b/node/node.go index d2bb46f6e..532c0a906 100644 --- a/node/node.go +++ b/node/node.go @@ -113,7 +113,7 @@ func NewNode(config cfg.Config, privValidator *types.PrivValidator, clientCreato sw.AddReactor("BLOCKCHAIN", bcReactor) sw.AddReactor("CONSENSUS", consensusReactor) - // filter peers by addr or pubkey with a tmsp query. + // filter peers by addr or pubkey with a abci query. // if the query return code is OK, add peer // XXX: query format subject to change if config.GetBool("filter_peers") { @@ -311,7 +311,7 @@ func makeNodeInfo(config cfg.Config, sw *p2p.Switch, privKey crypto.PrivKeyEd255 // Users wishing to: // * use an external signer for their validators -// * supply an in-proc tmsp app +// * supply an in-proc abci app // should fork tendermint/tendermint and implement RunNode to // call NewNode with their custom priv validator and/or custom // proxy.ClientCreator interface diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 754a71e64..f6462faaf 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -1,32 +1,32 @@ package proxy import ( - tmspcli "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/types" + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/types" ) //---------------------------------------------------------------------------------------- -// Enforce which tmsp msgs can be sent on a connection at the type level +// Enforce which abci msgs can be sent on a connection at the type level type AppConnConsensus interface { - SetResponseCallback(tmspcli.Callback) + SetResponseCallback(abcicli.Callback) Error() error InitChainSync(validators []*types.Validator) (err error) BeginBlockSync(hash []byte, header *types.Header) (err error) - AppendTxAsync(tx []byte) *tmspcli.ReqRes + AppendTxAsync(tx []byte) *abcicli.ReqRes EndBlockSync(height uint64) (types.ResponseEndBlock, error) CommitSync() (res types.Result) } type AppConnMempool interface { - SetResponseCallback(tmspcli.Callback) + SetResponseCallback(abcicli.Callback) Error() error - CheckTxAsync(tx []byte) *tmspcli.ReqRes + CheckTxAsync(tx []byte) *abcicli.ReqRes - FlushAsync() *tmspcli.ReqRes + FlushAsync() *abcicli.ReqRes FlushSync() error } @@ -41,19 +41,19 @@ type AppConnQuery interface { } //----------------------------------------------------------------------------------------- -// Implements AppConnConsensus (subset of tmspcli.Client) +// Implements AppConnConsensus (subset of abcicli.Client) type appConnConsensus struct { - appConn tmspcli.Client + appConn abcicli.Client } -func NewAppConnConsensus(appConn tmspcli.Client) *appConnConsensus { +func NewAppConnConsensus(appConn abcicli.Client) *appConnConsensus { return &appConnConsensus{ appConn: appConn, } } -func (app *appConnConsensus) SetResponseCallback(cb tmspcli.Callback) { +func (app *appConnConsensus) SetResponseCallback(cb abcicli.Callback) { app.appConn.SetResponseCallback(cb) } @@ -69,7 +69,7 @@ func (app *appConnConsensus) BeginBlockSync(hash []byte, header *types.Header) ( return app.appConn.BeginBlockSync(hash, header) } -func (app *appConnConsensus) AppendTxAsync(tx []byte) *tmspcli.ReqRes { +func (app *appConnConsensus) AppendTxAsync(tx []byte) *abcicli.ReqRes { return app.appConn.AppendTxAsync(tx) } @@ -82,19 +82,19 @@ func (app *appConnConsensus) CommitSync() (res types.Result) { } //------------------------------------------------ -// Implements AppConnMempool (subset of tmspcli.Client) +// Implements AppConnMempool (subset of abcicli.Client) type appConnMempool struct { - appConn tmspcli.Client + appConn abcicli.Client } -func NewAppConnMempool(appConn tmspcli.Client) *appConnMempool { +func NewAppConnMempool(appConn abcicli.Client) *appConnMempool { return &appConnMempool{ appConn: appConn, } } -func (app *appConnMempool) SetResponseCallback(cb tmspcli.Callback) { +func (app *appConnMempool) SetResponseCallback(cb abcicli.Callback) { app.appConn.SetResponseCallback(cb) } @@ -102,7 +102,7 @@ func (app *appConnMempool) Error() error { return app.appConn.Error() } -func (app *appConnMempool) FlushAsync() *tmspcli.ReqRes { +func (app *appConnMempool) FlushAsync() *abcicli.ReqRes { return app.appConn.FlushAsync() } @@ -110,18 +110,18 @@ func (app *appConnMempool) FlushSync() error { return app.appConn.FlushSync() } -func (app *appConnMempool) CheckTxAsync(tx []byte) *tmspcli.ReqRes { +func (app *appConnMempool) CheckTxAsync(tx []byte) *abcicli.ReqRes { return app.appConn.CheckTxAsync(tx) } //------------------------------------------------ -// Implements AppConnQuery (subset of tmspcli.Client) +// Implements AppConnQuery (subset of abcicli.Client) type appConnQuery struct { - appConn tmspcli.Client + appConn abcicli.Client } -func NewAppConnQuery(appConn tmspcli.Client) *appConnQuery { +func NewAppConnQuery(appConn abcicli.Client) *appConnQuery { return &appConnQuery{ appConn: appConn, } diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index e1e2d3040..2054175eb 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -5,29 +5,29 @@ import ( "testing" . "github.com/tendermint/go-common" - tmspcli "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/example/dummy" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/dummy" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) //---------------------------------------- type AppConnTest interface { - EchoAsync(string) *tmspcli.ReqRes + EchoAsync(string) *abcicli.ReqRes FlushSync() error InfoSync() (types.ResponseInfo, error) } type appConnTest struct { - appConn tmspcli.Client + appConn abcicli.Client } -func NewAppConnTest(appConn tmspcli.Client) AppConnTest { +func NewAppConnTest(appConn abcicli.Client) AppConnTest { return &appConnTest{appConn} } -func (app *appConnTest) EchoAsync(msg string) *tmspcli.ReqRes { +func (app *appConnTest) EchoAsync(msg string) *abcicli.ReqRes { return app.appConn.EchoAsync(msg) } @@ -54,7 +54,7 @@ func TestEcho(t *testing.T) { } defer s.Stop() // Start client - cli, err := clientCreator.NewTMSPClient() + cli, err := clientCreator.NewABCIClient() if err != nil { Exit(err.Error()) } @@ -78,7 +78,7 @@ func BenchmarkEcho(b *testing.B) { } defer s.Stop() // Start client - cli, err := clientCreator.NewTMSPClient() + cli, err := clientCreator.NewABCIClient() if err != nil { Exit(err.Error()) } @@ -107,7 +107,7 @@ func TestInfo(t *testing.T) { } defer s.Stop() // Start client - cli, err := clientCreator.NewTMSPClient() + cli, err := clientCreator.NewABCIClient() if err != nil { Exit(err.Error()) } diff --git a/proxy/client.go b/proxy/client.go index 587b45466..d5c9ff7b1 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -5,15 +5,15 @@ import ( "sync" cfg "github.com/tendermint/go-config" - tmspcli "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/example/dummy" - nilapp "github.com/tendermint/tmsp/example/nil" - "github.com/tendermint/tmsp/types" + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/dummy" + nilapp "github.com/tendermint/abci/example/nil" + "github.com/tendermint/abci/types" ) -// NewTMSPClient returns newly connected client +// NewABCIClient returns newly connected client type ClientCreator interface { - NewTMSPClient() (tmspcli.Client, error) + NewABCIClient() (abcicli.Client, error) } //---------------------------------------------------- @@ -31,8 +31,8 @@ func NewLocalClientCreator(app types.Application) ClientCreator { } } -func (l *localClientCreator) NewTMSPClient() (tmspcli.Client, error) { - return tmspcli.NewLocalClient(l.mtx, l.app), nil +func (l *localClientCreator) NewABCIClient() (abcicli.Client, error) { + return abcicli.NewLocalClient(l.mtx, l.app), nil } //--------------------------------------------------------------- @@ -52,9 +52,9 @@ func NewRemoteClientCreator(addr, transport string, mustConnect bool) ClientCrea } } -func (r *remoteClientCreator) NewTMSPClient() (tmspcli.Client, error) { +func (r *remoteClientCreator) NewABCIClient() (abcicli.Client, error) { // Run forever in a loop - remoteApp, err := tmspcli.NewClient(r.addr, r.transport, r.mustConnect) + remoteApp, err := abcicli.NewClient(r.addr, r.transport, r.mustConnect) if err != nil { return nil, fmt.Errorf("Failed to connect to proxy: %v", err) } @@ -66,7 +66,7 @@ func (r *remoteClientCreator) NewTMSPClient() (tmspcli.Client, error) { func DefaultClientCreator(config cfg.Config) ClientCreator { addr := config.GetString("proxy_app") - transport := config.GetString("tmsp") + transport := config.GetString("abci") switch addr { case "dummy": diff --git a/proxy/multi_app_conn.go b/proxy/multi_app_conn.go index 7095697d2..2c93152b1 100644 --- a/proxy/multi_app_conn.go +++ b/proxy/multi_app_conn.go @@ -28,7 +28,7 @@ type Handshaker interface { } // a multiAppConn is made of a few appConns (mempool, consensus, query) -// and manages their underlying tmsp clients, including the handshake +// and manages their underlying abci clients, including the handshake // which ensures the app and tendermint are synced. // TODO: on app restart, clients must reboot together type multiAppConn struct { @@ -45,7 +45,7 @@ type multiAppConn struct { clientCreator ClientCreator } -// Make all necessary tmsp connections to the application +// Make all necessary abci connections to the application func NewMultiAppConn(config cfg.Config, clientCreator ClientCreator, handshaker Handshaker) *multiAppConn { multiAppConn := &multiAppConn{ config: config, @@ -75,21 +75,21 @@ func (app *multiAppConn) OnStart() error { app.BaseService.OnStart() // query connection - querycli, err := app.clientCreator.NewTMSPClient() + querycli, err := app.clientCreator.NewABCIClient() if err != nil { return err } app.queryConn = NewAppConnQuery(querycli) // mempool connection - memcli, err := app.clientCreator.NewTMSPClient() + memcli, err := app.clientCreator.NewABCIClient() if err != nil { return err } app.mempoolConn = NewAppConnMempool(memcli) // consensus connection - concli, err := app.clientCreator.NewTMSPClient() + concli, err := app.clientCreator.NewABCIClient() if err != nil { return err } diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index a15fe0ccc..b1eaa9792 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -6,7 +6,7 @@ import ( ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) //----------------------------------------------------------------------------- @@ -23,8 +23,8 @@ func BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { // Returns with the response from CheckTx func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { - resCh := make(chan *tmsp.Response, 1) - err := mempool.CheckTx(tx, func(res *tmsp.Response) { + resCh := make(chan *abci.Response, 1) + err := mempool.CheckTx(tx, func(res *abci.Response) { resCh <- res }) if err != nil { @@ -42,7 +42,7 @@ func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { // CONTRACT: only returns error if mempool.BroadcastTx errs (ie. problem with the app) // or if we timeout waiting for tx to commit. // If CheckTx or AppendTx fail, no error will be returned, but the returned result -// will contain a non-OK TMSP code. +// will contain a non-OK ABCI code. func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { // subscribe to tx being committed in block @@ -52,8 +52,8 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { }) // broadcast the tx and register checktx callback - checkTxResCh := make(chan *tmsp.Response, 1) - err := mempool.CheckTx(tx, func(res *tmsp.Response) { + checkTxResCh := make(chan *abci.Response, 1) + err := mempool.CheckTx(tx, func(res *abci.Response) { checkTxResCh <- res }) if err != nil { @@ -62,7 +62,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { } checkTxRes := <-checkTxResCh checkTxR := checkTxRes.GetCheckTx() - if checkTxR.Code != tmsp.CodeType_OK { + if checkTxR.Code != abci.CodeType_OK { // CheckTx failed! return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, @@ -77,7 +77,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { select { case appendTxRes := <-appendTxResCh: // The tx was included in a block. - appendTxR := &tmsp.ResponseAppendTx{ + appendTxR := &abci.ResponseAppendTx{ Code: appendTxRes.Code, Data: appendTxRes.Data, Log: appendTxRes.Log, diff --git a/rpc/core/pipe.go b/rpc/core/pipe.go index ac776c7f6..356a2ff0d 100644 --- a/rpc/core/pipe.go +++ b/rpc/core/pipe.go @@ -8,7 +8,7 @@ import ( "github.com/tendermint/tendermint/consensus" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) //----------------------------------------------------- @@ -28,7 +28,7 @@ type Consensus interface { type Mempool interface { Size() int - CheckTx(types.Tx, func(*tmsp.Response)) error + CheckTx(types.Tx, func(*abci.Response)) error Reap(int) []types.Tx Flush() } diff --git a/rpc/core/routes.go b/rpc/core/routes.go index 97c013ab7..d53e90afa 100644 --- a/rpc/core/routes.go +++ b/rpc/core/routes.go @@ -25,8 +25,8 @@ var Routes = map[string]*rpc.RPCFunc{ "unconfirmed_txs": rpc.NewRPCFunc(UnconfirmedTxsResult, ""), "num_unconfirmed_txs": rpc.NewRPCFunc(NumUnconfirmedTxsResult, ""), - "tmsp_query": rpc.NewRPCFunc(TMSPQueryResult, "query"), - "tmsp_info": rpc.NewRPCFunc(TMSPInfoResult, ""), + "abci_query": rpc.NewRPCFunc(ABCIQueryResult, "query"), + "abci_info": rpc.NewRPCFunc(ABCIInfoResult, ""), "unsafe_flush_mempool": rpc.NewRPCFunc(UnsafeFlushMempool, ""), "unsafe_set_config": rpc.NewRPCFunc(UnsafeSetConfigResult, "type,key,value"), @@ -155,16 +155,16 @@ func BroadcastTxAsyncResult(tx []byte) (ctypes.TMResult, error) { } } -func TMSPQueryResult(query []byte) (ctypes.TMResult, error) { - if r, err := TMSPQuery(query); err != nil { +func ABCIQueryResult(query []byte) (ctypes.TMResult, error) { + if r, err := ABCIQuery(query); err != nil { return nil, err } else { return r, nil } } -func TMSPInfoResult() (ctypes.TMResult, error) { - if r, err := TMSPInfo(); err != nil { +func ABCIInfoResult() (ctypes.TMResult, error) { + if r, err := ABCIInfo(); err != nil { return nil, err } else { return r, nil diff --git a/rpc/core/tmsp.go b/rpc/core/tmsp.go index 000e0f84c..032193431 100644 --- a/rpc/core/tmsp.go +++ b/rpc/core/tmsp.go @@ -6,17 +6,17 @@ import ( //----------------------------------------------------------------------------- -func TMSPQuery(query []byte) (*ctypes.ResultTMSPQuery, error) { +func ABCIQuery(query []byte) (*ctypes.ResultABCIQuery, error) { res := proxyAppQuery.QuerySync(query) - return &ctypes.ResultTMSPQuery{res}, nil + return &ctypes.ResultABCIQuery{res}, nil } -func TMSPInfo() (*ctypes.ResultTMSPInfo, error) { +func ABCIInfo() (*ctypes.ResultABCIInfo, error) { res, err := proxyAppQuery.InfoSync() if err != nil { return nil, err } - return &ctypes.ResultTMSPInfo{ + return &ctypes.ResultABCIInfo{ Data: res.Data, Version: res.Version, LastBlockHeight: res.LastBlockHeight, diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 8d0c220b1..ff72fa65c 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -6,7 +6,7 @@ import ( "github.com/tendermint/go-rpc/types" "github.com/tendermint/go-wire" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) type ResultBlockchainInfo struct { @@ -58,14 +58,14 @@ type ResultDumpConsensusState struct { } type ResultBroadcastTx struct { - Code tmsp.CodeType `json:"code"` + Code abci.CodeType `json:"code"` Data []byte `json:"data"` Log string `json:"log"` } type ResultBroadcastTxCommit struct { - CheckTx *tmsp.ResponseCheckTx `json:"check_tx"` - AppendTx *tmsp.ResponseAppendTx `json:"append_tx"` + CheckTx *abci.ResponseCheckTx `json:"check_tx"` + AppendTx *abci.ResponseAppendTx `json:"append_tx"` } type ResultUnconfirmedTxs struct { @@ -73,15 +73,15 @@ type ResultUnconfirmedTxs struct { Txs []types.Tx `json:"txs"` } -type ResultTMSPInfo struct { +type ResultABCIInfo struct { Data string `json:"data"` Version string `json:"version"` LastBlockHeight uint64 `json:"last_block_height"` LastBlockAppHash []byte `json:"last_block_app_hash"` } -type ResultTMSPQuery struct { - Result tmsp.Result `json:"result"` +type ResultABCIQuery struct { + Result abci.Result `json:"result"` } type ResultUnsafeFlushMempool struct{} @@ -125,8 +125,8 @@ const ( ResultTypeBroadcastTxCommit = byte(0x62) // 0x7 bytes are for querying the application - ResultTypeTMSPQuery = byte(0x70) - ResultTypeTMSPInfo = byte(0x71) + ResultTypeABCIQuery = byte(0x70) + ResultTypeABCIInfo = byte(0x71) // 0x8 bytes are for events ResultTypeSubscribe = byte(0x80) @@ -167,6 +167,6 @@ var _ = wire.RegisterInterface( wire.ConcreteType{&ResultUnsafeProfile{}, ResultTypeUnsafeStopCPUProfiler}, wire.ConcreteType{&ResultUnsafeProfile{}, ResultTypeUnsafeWriteHeapProfile}, wire.ConcreteType{&ResultUnsafeFlushMempool{}, ResultTypeUnsafeFlushMempool}, - wire.ConcreteType{&ResultTMSPQuery{}, ResultTypeTMSPQuery}, - wire.ConcreteType{&ResultTMSPInfo{}, ResultTypeTMSPInfo}, + wire.ConcreteType{&ResultABCIQuery{}, ResultTypeABCIQuery}, + wire.ConcreteType{&ResultABCIInfo{}, ResultTypeABCIInfo}, ) diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go index 225110c23..c0c642427 100644 --- a/rpc/grpc/types.pb.go +++ b/rpc/grpc/types.pb.go @@ -17,7 +17,7 @@ package core_grpc import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import types "github.com/tendermint/tmsp/types" +import types "github.com/tendermint/abci/types" import ( context "golang.org/x/net/context" diff --git a/rpc/grpc/types.proto b/rpc/grpc/types.proto index ec7f0d1e6..507e17ef9 100644 --- a/rpc/grpc/types.proto +++ b/rpc/grpc/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package core_grpc; -import "github.com/tendermint/tmsp/types/types.proto"; +import "github.com/tendermint/abci/types/types.proto"; //---------------------------------------- // Message types diff --git a/rpc/test/client_test.go b/rpc/test/client_test.go index bfaa175ed..3b8dfd28e 100644 --- a/rpc/test/client_test.go +++ b/rpc/test/client_test.go @@ -12,8 +12,8 @@ import ( "github.com/tendermint/go-wire" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - "github.com/tendermint/tmsp/example/dummy" - tmsp "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/example/dummy" + abci "github.com/tendermint/abci/types" ) //-------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ func TestJSONBroadcastTxSync(t *testing.T) { func testBroadcastTxSync(t *testing.T, resI interface{}, tx []byte) { tmRes := resI.(*ctypes.TMResult) res := (*tmRes).(*ctypes.ResultBroadcastTx) - if res.Code != tmsp.CodeType_OK { + if res.Code != abci.CodeType_OK { panic(Fmt("BroadcastTxSync got non-zero exit code: %v. %X; %s", res.Code, res.Data, res.Log)) } mem := node.MempoolReactor().Mempool @@ -130,30 +130,30 @@ func sendTx() ([]byte, []byte) { return k, v } -func TestURITMSPQuery(t *testing.T) { +func TestURIABCIQuery(t *testing.T) { k, v := sendTx() time.Sleep(time.Second) tmResult := new(ctypes.TMResult) - _, err := clientURI.Call("tmsp_query", map[string]interface{}{"query": k}, tmResult) + _, err := clientURI.Call("abci_query", map[string]interface{}{"query": k}, tmResult) if err != nil { panic(err) } - testTMSPQuery(t, tmResult, v) + testABCIQuery(t, tmResult, v) } -func TestJSONTMSPQuery(t *testing.T) { +func TestJSONABCIQuery(t *testing.T) { k, v := sendTx() tmResult := new(ctypes.TMResult) - _, err := clientJSON.Call("tmsp_query", []interface{}{k}, tmResult) + _, err := clientJSON.Call("abci_query", []interface{}{k}, tmResult) if err != nil { panic(err) } - testTMSPQuery(t, tmResult, v) + testABCIQuery(t, tmResult, v) } -func testTMSPQuery(t *testing.T, statusI interface{}, value []byte) { +func testABCIQuery(t *testing.T, statusI interface{}, value []byte) { tmRes := statusI.(*ctypes.TMResult) - query := (*tmRes).(*ctypes.ResultTMSPQuery) + query := (*tmRes).(*ctypes.ResultABCIQuery) if query.Result.IsErr() { panic(Fmt("Query returned an err: %v", query)) } @@ -195,11 +195,11 @@ func testBroadcastTxCommit(t *testing.T, resI interface{}, tx []byte) { tmRes := resI.(*ctypes.TMResult) res := (*tmRes).(*ctypes.ResultBroadcastTxCommit) checkTx := res.CheckTx - if checkTx.Code != tmsp.CodeType_OK { + if checkTx.Code != abci.CodeType_OK { panic(Fmt("BroadcastTxCommit got non-zero exit code from CheckTx: %v. %X; %s", checkTx.Code, checkTx.Data, checkTx.Log)) } appendTx := res.AppendTx - if appendTx.Code != tmsp.CodeType_OK { + if appendTx.Code != abci.CodeType_OK { panic(Fmt("BroadcastTxCommit got non-zero exit code from CheckTx: %v. %X; %s", appendTx.Code, appendTx.Data, appendTx.Log)) } mem := node.MempoolReactor().Mempool @@ -295,7 +295,7 @@ func TestWSTxEvent(t *testing.T) { if bytes.Compare([]byte(evt.Tx), tx) != 0 { t.Error("Event returned different tx") } - if evt.Code != tmsp.CodeType_OK { + if evt.Code != abci.CodeType_OK { t.Error("Event returned tx error code", evt.Code) } return nil diff --git a/scripts/install_tmsp_apps.sh b/scripts/install_tmsp_apps.sh index d19edc9b4..6da2e2ed2 100644 --- a/scripts/install_tmsp_apps.sh +++ b/scripts/install_tmsp_apps.sh @@ -1,13 +1,13 @@ #! /bin/bash -go get github.com/tendermint/tmsp/... +go get github.com/tendermint/abci/... -# get the tmsp commit used by tendermint -COMMIT=`bash scripts/glide/parse.sh tmsp` +# get the abci commit used by tendermint +COMMIT=`bash scripts/glide/parse.sh abci` -echo "Checking out vendored commit for tmsp: $COMMIT" +echo "Checking out vendored commit for abci: $COMMIT" -cd $GOPATH/src/github.com/tendermint/tmsp +cd $GOPATH/src/github.com/tendermint/abci git checkout $COMMIT glide install go install ./cmd/... diff --git a/state/execution.go b/state/execution.go index 1a618b9ca..924d76be4 100644 --- a/state/execution.go +++ b/state/execution.go @@ -11,7 +11,7 @@ import ( "github.com/tendermint/go-crypto" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) //-------------------------------------------------- @@ -66,21 +66,21 @@ func (s *State) ExecBlock(eventCache types.Fireable, proxyAppConn proxy.AppConnC // Executes block's transactions on proxyAppConn. // Returns a list of updates to the validator set // TODO: Generate a bitmap or otherwise store tx validity in state. -func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnConsensus, block *types.Block) ([]*tmsp.Validator, error) { +func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnConsensus, block *types.Block) ([]*abci.Validator, error) { var validTxs, invalidTxs = 0, 0 // Execute transactions and get hash - proxyCb := func(req *tmsp.Request, res *tmsp.Response) { + proxyCb := func(req *abci.Request, res *abci.Response) { switch r := res.Value.(type) { - case *tmsp.Response_AppendTx: + case *abci.Response_AppendTx: // TODO: make use of res.Log // TODO: make use of this info // Blocks may include invalid txs. - // reqAppendTx := req.(tmsp.RequestAppendTx) + // reqAppendTx := req.(abci.RequestAppendTx) txError := "" apTx := r.AppendTx - if apTx.Code == tmsp.CodeType_OK { + if apTx.Code == abci.CodeType_OK { validTxs += 1 } else { log.Debug("Invalid tx", "code", r.AppendTx.Code, "log", r.AppendTx.Log) @@ -132,12 +132,12 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo log.Info("Executed block", "height", block.Height, "valid txs", validTxs, "invalid txs", invalidTxs) if len(respEndBlock.Diffs) > 0 { - log.Info("Update to validator set", "updates", tmsp.ValidatorsString(respEndBlock.Diffs)) + log.Info("Update to validator set", "updates", abci.ValidatorsString(respEndBlock.Diffs)) } return respEndBlock.Diffs, nil } -func updateValidators(validators *types.ValidatorSet, changedValidators []*tmsp.Validator) error { +func updateValidators(validators *types.ValidatorSet, changedValidators []*abci.Validator) error { // TODO: prevent change of 1/3+ at once for _, v := range changedValidators { @@ -321,7 +321,7 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error { blockHeight := int(res.LastBlockHeight) // XXX: beware overflow appHash := res.LastBlockAppHash - log.Notice("TMSP Handshake", "appHeight", blockHeight, "appHash", appHash) + log.Notice("ABCI Handshake", "appHeight", blockHeight, "appHash", appHash) // TODO: check version @@ -344,7 +344,7 @@ func (h *Handshaker) ReplayBlocks(appHash []byte, appBlockHeight int, appConnCon storeBlockHeight := h.store.Height() stateBlockHeight := h.state.LastBlockHeight - log.Notice("TMSP Replay Blocks", "appHeight", appBlockHeight, "storeHeight", storeBlockHeight, "stateHeight", stateBlockHeight) + log.Notice("ABCI Replay Blocks", "appHeight", appBlockHeight, "storeHeight", storeBlockHeight, "stateHeight", stateBlockHeight) if storeBlockHeight == 0 { return nil @@ -355,20 +355,20 @@ func (h *Handshaker) ReplayBlocks(appHash []byte, appBlockHeight int, appConnCon } else if storeBlockHeight == appBlockHeight { // We ran Commit, but if we crashed before state.Save(), // load the intermediate state and update the state.AppHash. - // NOTE: If TMSP allowed rollbacks, we could just replay the + // NOTE: If ABCI allowed rollbacks, we could just replay the // block even though it's been committed stateAppHash := h.state.AppHash lastBlockAppHash := h.store.LoadBlock(storeBlockHeight).AppHash if bytes.Equal(stateAppHash, appHash) { // we're all synced up - log.Debug("TMSP RelpayBlocks: Already synced") + log.Debug("ABCI RelpayBlocks: Already synced") } else if bytes.Equal(stateAppHash, lastBlockAppHash) { // we crashed after commit and before saving state, // so load the intermediate state and update the hash h.state.LoadIntermediate() h.state.AppHash = appHash - log.Debug("TMSP RelpayBlocks: Loaded intermediate state and updated state.AppHash") + log.Debug("ABCI RelpayBlocks: Loaded intermediate state and updated state.AppHash") } else { PanicSanity(Fmt("Unexpected state.AppHash: state.AppHash %X; app.AppHash %X, lastBlock.AppHash %X", stateAppHash, appHash, lastBlockAppHash)) diff --git a/state/execution_test.go b/state/execution_test.go index df9fc9a23..55a899a02 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -13,7 +13,7 @@ import ( dbm "github.com/tendermint/go-db" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - "github.com/tendermint/tmsp/example/dummy" + "github.com/tendermint/abci/example/dummy" ) var ( diff --git a/test/app/dummy_test.sh b/test/app/dummy_test.sh index 58c705b48..276742221 100644 --- a/test/app/dummy_test.sh +++ b/test/app/dummy_test.sh @@ -21,13 +21,13 @@ echo "" ########################### -# test using the tmsp-cli +# test using the abci-cli ########################### -echo "... testing query with tmsp-cli" +echo "... testing query with abci-cli" # we should be able to look up the key -RESPONSE=`tmsp-cli query \"$KEY\"` +RESPONSE=`abci-cli query \"$KEY\"` set +e A=`echo $RESPONSE | grep '"exists":true'` @@ -39,7 +39,7 @@ fi set -e # we should not be able to look up the value -RESPONSE=`tmsp-cli query \"$VALUE\"` +RESPONSE=`abci-cli query \"$VALUE\"` set +e A=`echo $RESPONSE | grep '"exists":true'` if [[ $? == 0 ]]; then @@ -50,13 +50,13 @@ fi set -e ############################# -# test using the /tmsp_query +# test using the /abci_query ############################# -echo "... testing query with /tmsp_query" +echo "... testing query with /abci_query" # we should be able to look up the key -RESPONSE=`curl -s 127.0.0.1:46657/tmsp_query?query=$(toHex $KEY)` +RESPONSE=`curl -s 127.0.0.1:46657/abci_query?query=$(toHex $KEY)` RESPONSE=`echo $RESPONSE | jq .result[1].result.Data | xxd -r -p` set +e @@ -69,7 +69,7 @@ fi set -e # we should not be able to look up the value -RESPONSE=`curl -s 127.0.0.1:46657/tmsp_query?query=\"$(toHex $VALUE)\"` +RESPONSE=`curl -s 127.0.0.1:46657/abci_query?query=\"$(toHex $VALUE)\"` RESPONSE=`echo $RESPONSE | jq .result[1].result.Data | xxd -r -p` set +e A=`echo $RESPONSE | grep '"exists":true'` diff --git a/test/app/test.sh b/test/app/test.sh index bcc55c937..8d589cd61 100644 --- a/test/app/test.sh +++ b/test/app/test.sh @@ -65,9 +65,9 @@ function counter_over_grpc() { rm -rf $TMROOT tendermint init echo "Starting counter_over_grpc" - counter --serial --tmsp grpc > /dev/null & + counter --serial --abci grpc > /dev/null & pid_counter=$! - tendermint node --tmsp grpc > tendermint.log & + tendermint node --abci grpc > tendermint.log & pid_tendermint=$! sleep 5 @@ -81,11 +81,11 @@ function counter_over_grpc_grpc() { rm -rf $TMROOT tendermint init echo "Starting counter_over_grpc_grpc (ie. with grpc broadcast_tx)" - counter --serial --tmsp grpc > /dev/null & + counter --serial --abci grpc > /dev/null & pid_counter=$! sleep 1 GRPC_PORT=36656 - tendermint node --tmsp grpc --grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log & + tendermint node --abci grpc --grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log & pid_tendermint=$! sleep 5 diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 5a859a289..a663926e4 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -19,7 +19,7 @@ RUN make get_vendor_deps COPY . $REPO RUN go install ./cmd/tendermint -RUN bash scripts/install_tmsp_apps.sh +RUN bash scripts/install_abci_apps.sh # expose the volume for debugging VOLUME $REPO diff --git a/test/p2p/data/app/init.sh b/test/p2p/data/app/init.sh index abaccae43..24f017630 100755 --- a/test/p2p/data/app/init.sh +++ b/test/p2p/data/app/init.sh @@ -1,5 +1,5 @@ #! /bin/bash -# This is a sample bash script for a TMSP application +# This is a sample bash script for a ABCI application cd app/ git clone https://github.com/tendermint/nomnomcoin.git diff --git a/test/p2p/data/core/init.sh b/test/p2p/data/core/init.sh index 95db91191..470ed37e3 100755 --- a/test/p2p/data/core/init.sh +++ b/test/p2p/data/core/init.sh @@ -8,7 +8,7 @@ BRANCH="master" go get -d $TMREPO/cmd/tendermint ### DEPENDENCIES (example) -# cd $GOPATH/src/github.com/tendermint/tmsp +# cd $GOPATH/src/github.com/tendermint/abci # git fetch origin $BRANCH # git checkout $BRANCH ### DEPENDENCIES END diff --git a/test/test_libs.sh b/test/test_libs.sh index 9f601f788..d33d242f1 100644 --- a/test/test_libs.sh +++ b/test/test_libs.sh @@ -12,7 +12,7 @@ fi #################### LIBS_GO_TEST=(go-clist go-common go-config go-crypto go-db go-events go-merkle go-p2p) -LIBS_MAKE_TEST=(go-rpc go-wire tmsp) +LIBS_MAKE_TEST=(go-rpc go-wire abci) for lib in "${LIBS_GO_TEST[@]}"; do diff --git a/types/events.go b/types/events.go index 8f7a5bbf0..aa5896e9b 100644 --- a/types/events.go +++ b/types/events.go @@ -5,7 +5,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-events" "github.com/tendermint/go-wire" - tmsp "github.com/tendermint/tmsp/types" + abci "github.com/tendermint/abci/types" ) // Functions to generate eventId strings @@ -76,7 +76,7 @@ type EventDataTx struct { Tx Tx `json:"tx"` Data []byte `json:"data"` Log string `json:"log"` - Code tmsp.CodeType `json:"code"` + Code abci.CodeType `json:"code"` Error string `json:"error"` // this is redundant information for now } diff --git a/types/protobuf.go b/types/protobuf.go index e1f03353b..41b4c54bb 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -1,7 +1,7 @@ package types import ( - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // Convert tendermint types to protobuf types diff --git a/version/version.go b/version/version.go index beb7e8615..cee2881cf 100644 --- a/version/version.go +++ b/version/version.go @@ -1,7 +1,7 @@ package version const Maj = "0" -const Min = "7" // tmsp useability (protobuf, unix); optimizations; broadcast_tx_commit +const Min = "7" // abci useability (protobuf, unix); optimizations; broadcast_tx_commit const Fix = "3" // fixes to event safety, mempool deadlock, hvs race, replay non-empty blocks const Version = Maj + "." + Min + "." + Fix From 94b6dd65ee4b517baa6d64867c3e9bc7da6548dc Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 15:55:03 -0500 Subject: [PATCH 2/4] AppendTx -> DeliverTx --- consensus/mempool_test.go | 10 +++++----- mempool/mempool_test.go | 20 ++++++++++---------- proxy/app_conn.go | 6 +++--- rpc/core/mempool.go | 24 ++++++++++++------------ rpc/core/types/responses.go | 2 +- rpc/grpc/api.go | 2 +- rpc/grpc/types.pb.go | 6 +++--- rpc/grpc/types.proto | 2 +- rpc/test/client_test.go | 6 +++--- rpc/test/grpc_test.go | 4 ++-- state/execution.go | 12 ++++++------ test/app/counter_test.sh | 2 +- 12 files changed, 48 insertions(+), 48 deletions(-) diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index d12388727..d298b5cb4 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -23,8 +23,8 @@ func TestTxConcurrentWithCommit(t *testing.T) { height, round := cs.Height, cs.Round newBlockCh := subscribeToEvent(cs.evsw, "tester", types.EventStringNewBlock(), 1) - appendTxsRange := func(start, end int) { - // Append some txs. + deliverTxsRange := func(start, end int) { + // Deliver some txs. for i := start; i < end; i++ { txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(i)) @@ -37,7 +37,7 @@ func TestTxConcurrentWithCommit(t *testing.T) { } NTxs := 10000 - go appendTxsRange(0, NTxs) + go deliverTxsRange(0, NTxs) startTestRound(cs, height, round) ticker := time.NewTicker(time.Second * 20) @@ -59,7 +59,7 @@ func TestRmBadTx(t *testing.T) { // increment the counter by 1 txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(0)) - app.AppendTx(txBytes) + app.DeliverTx(txBytes) app.Commit() ch := make(chan struct{}) @@ -130,7 +130,7 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) return "" } -func (app *CounterApplication) AppendTx(tx []byte) abci.Result { +func (app *CounterApplication) DeliverTx(tx []byte) abci.Result { return runTx(tx, &app.txCount) } diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index d5816371f..9ac8fe33d 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -20,8 +20,8 @@ func TestSerialReap(t *testing.T) { appConnCon, _ := cc.NewABCIClient() mempool := NewMempool(config, appConnMem) - appendTxsRange := func(start, end int) { - // Append some txs. + deliverTxsRange := func(start, end int) { + // Deliver some txs. for i := start; i < end; i++ { // This will succeed @@ -61,11 +61,11 @@ func TestSerialReap(t *testing.T) { } commitRange := func(start, end int) { - // Append some txs. + // Deliver some txs. for i := start; i < end; i++ { txBytes := make([]byte, 8) binary.BigEndian.PutUint64(txBytes, uint64(i)) - res := appConnCon.AppendTxSync(txBytes) + res := appConnCon.DeliverTxSync(txBytes) if !res.IsOK() { t.Errorf("Error committing tx. Code:%v result:%X log:%v", res.Code, res.Data, res.Log) @@ -79,8 +79,8 @@ func TestSerialReap(t *testing.T) { //---------------------------------------- - // Append some txs. - appendTxsRange(0, 100) + // Deliver some txs. + deliverTxsRange(0, 100) // Reap the txs. reapCheck(100) @@ -88,9 +88,9 @@ func TestSerialReap(t *testing.T) { // Reap again. We should get the same amount reapCheck(100) - // Append 0 to 999, we should reap 900 new txs + // Deliver 0 to 999, we should reap 900 new txs // because 100 were already counted. - appendTxsRange(0, 1000) + deliverTxsRange(0, 1000) // Reap the txs. reapCheck(1000) @@ -105,8 +105,8 @@ func TestSerialReap(t *testing.T) { // We should have 500 left. reapCheck(500) - // Append 100 invalid txs and 100 valid txs - appendTxsRange(900, 1100) + // Deliver 100 invalid txs and 100 valid txs + deliverTxsRange(900, 1100) // We should have 600 now. reapCheck(600) diff --git a/proxy/app_conn.go b/proxy/app_conn.go index f6462faaf..6abb8c7eb 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -15,7 +15,7 @@ type AppConnConsensus interface { InitChainSync(validators []*types.Validator) (err error) BeginBlockSync(hash []byte, header *types.Header) (err error) - AppendTxAsync(tx []byte) *abcicli.ReqRes + DeliverTxAsync(tx []byte) *abcicli.ReqRes EndBlockSync(height uint64) (types.ResponseEndBlock, error) CommitSync() (res types.Result) } @@ -69,8 +69,8 @@ func (app *appConnConsensus) BeginBlockSync(hash []byte, header *types.Header) ( return app.appConn.BeginBlockSync(hash, header) } -func (app *appConnConsensus) AppendTxAsync(tx []byte) *abcicli.ReqRes { - return app.appConn.AppendTxAsync(tx) +func (app *appConnConsensus) DeliverTxAsync(tx []byte) *abcicli.ReqRes { + return app.appConn.DeliverTxAsync(tx) } func (app *appConnConsensus) EndBlockSync(height uint64) (types.ResponseEndBlock, error) { diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index b1eaa9792..eefc226ad 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -41,14 +41,14 @@ func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { // CONTRACT: only returns error if mempool.BroadcastTx errs (ie. problem with the app) // or if we timeout waiting for tx to commit. -// If CheckTx or AppendTx fail, no error will be returned, but the returned result +// If CheckTx or DeliverTx fail, no error will be returned, but the returned result // will contain a non-OK ABCI code. func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { // subscribe to tx being committed in block - appendTxResCh := make(chan types.EventDataTx, 1) + deliverTxResCh := make(chan types.EventDataTx, 1) types.AddListenerForEvent(eventSwitch, "rpc", types.EventStringTx(tx), func(data types.TMEventData) { - appendTxResCh <- data.(types.EventDataTx) + deliverTxResCh <- data.(types.EventDataTx) }) // broadcast the tx and register checktx callback @@ -66,7 +66,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { // CheckTx failed! return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, - AppendTx: nil, + DeliverTx: nil, }, nil } @@ -75,23 +75,23 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { // TODO: configureable? timer := time.NewTimer(60 * 2 * time.Second) select { - case appendTxRes := <-appendTxResCh: + case deliverTxRes := <-deliverTxResCh: // The tx was included in a block. - appendTxR := &abci.ResponseAppendTx{ - Code: appendTxRes.Code, - Data: appendTxRes.Data, - Log: appendTxRes.Log, + deliverTxR := &abci.ResponseDeliverTx{ + Code: deliverTxRes.Code, + Data: deliverTxRes.Data, + Log: deliverTxRes.Log, } - log.Notice("AppendTx passed ", "tx", []byte(tx), "response", appendTxR) + log.Notice("DeliverTx passed ", "tx", []byte(tx), "response", deliverTxR) return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, - AppendTx: appendTxR, + DeliverTx: deliverTxR, }, nil case <-timer.C: log.Error("failed to include tx") return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, - AppendTx: nil, + DeliverTx: nil, }, fmt.Errorf("Timed out waiting for transaction to be included in a block") } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index ff72fa65c..5915c1db6 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -65,7 +65,7 @@ type ResultBroadcastTx struct { type ResultBroadcastTxCommit struct { CheckTx *abci.ResponseCheckTx `json:"check_tx"` - AppendTx *abci.ResponseAppendTx `json:"append_tx"` + DeliverTx *abci.ResponseDeliverTx `json:"deliver_tx"` } type ResultUnconfirmedTxs struct { diff --git a/rpc/grpc/api.go b/rpc/grpc/api.go index c8b8dce75..fab811c2e 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -14,5 +14,5 @@ func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcast if err != nil { return nil, err } - return &ResponseBroadcastTx{res.CheckTx, res.AppendTx}, nil + return &ResponseBroadcastTx{res.CheckTx, res.DeliverTx}, nil } diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go index c0c642427..d373f0971 100644 --- a/rpc/grpc/types.pb.go +++ b/rpc/grpc/types.pb.go @@ -53,7 +53,7 @@ func (m *RequestBroadcastTx) GetTx() []byte { type ResponseBroadcastTx struct { CheckTx *types.ResponseCheckTx `protobuf:"bytes,1,opt,name=check_tx,json=checkTx" json:"check_tx,omitempty"` - AppendTx *types.ResponseAppendTx `protobuf:"bytes,2,opt,name=append_tx,json=appendTx" json:"append_tx,omitempty"` + DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=deliver_tx,json=deliverTx" json:"deliver_tx,omitempty"` } func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } @@ -68,9 +68,9 @@ func (m *ResponseBroadcastTx) GetCheckTx() *types.ResponseCheckTx { return nil } -func (m *ResponseBroadcastTx) GetAppendTx() *types.ResponseAppendTx { +func (m *ResponseBroadcastTx) GetDeliverTx() *types.ResponseDeliverTx { if m != nil { - return m.AppendTx + return m.DeliverTx } return nil } diff --git a/rpc/grpc/types.proto b/rpc/grpc/types.proto index 507e17ef9..3090e3d06 100644 --- a/rpc/grpc/types.proto +++ b/rpc/grpc/types.proto @@ -18,7 +18,7 @@ message RequestBroadcastTx { message ResponseBroadcastTx{ types.ResponseCheckTx check_tx = 1; - types.ResponseAppendTx append_tx = 2; + types.ResponseDeliverTx deliver_tx = 2; } //---------------------------------------- diff --git a/rpc/test/client_test.go b/rpc/test/client_test.go index 3b8dfd28e..da0b86f36 100644 --- a/rpc/test/client_test.go +++ b/rpc/test/client_test.go @@ -198,9 +198,9 @@ func testBroadcastTxCommit(t *testing.T, resI interface{}, tx []byte) { if checkTx.Code != abci.CodeType_OK { panic(Fmt("BroadcastTxCommit got non-zero exit code from CheckTx: %v. %X; %s", checkTx.Code, checkTx.Data, checkTx.Log)) } - appendTx := res.AppendTx - if appendTx.Code != abci.CodeType_OK { - panic(Fmt("BroadcastTxCommit got non-zero exit code from CheckTx: %v. %X; %s", appendTx.Code, appendTx.Data, appendTx.Log)) + deliverTx := res.DeliverTx + if deliverTx.Code != abci.CodeType_OK { + panic(Fmt("BroadcastTxCommit got non-zero exit code from CheckTx: %v. %X; %s", deliverTx.Code, deliverTx.Data, deliverTx.Log)) } mem := node.MempoolReactor().Mempool if mem.Size() != 0 { diff --git a/rpc/test/grpc_test.go b/rpc/test/grpc_test.go index 13672773c..73ba22a78 100644 --- a/rpc/test/grpc_test.go +++ b/rpc/test/grpc_test.go @@ -18,7 +18,7 @@ func TestBroadcastTx(t *testing.T) { if res.CheckTx.Code != 0 { t.Fatalf("Non-zero check tx code: %d", res.CheckTx.Code) } - if res.AppendTx.Code != 0 { - t.Fatalf("Non-zero append tx code: %d", res.AppendTx.Code) + if res.DeliverTx.Code != 0 { + t.Fatalf("Non-zero append tx code: %d", res.DeliverTx.Code) } } diff --git a/state/execution.go b/state/execution.go index 924d76be4..a7ba2399e 100644 --- a/state/execution.go +++ b/state/execution.go @@ -73,24 +73,24 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo // Execute transactions and get hash proxyCb := func(req *abci.Request, res *abci.Response) { switch r := res.Value.(type) { - case *abci.Response_AppendTx: + case *abci.Response_DeliverTx: // TODO: make use of res.Log // TODO: make use of this info // Blocks may include invalid txs. - // reqAppendTx := req.(abci.RequestAppendTx) + // reqDeliverTx := req.(abci.RequestDeliverTx) txError := "" - apTx := r.AppendTx + apTx := r.DeliverTx if apTx.Code == abci.CodeType_OK { validTxs += 1 } else { - log.Debug("Invalid tx", "code", r.AppendTx.Code, "log", r.AppendTx.Log) + log.Debug("Invalid tx", "code", r.DeliverTx.Code, "log", r.DeliverTx.Log) invalidTxs += 1 txError = apTx.Code.String() } // NOTE: if we count we can access the tx from the block instead of // pulling it from the req event := types.EventDataTx{ - Tx: req.GetAppendTx().Tx, + Tx: req.GetDeliverTx().Tx, Data: apTx.Data, Code: apTx.Code, Log: apTx.Log, @@ -113,7 +113,7 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo // Run txs of block for _, tx := range block.Txs { fail.FailRand(len(block.Txs)) // XXX - proxyAppConn.AppendTxAsync(tx) + proxyAppConn.DeliverTxAsync(tx) if err := proxyAppConn.Error(); err != nil { return nil, err } diff --git a/test/app/counter_test.sh b/test/app/counter_test.sh index 37f65b90e..c0ae57245 100644 --- a/test/app/counter_test.sh +++ b/test/app/counter_test.sh @@ -50,7 +50,7 @@ function sendTx() { if [[ "$IS_JSON" != "0" ]]; then ERROR="$RESPONSE" fi - APPEND_TX_RESPONSE=`echo $RESPONSE | jq .append_tx` + APPEND_TX_RESPONSE=`echo $RESPONSE | jq .deliver_tx` APPEND_TX_CODE=`getCode "$APPEND_TX_RESPONSE"` CHECK_TX_RESPONSE=`echo $RESPONSE | jq .check_tx` CHECK_TX_CODE=`getCode "$CHECK_TX_RESPONSE"` From e0aead0be263497d5934a05467dabe5285d02bad Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 16:07:13 -0500 Subject: [PATCH 3/4] update glide --- glide.lock | 7 +++---- glide.yaml | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/glide.lock b/glide.lock index 4652ea0b3..eedd63847 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 25681f005f0b9b1816cd5c5f0a0fd013395a7477c656c6010bb570b5aebd2d0a -updated: 2017-01-12T15:52:43.856786013-05:00 +hash: 0655af0148909b2311f54b5ad1bf7c299583d675fc6b79774020ae2b6f26a12c +updated: 2017-01-12T16:12:19.790522242-05:00 imports: - name: github.com/btcsuite/btcd version: afec1bd1245a4a19e6dfe1306974b733e7cbb9b8 @@ -49,8 +49,7 @@ imports: - leveldb/table - leveldb/util - name: github.com/tendermint/abci - version: 3a5e63e987a50cf74a16fe0a5e18e74eb82b2031 - repo: https://github.com/tendermint/tmsp + version: 624dca61b31ee9d7a49fe2a9343018913eee3f11 subpackages: - client - example/counter diff --git a/glide.yaml b/glide.yaml index 8273fb186..d872a24ea 100644 --- a/glide.yaml +++ b/glide.yaml @@ -29,8 +29,7 @@ import: version: develop - package: github.com/tendermint/log15 - package: github.com/tendermint/abci - version: rename - repo: https://github.com/tendermint/tmsp + version: develop - package: golang.org/x/crypto subpackages: - ripemd160 From d83ca54b3655d137cc1cbacaeafcd01a0120a545 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 16:17:43 -0500 Subject: [PATCH 4/4] file name fixes --- rpc/core/{tmsp.go => abci.go} | 0 scripts/{install_tmsp_apps.sh => install_abci_apps.sh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename rpc/core/{tmsp.go => abci.go} (100%) rename scripts/{install_tmsp_apps.sh => install_abci_apps.sh} (100%) diff --git a/rpc/core/tmsp.go b/rpc/core/abci.go similarity index 100% rename from rpc/core/tmsp.go rename to rpc/core/abci.go diff --git a/scripts/install_tmsp_apps.sh b/scripts/install_abci_apps.sh similarity index 100% rename from scripts/install_tmsp_apps.sh rename to scripts/install_abci_apps.sh