From 5189a2248d5b4d952a40fc72a14c510af3aa10dc Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 15:47:55 -0500 Subject: [PATCH] TMSP -> ABCI --- LICENSE | 2 +- Makefile | 4 +- README.md | 32 ++-- client/client.go | 6 +- client/grpc_client.go | 12 +- client/local_client.go | 4 +- client/log.go | 4 +- client/socket_client.go | 8 +- cmd/{tmsp-cli => abci-cli}/tmsp-cli.go | 18 +-- cmd/counter/main.go | 8 +- cmd/dummy/main.go | 10 +- example/chain_aware/chain_aware_app.go | 8 +- example/chain_aware/chain_aware_test.go | 8 +- example/counter/counter.go | 2 +- example/dummy/README.md | 2 +- example/dummy/dummy.go | 2 +- example/dummy/dummy_test.go | 8 +- example/dummy/persistent_dummy.go | 2 +- example/example_test.go | 14 +- example/js/README.md | 2 +- example/nil/nil_app.go | 2 +- example/python/{tmsp => abci}/__init__.py | 0 example/python/{tmsp => abci}/msg.py | 2 +- example/python/{tmsp => abci}/reader.py | 0 example/python/{tmsp => abci}/server.py | 4 +- example/python/{tmsp => abci}/wire.py | 0 example/python/app.py | 10 +- example/python3/{tmsp => abci}/__init__.py | 0 example/python3/{tmsp => abci}/msg.py | 2 +- example/python3/{tmsp => abci}/reader.py | 0 example/python3/{tmsp => abci}/server.py | 4 +- example/python3/{tmsp => abci}/wire.py | 0 example/python3/app.py | 10 +- glide.yaml | 2 +- server/grpc_server.go | 10 +- server/log.go | 2 +- server/server.go | 2 +- server/socket_server.go | 4 +- tests/benchmarks/parallel/parallel.go | 2 +- tests/benchmarks/simple/simple.go | 2 +- tests/test_app/app.go | 26 +-- tests/test_app/main.go | 22 +-- tests/test_app/test.sh | 10 +- tests/test_cli/{ex1.tmsp => ex1.abci} | 0 tests/test_cli/{ex1.tmsp.out => ex1.abci.out} | 0 tests/test_cli/{ex2.tmsp => ex2.abci} | 0 tests/test_cli/{ex2.tmsp.out => ex2.abci.out} | 0 tests/test_cli/test.sh | 8 +- testutil/messages.go | 2 +- types/result.go | 2 +- types/types.pb.go | 152 +++++++++--------- types/types.proto | 4 +- 52 files changed, 221 insertions(+), 219 deletions(-) rename cmd/{tmsp-cli => abci-cli}/tmsp-cli.go (95%) rename example/python/{tmsp => abci}/__init__.py (100%) rename example/python/{tmsp => abci}/msg.py (94%) rename example/python/{tmsp => abci}/reader.py (100%) rename example/python/{tmsp => abci}/server.py (98%) rename example/python/{tmsp => abci}/wire.py (100%) rename example/python3/{tmsp => abci}/__init__.py (100%) rename example/python3/{tmsp => abci}/msg.py (94%) rename example/python3/{tmsp => abci}/reader.py (100%) rename example/python3/{tmsp => abci}/server.py (98%) rename example/python3/{tmsp => abci}/wire.py (100%) rename tests/test_cli/{ex1.tmsp => ex1.abci} (100%) rename tests/test_cli/{ex1.tmsp.out => ex1.abci.out} (100%) rename tests/test_cli/{ex2.tmsp => ex2.abci} (100%) rename tests/test_cli/{ex2.tmsp.out => ex2.abci.out} (100%) diff --git a/LICENSE b/LICENSE index 3934a10fe..57951bb8a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Tendermint TMSP +Tendermint ABCI Copyright (C) 2015 Tendermint diff --git a/Makefile b/Makefile index b00c5a672..22fa6fdd1 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ all: protoc test install -NOVENDOR = go list github.com/tendermint/tmsp/... | grep -v /vendor/ +NOVENDOR = go list github.com/tendermint/abci/... | grep -v /vendor/ protoc: protoc --go_out=plugins=grpc:. types/*.proto install: - go install github.com/tendermint/tmsp/cmd/... + go install github.com/tendermint/abci/cmd/... test: go test `${NOVENDOR}` diff --git a/README.md b/README.md index cb757695b..8672af921 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,37 @@ -# Tendermint Socket Protocol (TMSP) +# Tendermint Socket Protocol (ABCI) -[![CircleCI](https://circleci.com/gh/tendermint/tmsp.svg?style=svg)](https://circleci.com/gh/tendermint/tmsp) +[![CircleCI](https://circleci.com/gh/tendermint/abci.svg?style=svg)](https://circleci.com/gh/tendermint/abci) Blockchains are a system for creating shared multi-master application state. -**TMSP** is a socket protocol enabling a blockchain consensus engine, running in one process, +**ABCI** is a socket protocol enabling a blockchain consensus engine, running in one process, to manage a blockchain application state, running in another. -For more information on TMSP, motivations, and tutorials, please visit [our blog post](http://tendermint.com/blog/tmsp-the-tendermint-socket-protocol/). +For more information on ABCI, motivations, and tutorials, please visit [our blog post](http://tendermint.com/blog/abci-the-tendermint-socket-protocol/). Other implementations: -* [cpp-tmsp](https://github.com/mdyring/cpp-tmsp) by Martin Dyring-Andersen -* [js-tmsp](https://github.com/tendermint/js-tmsp) -* [jTMSP](https://github.com/jTMSP/) for Java +* [cpp-abci](https://github.com/mdyring/cpp-abci) by Martin Dyring-Andersen +* [js-abci](https://github.com/tendermint/js-abci) +* [jABCI](https://github.com/jABCI/) for Java ## Contents This repository holds a number of important pieces: - `types/types.proto` - - the protobuf file defining TMSP message types, and the optional grpc interface. + - the protobuf file defining ABCI message types, and the optional grpc interface. - to build, run `make protoc` - see `protoc --help` and [the grpc docs](https://www.grpc.io/docs) for examples and details of other languages -- golang implementation of TMSP client and server +- golang implementation of ABCI client and server - two implementations: - asynchronous, ordered message passing over unix or tcp; - messages are serialized using protobuf and length prefixed - grpc - TendermintCore runs a client, and the application runs a server -- `cmd/tmsp-cli` - - command line tool wrapping the client for probing/testing a TMSP application - - use `tmsp-cli --version` to get the TMSP version +- `cmd/abci-cli` + - command line tool wrapping the client for probing/testing a ABCI application + - use `abci-cli --version` to get the ABCI version - examples: - the `cmd/counter` application, which illustrates nonce checking in txs @@ -42,13 +42,13 @@ This repository holds a number of important pieces: Since this is a streaming protocol, all messages are encoded with a length-prefix followed by the message encoded in Protobuf3. Protobuf3 doesn't have an official length-prefix standard, so we use our own. The first byte represents the length of the big-endian encoded length. -For example, if the Protobuf3 encoded TMSP message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded TMSP message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`. +For example, if the Protobuf3 encoded ABCI message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`. Note this prefixing does not apply for grpc. ## Message types -TMSP requests/responses are simple Protobuf messages. Check out the [schema file](https://github.com/tendermint/tmsp/blob/master/types/types.proto). +ABCI requests/responses are simple Protobuf messages. Check out the [schema file](https://github.com/tendermint/abci/blob/master/types/types.proto). #### DeliverTx * __Arguments__: @@ -148,7 +148,7 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil ##### Jan 23th, 2016 -* Added CheckTx/Query TMSP message types +* Added CheckTx/Query ABCI message types * Added Result/Log fields to DeliverTx/CheckTx/SetOption * Removed Listener messages * Removed Code from ResponseSetOption and ResponseGetHash @@ -160,4 +160,4 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil ##### Jan 8th, 2016 -* Tendermint/TMSP now comes to consensus on the order first before DeliverTx. +* Tendermint/ABCI now comes to consensus on the order first before DeliverTx. diff --git a/client/client.go b/client/client.go index 0305b29e2..8ea295937 100644 --- a/client/client.go +++ b/client/client.go @@ -1,11 +1,11 @@ -package tmspcli +package abcicli import ( "fmt" "sync" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type Client interface { @@ -50,7 +50,7 @@ func NewClient(addr, transport string, mustConnect bool) (client Client, err err case "grpc": client, err = NewGRPCClient(addr, mustConnect) default: - err = fmt.Errorf("Unknown tmsp transport %s", transport) + err = fmt.Errorf("Unknown abci transport %s", transport) } return diff --git a/client/grpc_client.go b/client/grpc_client.go index ac6beb06b..566ee183e 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -1,4 +1,4 @@ -package tmspcli +package abcicli import ( "net" @@ -9,7 +9,7 @@ import ( grpc "google.golang.org/grpc" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // A stripped copy of the remoteClient that makes @@ -18,7 +18,7 @@ type grpcClient struct { BaseService mustConnect bool - client types.TMSPApplicationClient + client types.ABCIApplicationClient mtx sync.Mutex addr string @@ -50,13 +50,13 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(Fmt("tmsp.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) + log.Warn(Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } } - client := types.NewTMSPApplicationClient(conn) + client := types.NewABCIApplicationClient(conn) ENSURE_CONNECTED: for { @@ -93,7 +93,7 @@ func (cli *grpcClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(Fmt("Stopping tmsp.grpcClient for error: %v", err.Error())) + log.Warn(Fmt("Stopping abci.grpcClient for error: %v", err.Error())) cli.Stop() } diff --git a/client/local_client.go b/client/local_client.go index 9b0eeaf00..b787eb365 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -1,10 +1,10 @@ -package tmspcli +package abcicli import ( "sync" . "github.com/tendermint/go-common" - types "github.com/tendermint/tmsp/types" + types "github.com/tendermint/abci/types" ) type localClient struct { diff --git a/client/log.go b/client/log.go index deadf6c34..944b05ba0 100644 --- a/client/log.go +++ b/client/log.go @@ -1,7 +1,7 @@ -package tmspcli +package abcicli import ( "github.com/tendermint/go-logger" ) -var log = logger.New("module", "tmspcli") +var log = logger.New("module", "abcicli") diff --git a/client/socket_client.go b/client/socket_client.go index 2a914f815..9b4f9aed4 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -1,4 +1,4 @@ -package tmspcli +package abcicli import ( "bufio" @@ -11,7 +11,7 @@ import ( "time" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) const ( @@ -70,7 +70,7 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(Fmt("tmsp.socketClient failed to connect to %v. Retrying...", cli.addr)) + log.Warn(Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } @@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(Fmt("Stopping tmsp.socketClient for error: %v", err.Error())) + log.Warn(Fmt("Stopping abci.socketClient for error: %v", err.Error())) cli.Stop() } diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go similarity index 95% rename from cmd/tmsp-cli/tmsp-cli.go rename to cmd/abci-cli/tmsp-cli.go index b1d0d33e4..b8bc2937e 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -10,8 +10,8 @@ import ( "strings" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/types" "github.com/urfave/cli" ) @@ -40,7 +40,7 @@ func newResponse(res types.Result, data string, printCode bool) *response { } // client is a global variable so it can be reused by the console -var client tmspcli.Client +var client abcicli.Client func main() { @@ -48,8 +48,8 @@ func main() { cli.OsExiter = func(_ int) {} app := cli.NewApp() - app.Name = "tmsp-cli" - app.Usage = "tmsp-cli [command] [args...]" + app.Name = "abci-cli" + app.Usage = "abci-cli [command] [args...]" app.Version = "0.2.1" // better error handling in console app.Flags = []cli.Flag{ cli.StringFlag{ @@ -58,7 +58,7 @@ func main() { Usage: "address of application socket", }, cli.StringFlag{ - Name: "tmsp", + Name: "abci", Value: "socket", Usage: "socket or grpc", }, @@ -70,14 +70,14 @@ func main() { app.Commands = []cli.Command{ { Name: "batch", - Usage: "Run a batch of tmsp commands against an application", + Usage: "Run a batch of abci commands against an application", Action: func(c *cli.Context) error { return cmdBatch(app, c) }, }, { Name: "console", - Usage: "Start an interactive tmsp console for multiple commands", + Usage: "Start an interactive abci console for multiple commands", Action: func(c *cli.Context) error { return cmdConsole(app, c) }, @@ -143,7 +143,7 @@ func main() { func before(c *cli.Context) error { if client == nil { var err error - client, err = tmspcli.NewClient(c.GlobalString("address"), c.GlobalString("tmsp"), false) + client, err = abcicli.NewClient(c.GlobalString("address"), c.GlobalString("abci"), false) if err != nil { Exit(err.Error()) } diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 0f284af9e..218224a0a 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -4,20 +4,20 @@ import ( "flag" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/example/counter" - "github.com/tendermint/tmsp/server" + "github.com/tendermint/abci/example/counter" + "github.com/tendermint/abci/server" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - tmspPtr := flag.String("tmsp", "socket", "TMSP server: socket | grpc") + abciPtr := flag.String("abci", "socket", "ABCI server: socket | grpc") serialPtr := flag.Bool("serial", false, "Enforce incrementing (serial) txs") flag.Parse() app := counter.NewCounterApplication(*serialPtr) // Start the listener - srv, err := server.NewServer(*addrPtr, *tmspPtr, app) + srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { Exit(err.Error()) } diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index fe7ae750b..aecb1138f 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -4,15 +4,15 @@ import ( "flag" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/example/dummy" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/example/dummy" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - tmspPtr := flag.String("tmsp", "socket", "socket | grpc") + abciPtr := flag.String("abci", "socket", "socket | grpc") persistencePtr := flag.String("persist", "", "directory to use for a database") flag.Parse() @@ -25,7 +25,7 @@ func main() { } // Start the listener - srv, err := server.NewServer(*addrPtr, *tmspPtr, app) + srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { Exit(err.Error()) } diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 35774d668..e3543f13c 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -4,18 +4,18 @@ import ( "flag" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - tmspPtr := flag.String("tmsp", "socket", "socket | grpc") + abciPtr := flag.String("abci", "socket", "socket | grpc") flag.Parse() // Start the listener - srv, err := server.NewServer(*addrPtr, *tmspPtr, NewChainAwareApplication()) + srv, err := server.NewServer(*addrPtr, *abciPtr, NewChainAwareApplication()) if err != nil { Exit(err.Error()) } diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index fd3754704..f5283a386 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -6,9 +6,9 @@ import ( "testing" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func TestChainAware(t *testing.T) { @@ -23,7 +23,7 @@ func TestChainAware(t *testing.T) { defer srv.Stop() // Connect to the socket - client, err := tmspcli.NewSocketClient("unix://test.sock", false) + client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { Exit(Fmt("Error starting socket client: %v", err.Error())) } diff --git a/example/counter/counter.go b/example/counter/counter.go index 663abcab0..90be6d92b 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -4,7 +4,7 @@ import ( "encoding/binary" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type CounterApplication struct { diff --git a/example/dummy/README.md b/example/dummy/README.md index 19f82fda6..8c1f0f042 100644 --- a/example/dummy/README.md +++ b/example/dummy/README.md @@ -14,7 +14,7 @@ The app has no replay protection (other than what the mempool provides). The PersistentDummyApplication wraps the DummyApplication and provides two additional features: -1) persistence of state across app restarts (using Tendermint's TMSP-Handshake mechanism) +1) persistence of state across app restarts (using Tendermint's ABCI-Handshake mechanism) 2) validator set changes The state is persisted in leveldb along with the last block committed, diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 7e0be585c..648ef07e3 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -7,7 +7,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type DummyApplication struct { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 2f486aa5f..d22943472 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -9,7 +9,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { @@ -49,7 +49,7 @@ func TestDummyKV(t *testing.T) { } func TestPersistentDummyKV(t *testing.T) { - dir, err := ioutil.TempDir("/tmp", "tmsp-dummy-test") // TODO + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO if err != nil { t.Fatal(err) } @@ -65,7 +65,7 @@ func TestPersistentDummyKV(t *testing.T) { } func TestPersistentDummyInfo(t *testing.T) { - dir, err := ioutil.TempDir("/tmp", "tmsp-dummy-test") // TODO + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO if err != nil { t.Fatal(err) } @@ -96,7 +96,7 @@ func TestPersistentDummyInfo(t *testing.T) { // add a validator, remove a validator, update a validator func TestValSetChanges(t *testing.T) { - dir, err := ioutil.TempDir("/tmp", "tmsp-dummy-test") // TODO + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO if err != nil { t.Fatal(err) } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index f4dbc6ee1..fa730bcb5 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -10,7 +10,7 @@ import ( dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) const ( diff --git a/example/example_test.go b/example/example_test.go index 6ff334d3f..1ddefddb5 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -11,11 +11,11 @@ import ( "google.golang.org/grpc" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/example/dummy" - nilapp "github.com/tendermint/tmsp/example/nil" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/dummy" + nilapp "github.com/tendermint/abci/example/nil" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func TestDummy(t *testing.T) { @@ -45,7 +45,7 @@ func testStream(t *testing.T, app types.Application) { defer server.Stop() // Connect to the socket - client, err := tmspcli.NewSocketClient("unix://test.sock", false) + client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { Exit(Fmt("Error starting socket client: %v", err.Error())) } @@ -124,7 +124,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { } defer conn.Close() - client := types.NewTMSPApplicationClient(conn) + client := types.NewABCIApplicationClient(conn) // Write requests for counter := 0; counter < numDeliverTxs; counter++ { diff --git a/example/js/README.md b/example/js/README.md index f18755065..1bef9cbf5 100644 --- a/example/js/README.md +++ b/example/js/README.md @@ -1 +1 @@ -This example has been moved here: https://github.com/tendermint/js-tmsp/tree/master/example +This example has been moved here: https://github.com/tendermint/js-abci/tree/master/example diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 928395bc0..cd57f0d98 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -1,7 +1,7 @@ package nilapp import ( - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type NilApplication struct { diff --git a/example/python/tmsp/__init__.py b/example/python/abci/__init__.py similarity index 100% rename from example/python/tmsp/__init__.py rename to example/python/abci/__init__.py diff --git a/example/python/tmsp/msg.py b/example/python/abci/msg.py similarity index 94% rename from example/python/tmsp/msg.py rename to example/python/abci/msg.py index fcb85c1f1..7329f5852 100644 --- a/example/python/tmsp/msg.py +++ b/example/python/abci/msg.py @@ -13,7 +13,7 @@ message_types = { 0x25: "rm_listener", } -# return the decoded arguments of tmsp messages +# return the decoded arguments of abci messages class RequestDecoder(): diff --git a/example/python/tmsp/reader.py b/example/python/abci/reader.py similarity index 100% rename from example/python/tmsp/reader.py rename to example/python/abci/reader.py diff --git a/example/python/tmsp/server.py b/example/python/abci/server.py similarity index 98% rename from example/python/tmsp/server.py rename to example/python/abci/server.py index 60f76e3af..40d50896c 100644 --- a/example/python/tmsp/server.py +++ b/example/python/abci/server.py @@ -26,9 +26,9 @@ class Connection(): raise IOError("dead connection") this.recBuf.write(data) -# TMSP server responds to messges by calling methods on the app +# ABCI server responds to messges by calling methods on the app -class TMSPServer(): +class ABCIServer(): def __init__(self, app, port=5410): self.app = app diff --git a/example/python/tmsp/wire.py b/example/python/abci/wire.py similarity index 100% rename from example/python/tmsp/wire.py rename to example/python/abci/wire.py diff --git a/example/python/app.py b/example/python/app.py index 335188fa5..a44ff3455 100644 --- a/example/python/app.py +++ b/example/python/app.py @@ -1,8 +1,8 @@ import sys -from tmsp.wire import hex2bytes, decode_big_endian, encode_big_endian -from tmsp.server import TMSPServer -from tmsp.reader import BytesBuffer +from abci.wire import hex2bytes, decode_big_endian, encode_big_endian +from abci.server import ABCIServer +from abci.reader import BytesBuffer class CounterApplication(): @@ -75,8 +75,8 @@ if __name__ == '__main__': print "too many arguments" quit() - print 'TMSP Demo APP (Python)' + print 'ABCI Demo APP (Python)' app = CounterApplication() - server = TMSPServer(app, port) + server = ABCIServer(app, port) server.main_loop() diff --git a/example/python3/tmsp/__init__.py b/example/python3/abci/__init__.py similarity index 100% rename from example/python3/tmsp/__init__.py rename to example/python3/abci/__init__.py diff --git a/example/python3/tmsp/msg.py b/example/python3/abci/msg.py similarity index 94% rename from example/python3/tmsp/msg.py rename to example/python3/abci/msg.py index e8d69db96..807c4b6b0 100644 --- a/example/python3/tmsp/msg.py +++ b/example/python3/abci/msg.py @@ -13,7 +13,7 @@ message_types = { 0x25: "rm_listener", } -# return the decoded arguments of tmsp messages +# return the decoded arguments of abci messages class RequestDecoder(): diff --git a/example/python3/tmsp/reader.py b/example/python3/abci/reader.py similarity index 100% rename from example/python3/tmsp/reader.py rename to example/python3/abci/reader.py diff --git a/example/python3/tmsp/server.py b/example/python3/abci/server.py similarity index 98% rename from example/python3/tmsp/server.py rename to example/python3/abci/server.py index 03735bb37..04063262d 100644 --- a/example/python3/tmsp/server.py +++ b/example/python3/abci/server.py @@ -29,9 +29,9 @@ class Connection(): raise IOError("dead connection") this.recBuf.write(data) -# TMSP server responds to messges by calling methods on the app +# ABCI server responds to messges by calling methods on the app -class TMSPServer(): +class ABCIServer(): def __init__(self, app, port=5410): self.app = app diff --git a/example/python3/tmsp/wire.py b/example/python3/abci/wire.py similarity index 100% rename from example/python3/tmsp/wire.py rename to example/python3/abci/wire.py diff --git a/example/python3/app.py b/example/python3/app.py index a0b727b74..b40041a43 100644 --- a/example/python3/app.py +++ b/example/python3/app.py @@ -1,8 +1,8 @@ import sys -from tmsp.wire import hex2bytes, decode_big_endian, encode_big_endian -from tmsp.server import TMSPServer -from tmsp.reader import BytesBuffer +from abci.wire import hex2bytes, decode_big_endian, encode_big_endian +from abci.server import ABCIServer +from abci.reader import BytesBuffer class CounterApplication(): @@ -75,8 +75,8 @@ if __name__ == '__main__': print("too many arguments") quit() - print('TMSP Demo APP (Python)') + print('ABCI Demo APP (Python)') app = CounterApplication() - server = TMSPServer(app, port) + server = ABCIServer(app, port) server.main_loop() diff --git a/glide.yaml b/glide.yaml index 440d47cc0..fae5a9841 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/tendermint/tmsp +package: github.com/tendermint/abci import: - package: github.com/golang/protobuf subpackages: diff --git a/server/grpc_server.go b/server/grpc_server.go index 472da25dd..1acd45a36 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // var maxNumberConnections = 2 @@ -20,10 +20,10 @@ type GRPCServer struct { listener net.Listener server *grpc.Server - app types.TMSPApplicationServer + app types.ABCIApplicationServer } -func NewGRPCServer(protoAddr string, app types.TMSPApplicationServer) (Service, error) { +func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (Service, error) { parts := strings.SplitN(protoAddr, "://", 2) proto, addr := parts[0], parts[1] s := &GRPCServer{ @@ -32,7 +32,7 @@ func NewGRPCServer(protoAddr string, app types.TMSPApplicationServer) (Service, listener: nil, app: app, } - s.BaseService = *NewBaseService(nil, "TMSPServer", s) + s.BaseService = *NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } @@ -45,7 +45,7 @@ func (s *GRPCServer) OnStart() error { } s.listener = ln s.server = grpc.NewServer() - types.RegisterTMSPApplicationServer(s.server, s.app) + types.RegisterABCIApplicationServer(s.server, s.app) go s.server.Serve(s.listener) return nil } diff --git a/server/log.go b/server/log.go index 8ac4092e7..4b313d25f 100644 --- a/server/log.go +++ b/server/log.go @@ -4,4 +4,4 @@ import ( "github.com/tendermint/go-logger" ) -var log = logger.New("module", "tmsp-server") +var log = logger.New("module", "abci-server") diff --git a/server/server.go b/server/server.go index f2b9d0af4..496767470 100644 --- a/server/server.go +++ b/server/server.go @@ -4,7 +4,7 @@ import ( "fmt" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func NewServer(protoAddr, transport string, app types.Application) (Service, error) { diff --git a/server/socket_server.go b/server/socket_server.go index 2be3bbb5c..bd26a18a8 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -9,7 +9,7 @@ import ( "sync" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // var maxNumberConnections = 2 @@ -39,7 +39,7 @@ func NewSocketServer(protoAddr string, app types.Application) (Service, error) { app: app, conns: make(map[int]net.Conn), } - s.BaseService = *NewBaseService(nil, "TMSPServer", s) + s.BaseService = *NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index db57e19bf..5960d529a 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -6,7 +6,7 @@ import ( //"encoding/hex" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func main() { diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index 585ebd2b5..fb536730c 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -9,7 +9,7 @@ import ( //"encoding/hex" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func main() { diff --git a/tests/test_app/app.go b/tests/test_app/app.go index b38d07373..59d5b0e70 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -7,24 +7,24 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-process" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/types" ) //---------------------------------------- -func StartApp(tmspApp string) *process.Process { +func StartApp(abciApp string) *process.Process { // Start the app //outBuf := NewBufferCloser(nil) - proc, err := process.StartProcess("tmsp_app", + proc, err := process.StartProcess("abci_app", "", "bash", - []string{"-c", tmspApp}, + []string{"-c", abciApp}, nil, os.Stdout, ) if err != nil { - panic("running tmsp_app: " + err.Error()) + panic("running abci_app: " + err.Error()) } // TODO a better way to handle this? @@ -33,16 +33,16 @@ func StartApp(tmspApp string) *process.Process { return proc } -func StartClient(tmspType string) tmspcli.Client { +func StartClient(abciType string) abcicli.Client { // Start client - client, err := tmspcli.NewClient("tcp://127.0.0.1:46658", tmspType, true) + client, err := abcicli.NewClient("tcp://127.0.0.1:46658", abciType, true) if err != nil { - panic("connecting to tmsp_app: " + err.Error()) + panic("connecting to abci_app: " + err.Error()) } return client } -func SetOption(client tmspcli.Client, key, value string) { +func SetOption(client abcicli.Client, key, value string) { res := client.SetOptionSync(key, value) _, _, log := res.Code, res.Data, res.Log if res.IsErr() { @@ -50,7 +50,7 @@ func SetOption(client tmspcli.Client, key, value string) { } } -func Commit(client tmspcli.Client, hashExp []byte) { +func Commit(client abcicli.Client, hashExp []byte) { res := client.CommitSync() _, data, log := res.Code, res.Data, res.Log if res.IsErr() { @@ -62,7 +62,7 @@ func Commit(client tmspcli.Client, hashExp []byte) { } } -func DeliverTx(client tmspcli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { res := client.DeliverTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if code != codeExp { @@ -75,7 +75,7 @@ func DeliverTx(client tmspcli.Client, txBytes []byte, codeExp types.CodeType, da } } -func CheckTx(client tmspcli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { res := client.CheckTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if res.IsErr() { diff --git a/tests/test_app/main.go b/tests/test_app/main.go index db627a3e9..05f66b07f 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -4,15 +4,15 @@ import ( "fmt" "os" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) -var tmspType string +var abciType string func init() { - tmspType = os.Getenv("TMSP") - if tmspType == "" { - tmspType = "socket" + abciType = os.Getenv("ABCI") + if abciType == "" { + abciType = "socket" } } @@ -21,15 +21,15 @@ func main() { } func testCounter() { - tmspApp := os.Getenv("TMSP_APP") - if tmspApp == "" { - panic("No TMSP_APP specified") + abciApp := os.Getenv("ABCI_APP") + if abciApp == "" { + panic("No ABCI_APP specified") } - fmt.Printf("Running %s test with tmsp=%s\n", tmspApp, tmspType) - appProc := StartApp(tmspApp) + fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType) + appProc := StartApp(abciApp) defer appProc.StopProcess(true) - client := StartClient(tmspType) + client := StartClient(abciType) defer client.Stop() SetOption(client, "serial", "on") diff --git a/tests/test_app/test.sh b/tests/test_app/test.sh index 4c28a831b..a0f2c3ce6 100755 --- a/tests/test_app/test.sh +++ b/tests/test_app/test.sh @@ -1,17 +1,17 @@ #! /bin/bash set -e -# These tests spawn the counter app and server by execing the TMSP_APP command and run some simple client tests against it +# These tests spawn the counter app and server by execing the ABCI_APP command and run some simple client tests against it -ROOT=$GOPATH/src/github.com/tendermint/tmsp/tests/test_app +ROOT=$GOPATH/src/github.com/tendermint/abci/tests/test_app cd $ROOT # test golang counter -TMSP_APP="counter" go run *.go +ABCI_APP="counter" go run *.go # test golang counter via grpc -TMSP_APP="counter -tmsp=grpc" TMSP="grpc" go run *.go +ABCI_APP="counter -abci=grpc" ABCI="grpc" go run *.go # test nodejs counter # TODO: fix node app -#TMSP_APP="node $GOPATH/src/github.com/tendermint/js-tmsp/example/app.js" go test -test.run TestCounter +#ABCI_APP="node $GOPATH/src/github.com/tendermint/js-abci/example/app.js" go test -test.run TestCounter diff --git a/tests/test_cli/ex1.tmsp b/tests/test_cli/ex1.abci similarity index 100% rename from tests/test_cli/ex1.tmsp rename to tests/test_cli/ex1.abci diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.abci.out similarity index 100% rename from tests/test_cli/ex1.tmsp.out rename to tests/test_cli/ex1.abci.out diff --git a/tests/test_cli/ex2.tmsp b/tests/test_cli/ex2.abci similarity index 100% rename from tests/test_cli/ex2.tmsp rename to tests/test_cli/ex2.abci diff --git a/tests/test_cli/ex2.tmsp.out b/tests/test_cli/ex2.abci.out similarity index 100% rename from tests/test_cli/ex2.tmsp.out rename to tests/test_cli/ex2.abci.out diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh index 00446c45d..a770730be 100644 --- a/tests/test_cli/test.sh +++ b/tests/test_cli/test.sh @@ -1,5 +1,7 @@ #! /bin/bash +cd $GOPATH/src/github.com/tendermint/abci + function testExample() { N=$1 INPUT=$2 @@ -8,7 +10,7 @@ function testExample() { echo "Example $N" $APP &> /dev/null & sleep 2 - tmsp-cli --verbose batch < $INPUT > "${INPUT}.out.new" + abci-cli --verbose batch < $INPUT > "${INPUT}.out.new" killall "$APP" pre=`shasum < "${INPUT}.out"` @@ -26,8 +28,8 @@ function testExample() { rm "${INPUT}".out.new } -testExample 1 tests/test_cli/ex1.tmsp dummy -testExample 2 tests/test_cli/ex2.tmsp counter +testExample 1 tests/test_cli/ex1.abci dummy +testExample 2 tests/test_cli/ex2.abci counter echo "" echo "PASS" diff --git a/testutil/messages.go b/testutil/messages.go index 2890fbd5f..1036e48e4 100644 --- a/testutil/messages.go +++ b/testutil/messages.go @@ -2,7 +2,7 @@ package testutil import ( "github.com/tendermint/go-crypto" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) //---------------------------------------- diff --git a/types/result.go b/types/result.go index 717ae2fa0..571c5bf8b 100644 --- a/types/result.go +++ b/types/result.go @@ -28,7 +28,7 @@ func (res Result) IsErr() bool { } func (res Result) Error() string { - return fmt.Sprintf("TMSP code:%v, data:%X, log:%v", res.Code, res.Data, res.Log) + return fmt.Sprintf("ABCI code:%v, data:%X, log:%v", res.Code, res.Data, res.Log) } func (res Result) PrependLog(log string) Result { diff --git a/types/types.pb.go b/types/types.pb.go index 2c279bd20..40c3441b8 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1676,9 +1676,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for TMSPApplication service +// Client API for ABCIApplication service -type TMSPApplicationClient interface { +type ABCIApplicationClient interface { Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) @@ -1696,13 +1696,13 @@ type tMSPApplicationClient struct { cc *grpc.ClientConn } -func NewTMSPApplicationClient(cc *grpc.ClientConn) TMSPApplicationClient { +func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient { return &tMSPApplicationClient{cc} } func (c *tMSPApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) { out := new(ResponseEcho) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Echo", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Echo", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1711,7 +1711,7 @@ func (c *tMSPApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts func (c *tMSPApplicationClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) { out := new(ResponseFlush) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Flush", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Flush", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1720,7 +1720,7 @@ func (c *tMSPApplicationClient) Flush(ctx context.Context, in *RequestFlush, opt func (c *tMSPApplicationClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) { out := new(ResponseInfo) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Info", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Info", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1729,7 +1729,7 @@ func (c *tMSPApplicationClient) Info(ctx context.Context, in *RequestInfo, opts func (c *tMSPApplicationClient) SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) { out := new(ResponseSetOption) - err := grpc.Invoke(ctx, "/types.TMSPApplication/SetOption", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/SetOption", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1738,7 +1738,7 @@ func (c *tMSPApplicationClient) SetOption(ctx context.Context, in *RequestSetOpt func (c *tMSPApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) { out := new(ResponseDeliverTx) - err := grpc.Invoke(ctx, "/types.TMSPApplication/DeliverTx", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/DeliverTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1747,7 +1747,7 @@ func (c *tMSPApplicationClient) DeliverTx(ctx context.Context, in *RequestDelive func (c *tMSPApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { out := new(ResponseCheckTx) - err := grpc.Invoke(ctx, "/types.TMSPApplication/CheckTx", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/CheckTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1756,7 +1756,7 @@ func (c *tMSPApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, func (c *tMSPApplicationClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) { out := new(ResponseQuery) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Query", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Query", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1765,7 +1765,7 @@ func (c *tMSPApplicationClient) Query(ctx context.Context, in *RequestQuery, opt func (c *tMSPApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { out := new(ResponseCommit) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Commit", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1774,7 +1774,7 @@ func (c *tMSPApplicationClient) Commit(ctx context.Context, in *RequestCommit, o func (c *tMSPApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { out := new(ResponseInitChain) - err := grpc.Invoke(ctx, "/types.TMSPApplication/InitChain", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/InitChain", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1783,7 +1783,7 @@ func (c *tMSPApplicationClient) InitChain(ctx context.Context, in *RequestInitCh func (c *tMSPApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) { out := new(ResponseBeginBlock) - err := grpc.Invoke(ctx, "/types.TMSPApplication/BeginBlock", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/BeginBlock", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1792,16 +1792,16 @@ func (c *tMSPApplicationClient) BeginBlock(ctx context.Context, in *RequestBegin func (c *tMSPApplicationClient) EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { out := new(ResponseEndBlock) - err := grpc.Invoke(ctx, "/types.TMSPApplication/EndBlock", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/EndBlock", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// Server API for TMSPApplication service +// Server API for ABCIApplication service -type TMSPApplicationServer interface { +type ABCIApplicationServer interface { Echo(context.Context, *RequestEcho) (*ResponseEcho, error) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) Info(context.Context, *RequestInfo) (*ResponseInfo, error) @@ -1815,255 +1815,255 @@ type TMSPApplicationServer interface { EndBlock(context.Context, *RequestEndBlock) (*ResponseEndBlock, error) } -func RegisterTMSPApplicationServer(s *grpc.Server, srv TMSPApplicationServer) { - s.RegisterService(&_TMSPApplication_serviceDesc, srv) +func RegisterABCIApplicationServer(s *grpc.Server, srv ABCIApplicationServer) { + s.RegisterService(&_ABCIApplication_serviceDesc, srv) } -func _TMSPApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestEcho) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Echo(ctx, in) + return srv.(ABCIApplicationServer).Echo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Echo", + FullMethod: "/types.ABCIApplication/Echo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Echo(ctx, req.(*RequestEcho)) + return srv.(ABCIApplicationServer).Echo(ctx, req.(*RequestEcho)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestFlush) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Flush(ctx, in) + return srv.(ABCIApplicationServer).Flush(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Flush", + FullMethod: "/types.ABCIApplication/Flush", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Flush(ctx, req.(*RequestFlush)) + return srv.(ABCIApplicationServer).Flush(ctx, req.(*RequestFlush)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Info(ctx, in) + return srv.(ABCIApplicationServer).Info(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Info", + FullMethod: "/types.ABCIApplication/Info", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Info(ctx, req.(*RequestInfo)) + return srv.(ABCIApplicationServer).Info(ctx, req.(*RequestInfo)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_SetOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_SetOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestSetOption) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).SetOption(ctx, in) + return srv.(ABCIApplicationServer).SetOption(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/SetOption", + FullMethod: "/types.ABCIApplication/SetOption", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).SetOption(ctx, req.(*RequestSetOption)) + return srv.(ABCIApplicationServer).SetOption(ctx, req.(*RequestSetOption)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestDeliverTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).DeliverTx(ctx, in) + return srv.(ABCIApplicationServer).DeliverTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/DeliverTx", + FullMethod: "/types.ABCIApplication/DeliverTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx)) + return srv.(ABCIApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestCheckTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).CheckTx(ctx, in) + return srv.(ABCIApplicationServer).CheckTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/CheckTx", + FullMethod: "/types.ABCIApplication/CheckTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).CheckTx(ctx, req.(*RequestCheckTx)) + return srv.(ABCIApplicationServer).CheckTx(ctx, req.(*RequestCheckTx)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestQuery) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Query(ctx, in) + return srv.(ABCIApplicationServer).Query(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Query", + FullMethod: "/types.ABCIApplication/Query", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Query(ctx, req.(*RequestQuery)) + return srv.(ABCIApplicationServer).Query(ctx, req.(*RequestQuery)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestCommit) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Commit(ctx, in) + return srv.(ABCIApplicationServer).Commit(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Commit", + FullMethod: "/types.ABCIApplication/Commit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Commit(ctx, req.(*RequestCommit)) + return srv.(ABCIApplicationServer).Commit(ctx, req.(*RequestCommit)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestInitChain) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).InitChain(ctx, in) + return srv.(ABCIApplicationServer).InitChain(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/InitChain", + FullMethod: "/types.ABCIApplication/InitChain", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).InitChain(ctx, req.(*RequestInitChain)) + return srv.(ABCIApplicationServer).InitChain(ctx, req.(*RequestInitChain)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestBeginBlock) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).BeginBlock(ctx, in) + return srv.(ABCIApplicationServer).BeginBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/BeginBlock", + FullMethod: "/types.ABCIApplication/BeginBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock)) + return srv.(ABCIApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestEndBlock) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).EndBlock(ctx, in) + return srv.(ABCIApplicationServer).EndBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/EndBlock", + FullMethod: "/types.ABCIApplication/EndBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).EndBlock(ctx, req.(*RequestEndBlock)) + return srv.(ABCIApplicationServer).EndBlock(ctx, req.(*RequestEndBlock)) } return interceptor(ctx, in, info, handler) } -var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ - ServiceName: "types.TMSPApplication", - HandlerType: (*TMSPApplicationServer)(nil), +var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ + ServiceName: "types.ABCIApplication", + HandlerType: (*ABCIApplicationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", - Handler: _TMSPApplication_Echo_Handler, + Handler: _ABCIApplication_Echo_Handler, }, { MethodName: "Flush", - Handler: _TMSPApplication_Flush_Handler, + Handler: _ABCIApplication_Flush_Handler, }, { MethodName: "Info", - Handler: _TMSPApplication_Info_Handler, + Handler: _ABCIApplication_Info_Handler, }, { MethodName: "SetOption", - Handler: _TMSPApplication_SetOption_Handler, + Handler: _ABCIApplication_SetOption_Handler, }, { MethodName: "DeliverTx", - Handler: _TMSPApplication_DeliverTx_Handler, + Handler: _ABCIApplication_DeliverTx_Handler, }, { MethodName: "CheckTx", - Handler: _TMSPApplication_CheckTx_Handler, + Handler: _ABCIApplication_CheckTx_Handler, }, { MethodName: "Query", - Handler: _TMSPApplication_Query_Handler, + Handler: _ABCIApplication_Query_Handler, }, { MethodName: "Commit", - Handler: _TMSPApplication_Commit_Handler, + Handler: _ABCIApplication_Commit_Handler, }, { MethodName: "InitChain", - Handler: _TMSPApplication_InitChain_Handler, + Handler: _ABCIApplication_InitChain_Handler, }, { MethodName: "BeginBlock", - Handler: _TMSPApplication_BeginBlock_Handler, + Handler: _ABCIApplication_BeginBlock_Handler, }, { MethodName: "EndBlock", - Handler: _TMSPApplication_EndBlock_Handler, + Handler: _ABCIApplication_EndBlock_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/types/types.proto b/types/types.proto index 34e5450b8..b3ff1655e 100644 --- a/types/types.proto +++ b/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package types; -// This file is copied from http://github.com/tendermint/tmsp +// This file is copied from http://github.com/tendermint/abci //---------------------------------------- // Message types @@ -243,7 +243,7 @@ message Validator { //---------------------------------------- // Service Definition -service TMSPApplication { +service ABCIApplication { rpc Echo(RequestEcho) returns (ResponseEcho) ; rpc Flush(RequestFlush) returns (ResponseFlush); rpc Info(RequestInfo) returns (ResponseInfo);