From cc6dde96c12dddafe23173ad195034f3d4884423 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 26 Apr 2017 19:57:33 -0400 Subject: [PATCH] rpc -> rpc/lib and rpc/tendermint -> rpc --- benchmarks/codec_test.go | 2 +- benchmarks/simu/counter.go | 6 +++--- node/node.go | 8 ++++---- rpc/Dockerfile | 12 ------------ rpc/{tendermint => }/client/event_test.go | 2 +- rpc/{tendermint => }/client/helpers.go | 0 rpc/{tendermint => }/client/helpers_test.go | 6 +++--- rpc/{tendermint => }/client/httpclient.go | 4 ++-- rpc/{tendermint => }/client/interface.go | 2 +- rpc/{tendermint => }/client/localclient.go | 4 ++-- rpc/{tendermint => }/client/main_test.go | 2 +- rpc/{tendermint => }/client/mock/abci.go | 4 ++-- rpc/{tendermint => }/client/mock/abci_test.go | 4 ++-- rpc/{tendermint => }/client/mock/client.go | 6 +++--- rpc/{tendermint => }/client/mock/status.go | 4 ++-- rpc/{tendermint => }/client/mock/status_test.go | 4 ++-- rpc/{tendermint => }/client/rpc_test.go | 4 ++-- rpc/{tendermint => }/core/abci.go | 2 +- rpc/{tendermint => }/core/blocks.go | 2 +- rpc/{tendermint => }/core/consensus.go | 2 +- rpc/{tendermint => }/core/dev.go | 2 +- rpc/{tendermint => }/core/events.go | 4 ++-- rpc/{tendermint => }/core/log.go | 0 rpc/{tendermint => }/core/mempool.go | 2 +- rpc/{tendermint => }/core/net.go | 2 +- rpc/{tendermint => }/core/pipe.go | 0 rpc/{tendermint => }/core/routes.go | 6 +++--- rpc/{tendermint => }/core/status.go | 2 +- rpc/{tendermint => }/core/tx.go | 2 +- rpc/{tendermint => }/core/types/responses.go | 2 +- rpc/{tendermint => }/core/types/responses_test.go | 0 rpc/{tendermint => }/core/version.go | 0 rpc/{tendermint => }/grpc/api.go | 2 +- rpc/{tendermint => }/grpc/client_server.go | 0 rpc/{tendermint => }/grpc/compile.sh | 0 rpc/{tendermint => }/grpc/types.pb.go | 0 rpc/{tendermint => }/grpc/types.proto | 0 rpc/lib/Dockerfile | 12 ++++++++++++ rpc/{ => lib}/Makefile | 0 rpc/{ => lib}/README.md | 4 ++-- rpc/{ => lib}/circle.yml | 0 rpc/{ => lib}/client/args_test.go | 0 rpc/{ => lib}/client/http_client.go | 4 ++-- rpc/{ => lib}/client/log.go | 0 rpc/{ => lib}/client/ws_client.go | 2 +- rpc/{ => lib}/rpc_test.go | 6 +++--- rpc/{ => lib}/server/handlers.go | 2 +- rpc/{ => lib}/server/http_params.go | 0 rpc/{ => lib}/server/http_server.go | 4 ++-- rpc/{ => lib}/server/log.go | 0 rpc/{ => lib}/test/data.json | 0 rpc/{ => lib}/test/integration_test.sh | 0 rpc/{ => lib}/test/main.go | 2 +- rpc/{ => lib}/types/types.go | 0 rpc/{ => lib}/version.go | 0 rpc/{tendermint => }/test/client_test.go | 6 +++--- rpc/{tendermint => }/test/grpc_test.go | 2 +- rpc/{tendermint => }/test/helpers.go | 6 +++--- rpc/{tendermint => }/test/main_test.go | 0 test/app/grpc_client.go | 2 +- 60 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 rpc/Dockerfile rename rpc/{tendermint => }/client/event_test.go (96%) rename rpc/{tendermint => }/client/helpers.go (100%) rename rpc/{tendermint => }/client/helpers_test.go (90%) rename rpc/{tendermint => }/client/httpclient.go (98%) rename rpc/{tendermint => }/client/interface.go (97%) rename rpc/{tendermint => }/client/localclient.go (95%) rename rpc/{tendermint => }/client/main_test.go (87%) rename rpc/{tendermint => }/client/mock/abci.go (97%) rename rpc/{tendermint => }/client/mock/abci_test.go (97%) rename rpc/{tendermint => }/client/mock/client.go (95%) rename rpc/{tendermint => }/client/mock/status.go (89%) rename rpc/{tendermint => }/client/mock/status_test.go (88%) rename rpc/{tendermint => }/client/rpc_test.go (97%) rename rpc/{tendermint => }/core/abci.go (91%) rename rpc/{tendermint => }/core/blocks.go (96%) rename rpc/{tendermint => }/core/consensus.go (92%) rename rpc/{tendermint => }/core/dev.go (95%) rename rpc/{tendermint => }/core/events.go (89%) rename rpc/{tendermint => }/core/log.go (100%) rename rpc/{tendermint => }/core/mempool.go (98%) rename rpc/{tendermint => }/core/net.go (95%) rename rpc/{tendermint => }/core/pipe.go (100%) rename rpc/{tendermint => }/core/routes.go (96%) rename rpc/{tendermint => }/core/status.go (92%) rename rpc/{tendermint => }/core/tx.go (91%) rename rpc/{tendermint => }/core/types/responses.go (99%) rename rpc/{tendermint => }/core/types/responses_test.go (100%) rename rpc/{tendermint => }/core/version.go (100%) rename rpc/{tendermint => }/grpc/api.go (85%) rename rpc/{tendermint => }/grpc/client_server.go (100%) rename rpc/{tendermint => }/grpc/compile.sh (100%) rename rpc/{tendermint => }/grpc/types.pb.go (100%) rename rpc/{tendermint => }/grpc/types.proto (100%) create mode 100644 rpc/lib/Dockerfile rename rpc/{ => lib}/Makefile (100%) rename rpc/{ => lib}/README.md (95%) rename rpc/{ => lib}/circle.yml (100%) rename rpc/{ => lib}/client/args_test.go (100%) rename rpc/{ => lib}/client/http_client.go (96%) rename rpc/{ => lib}/client/log.go (100%) rename rpc/{ => lib}/client/ws_client.go (98%) rename rpc/{ => lib}/rpc_test.go (97%) rename rpc/{ => lib}/server/handlers.go (99%) rename rpc/{ => lib}/server/http_params.go (100%) rename rpc/{ => lib}/server/http_server.go (95%) rename rpc/{ => lib}/server/log.go (100%) rename rpc/{ => lib}/test/data.json (100%) rename rpc/{ => lib}/test/integration_test.sh (100%) rename rpc/{ => lib}/test/main.go (90%) rename rpc/{ => lib}/types/types.go (100%) rename rpc/{ => lib}/version.go (100%) rename rpc/{tendermint => }/test/client_test.go (98%) rename rpc/{tendermint => }/test/grpc_test.go (88%) rename rpc/{tendermint => }/test/helpers.go (96%) rename rpc/{tendermint => }/test/main_test.go (100%) diff --git a/benchmarks/codec_test.go b/benchmarks/codec_test.go index 205aec403..7162e63d0 100644 --- a/benchmarks/codec_test.go +++ b/benchmarks/codec_test.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/tendermint/p2p" "github.com/tendermint/go-wire" proto "github.com/tendermint/tendermint/benchmarks/proto" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" ) func BenchmarkEncodeStatusWire(b *testing.B) { diff --git a/benchmarks/simu/counter.go b/benchmarks/simu/counter.go index f384d3579..a22162b97 100644 --- a/benchmarks/simu/counter.go +++ b/benchmarks/simu/counter.go @@ -8,10 +8,10 @@ import ( "github.com/gorilla/websocket" . "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tendermint/rpc/client" - "github.com/tendermint/tendermint/rpc/types" + "github.com/tendermint/tendermint/rpc/lib/client" + "github.com/tendermint/tendermint/rpc/lib/types" "github.com/tendermint/go-wire" - _ "github.com/tendermint/tendermint/rpc/tendermint/core/types" // Register RPCResponse > Result types + _ "github.com/tendermint/tendermint/rpc/core/types" // Register RPCResponse > Result types ) func main() { diff --git a/node/node.go b/node/node.go index 1c66c00e0..e34f8c726 100644 --- a/node/node.go +++ b/node/node.go @@ -17,10 +17,10 @@ import ( mempl "github.com/tendermint/tendermint/mempool" p2p "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/proxy" - rpc "github.com/tendermint/tendermint/rpc" - rpcserver "github.com/tendermint/tendermint/rpc/server" - rpccore "github.com/tendermint/tendermint/rpc/tendermint/core" - grpccore "github.com/tendermint/tendermint/rpc/tendermint/grpc" + rpccore "github.com/tendermint/tendermint/rpc/core" + grpccore "github.com/tendermint/tendermint/rpc/grpc" + rpc "github.com/tendermint/tendermint/rpc/lib" + rpcserver "github.com/tendermint/tendermint/rpc/lib/server" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/state/txindex" "github.com/tendermint/tendermint/state/txindex/kv" diff --git a/rpc/Dockerfile b/rpc/Dockerfile deleted file mode 100644 index c22412672..000000000 --- a/rpc/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM golang:latest - -RUN mkdir -p /go/src/github.com/tendermint/tendermint/rpc -WORKDIR /go/src/github.com/tendermint/tendermint/rpc - -COPY Makefile /go/src/github.com/tendermint/tendermint/rpc/ -# COPY glide.yaml /go/src/github.com/tendermint/tendermint/rpc/ -# COPY glide.lock /go/src/github.com/tendermint/tendermint/rpc/ - -COPY . /go/src/github.com/tendermint/tendermint/rpc - -RUN make get_deps diff --git a/rpc/tendermint/client/event_test.go b/rpc/client/event_test.go similarity index 96% rename from rpc/tendermint/client/event_test.go rename to rpc/client/event_test.go index a82a284f6..cc421ad90 100644 --- a/rpc/tendermint/client/event_test.go +++ b/rpc/client/event_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" merktest "github.com/tendermint/merkleeyes/testutil" - "github.com/tendermint/tendermint/rpc/tendermint/client" + "github.com/tendermint/tendermint/rpc/client" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/client/helpers.go b/rpc/client/helpers.go similarity index 100% rename from rpc/tendermint/client/helpers.go rename to rpc/client/helpers.go diff --git a/rpc/tendermint/client/helpers_test.go b/rpc/client/helpers_test.go similarity index 90% rename from rpc/tendermint/client/helpers_test.go rename to rpc/client/helpers_test.go index 1057a21bd..fe1861224 100644 --- a/rpc/tendermint/client/helpers_test.go +++ b/rpc/client/helpers_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/rpc/tendermint/client" - "github.com/tendermint/tendermint/rpc/tendermint/client/mock" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + "github.com/tendermint/tendermint/rpc/client" + "github.com/tendermint/tendermint/rpc/client/mock" + ctypes "github.com/tendermint/tendermint/rpc/core/types" ) func TestWaitForHeight(t *testing.T) { diff --git a/rpc/tendermint/client/httpclient.go b/rpc/client/httpclient.go similarity index 98% rename from rpc/tendermint/client/httpclient.go rename to rpc/client/httpclient.go index e8f404d22..8f3a4f019 100644 --- a/rpc/tendermint/client/httpclient.go +++ b/rpc/client/httpclient.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" data "github.com/tendermint/go-wire/data" events "github.com/tendermint/tmlibs/events" - "github.com/tendermint/tendermint/rpc/client" + "github.com/tendermint/tendermint/rpc/lib/client" wire "github.com/tendermint/go-wire" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/client/interface.go b/rpc/client/interface.go similarity index 97% rename from rpc/tendermint/client/interface.go rename to rpc/client/interface.go index 4726e00d9..0cd0f29bb 100644 --- a/rpc/tendermint/client/interface.go +++ b/rpc/client/interface.go @@ -21,7 +21,7 @@ package client import ( data "github.com/tendermint/go-wire/data" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/client/localclient.go b/rpc/client/localclient.go similarity index 95% rename from rpc/tendermint/client/localclient.go rename to rpc/client/localclient.go index 146d96597..f4eb00d78 100644 --- a/rpc/tendermint/client/localclient.go +++ b/rpc/client/localclient.go @@ -3,8 +3,8 @@ package client import ( data "github.com/tendermint/go-wire/data" nm "github.com/tendermint/tendermint/node" - "github.com/tendermint/tendermint/rpc/tendermint/core" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + "github.com/tendermint/tendermint/rpc/core" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/client/main_test.go b/rpc/client/main_test.go similarity index 87% rename from rpc/tendermint/client/main_test.go rename to rpc/client/main_test.go index 494b565ae..5ec911e5d 100644 --- a/rpc/tendermint/client/main_test.go +++ b/rpc/client/main_test.go @@ -6,7 +6,7 @@ import ( meapp "github.com/tendermint/merkleeyes/app" nm "github.com/tendermint/tendermint/node" - rpctest "github.com/tendermint/tendermint/rpc/tendermint/test" + rpctest "github.com/tendermint/tendermint/rpc/test" ) var node *nm.Node diff --git a/rpc/tendermint/client/mock/abci.go b/rpc/client/mock/abci.go similarity index 97% rename from rpc/tendermint/client/mock/abci.go rename to rpc/client/mock/abci.go index d03728dbe..db9bd2c2b 100644 --- a/rpc/tendermint/client/mock/abci.go +++ b/rpc/client/mock/abci.go @@ -3,8 +3,8 @@ package mock import ( abci "github.com/tendermint/abci/types" data "github.com/tendermint/go-wire/data" - "github.com/tendermint/tendermint/rpc/tendermint/client" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + "github.com/tendermint/tendermint/rpc/client" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/client/mock/abci_test.go b/rpc/client/mock/abci_test.go similarity index 97% rename from rpc/tendermint/client/mock/abci_test.go rename to rpc/client/mock/abci_test.go index 3fcca9692..57334f25f 100644 --- a/rpc/tendermint/client/mock/abci_test.go +++ b/rpc/client/mock/abci_test.go @@ -11,10 +11,10 @@ import ( "github.com/tendermint/abci/example/dummy" abci "github.com/tendermint/abci/types" data "github.com/tendermint/go-wire/data" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - "github.com/tendermint/tendermint/rpc/tendermint/client/mock" + "github.com/tendermint/tendermint/rpc/client/mock" ) func TestABCIMock(t *testing.T) { diff --git a/rpc/tendermint/client/mock/client.go b/rpc/client/mock/client.go similarity index 95% rename from rpc/tendermint/client/mock/client.go rename to rpc/client/mock/client.go index b2a91b743..bf8d78dce 100644 --- a/rpc/tendermint/client/mock/client.go +++ b/rpc/client/mock/client.go @@ -17,9 +17,9 @@ import ( "reflect" data "github.com/tendermint/go-wire/data" - "github.com/tendermint/tendermint/rpc/tendermint/client" - "github.com/tendermint/tendermint/rpc/tendermint/core" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + "github.com/tendermint/tendermint/rpc/client" + "github.com/tendermint/tendermint/rpc/core" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/client/mock/status.go b/rpc/client/mock/status.go similarity index 89% rename from rpc/tendermint/client/mock/status.go rename to rpc/client/mock/status.go index 82ec40987..af0f5335d 100644 --- a/rpc/tendermint/client/mock/status.go +++ b/rpc/client/mock/status.go @@ -1,8 +1,8 @@ package mock import ( - "github.com/tendermint/tendermint/rpc/tendermint/client" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + "github.com/tendermint/tendermint/rpc/client" + ctypes "github.com/tendermint/tendermint/rpc/core/types" ) // StatusMock returns the result specified by the Call diff --git a/rpc/tendermint/client/mock/status_test.go b/rpc/client/mock/status_test.go similarity index 88% rename from rpc/tendermint/client/mock/status_test.go rename to rpc/client/mock/status_test.go index f5a2bc7f8..e4adf52ba 100644 --- a/rpc/tendermint/client/mock/status_test.go +++ b/rpc/client/mock/status_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" data "github.com/tendermint/go-wire/data" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" - "github.com/tendermint/tendermint/rpc/tendermint/client/mock" + "github.com/tendermint/tendermint/rpc/client/mock" ) func TestStatus(t *testing.T) { diff --git a/rpc/tendermint/client/rpc_test.go b/rpc/client/rpc_test.go similarity index 97% rename from rpc/tendermint/client/rpc_test.go rename to rpc/client/rpc_test.go index 95c583c97..d0cb7a47b 100644 --- a/rpc/tendermint/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/merkleeyes/iavl" merktest "github.com/tendermint/merkleeyes/testutil" - "github.com/tendermint/tendermint/rpc/tendermint/client" - rpctest "github.com/tendermint/tendermint/rpc/tendermint/test" + "github.com/tendermint/tendermint/rpc/client" + rpctest "github.com/tendermint/tendermint/rpc/test" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/abci.go b/rpc/core/abci.go similarity index 91% rename from rpc/tendermint/core/abci.go rename to rpc/core/abci.go index e56b92d70..5c9fcfc25 100644 --- a/rpc/tendermint/core/abci.go +++ b/rpc/core/abci.go @@ -3,7 +3,7 @@ package core import ( abci "github.com/tendermint/abci/types" data "github.com/tendermint/go-wire/data" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" ) //----------------------------------------------------------------------------- diff --git a/rpc/tendermint/core/blocks.go b/rpc/core/blocks.go similarity index 96% rename from rpc/tendermint/core/blocks.go rename to rpc/core/blocks.go index aa102255f..ef3474127 100644 --- a/rpc/tendermint/core/blocks.go +++ b/rpc/core/blocks.go @@ -3,7 +3,7 @@ package core import ( "fmt" . "github.com/tendermint/tmlibs/common" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/consensus.go b/rpc/core/consensus.go similarity index 92% rename from rpc/tendermint/core/consensus.go rename to rpc/core/consensus.go index e62e61a0c..e2ccce442 100644 --- a/rpc/tendermint/core/consensus.go +++ b/rpc/core/consensus.go @@ -3,7 +3,7 @@ package core import ( "github.com/tendermint/go-wire" cm "github.com/tendermint/tendermint/consensus" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/dev.go b/rpc/core/dev.go similarity index 95% rename from rpc/tendermint/core/dev.go rename to rpc/core/dev.go index 2053d7363..43a989534 100644 --- a/rpc/tendermint/core/dev.go +++ b/rpc/core/dev.go @@ -6,7 +6,7 @@ import ( "runtime/pprof" "strconv" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" ) func UnsafeFlushMempool() (*ctypes.ResultUnsafeFlushMempool, error) { diff --git a/rpc/tendermint/core/events.go b/rpc/core/events.go similarity index 89% rename from rpc/tendermint/core/events.go rename to rpc/core/events.go index e12122e57..555673df5 100644 --- a/rpc/tendermint/core/events.go +++ b/rpc/core/events.go @@ -1,8 +1,8 @@ package core import ( - "github.com/tendermint/tendermint/rpc/types" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + "github.com/tendermint/tendermint/rpc/lib/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/log.go b/rpc/core/log.go similarity index 100% rename from rpc/tendermint/core/log.go rename to rpc/core/log.go diff --git a/rpc/tendermint/core/mempool.go b/rpc/core/mempool.go similarity index 98% rename from rpc/tendermint/core/mempool.go rename to rpc/core/mempool.go index e3d82bf87..4adf75ce5 100644 --- a/rpc/tendermint/core/mempool.go +++ b/rpc/core/mempool.go @@ -6,7 +6,7 @@ import ( abci "github.com/tendermint/abci/types" data "github.com/tendermint/go-wire/data" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/net.go b/rpc/core/net.go similarity index 95% rename from rpc/tendermint/core/net.go rename to rpc/core/net.go index 499458230..31d9c34ea 100644 --- a/rpc/tendermint/core/net.go +++ b/rpc/core/net.go @@ -3,7 +3,7 @@ package core import ( "fmt" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" ) //----------------------------------------------------------------------------- diff --git a/rpc/tendermint/core/pipe.go b/rpc/core/pipe.go similarity index 100% rename from rpc/tendermint/core/pipe.go rename to rpc/core/pipe.go diff --git a/rpc/tendermint/core/routes.go b/rpc/core/routes.go similarity index 96% rename from rpc/tendermint/core/routes.go rename to rpc/core/routes.go index 7ed18ef7f..12694ab76 100644 --- a/rpc/tendermint/core/routes.go +++ b/rpc/core/routes.go @@ -2,9 +2,9 @@ package core import ( data "github.com/tendermint/go-wire/data" - rpc "github.com/tendermint/tendermint/rpc/server" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" - "github.com/tendermint/tendermint/rpc/types" + rpc "github.com/tendermint/tendermint/rpc/lib/server" + ctypes "github.com/tendermint/tendermint/rpc/core/types" + "github.com/tendermint/tendermint/rpc/lib/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/status.go b/rpc/core/status.go similarity index 92% rename from rpc/tendermint/core/status.go rename to rpc/core/status.go index 9dbfff86d..7493aeb0a 100644 --- a/rpc/tendermint/core/status.go +++ b/rpc/core/status.go @@ -2,7 +2,7 @@ package core import ( data "github.com/tendermint/go-wire/data" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/tx.go b/rpc/core/tx.go similarity index 91% rename from rpc/tendermint/core/tx.go rename to rpc/core/tx.go index 7d6a2deb8..7f3cdd037 100644 --- a/rpc/tendermint/core/tx.go +++ b/rpc/core/tx.go @@ -3,7 +3,7 @@ package core import ( "fmt" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/state/txindex/null" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/types/responses.go b/rpc/core/types/responses.go similarity index 99% rename from rpc/tendermint/core/types/responses.go rename to rpc/core/types/responses.go index f88b297e3..469e71061 100644 --- a/rpc/tendermint/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/go-crypto" data "github.com/tendermint/go-wire/data" "github.com/tendermint/tendermint/p2p" - "github.com/tendermint/tendermint/rpc/types" + "github.com/tendermint/tendermint/rpc/lib/types" "github.com/tendermint/go-wire" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/core/types/responses_test.go b/rpc/core/types/responses_test.go similarity index 100% rename from rpc/tendermint/core/types/responses_test.go rename to rpc/core/types/responses_test.go diff --git a/rpc/tendermint/core/version.go b/rpc/core/version.go similarity index 100% rename from rpc/tendermint/core/version.go rename to rpc/core/version.go diff --git a/rpc/tendermint/grpc/api.go b/rpc/grpc/api.go similarity index 85% rename from rpc/tendermint/grpc/api.go rename to rpc/grpc/api.go index f28169398..fab811c2e 100644 --- a/rpc/tendermint/grpc/api.go +++ b/rpc/grpc/api.go @@ -1,7 +1,7 @@ package core_grpc import ( - core "github.com/tendermint/tendermint/rpc/tendermint/core" + core "github.com/tendermint/tendermint/rpc/core" context "golang.org/x/net/context" ) diff --git a/rpc/tendermint/grpc/client_server.go b/rpc/grpc/client_server.go similarity index 100% rename from rpc/tendermint/grpc/client_server.go rename to rpc/grpc/client_server.go diff --git a/rpc/tendermint/grpc/compile.sh b/rpc/grpc/compile.sh similarity index 100% rename from rpc/tendermint/grpc/compile.sh rename to rpc/grpc/compile.sh diff --git a/rpc/tendermint/grpc/types.pb.go b/rpc/grpc/types.pb.go similarity index 100% rename from rpc/tendermint/grpc/types.pb.go rename to rpc/grpc/types.pb.go diff --git a/rpc/tendermint/grpc/types.proto b/rpc/grpc/types.proto similarity index 100% rename from rpc/tendermint/grpc/types.proto rename to rpc/grpc/types.proto diff --git a/rpc/lib/Dockerfile b/rpc/lib/Dockerfile new file mode 100644 index 000000000..a194711bf --- /dev/null +++ b/rpc/lib/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:latest + +RUN mkdir -p /go/src/github.com/tendermint/tendermint/rpc/lib +WORKDIR /go/src/github.com/tendermint/tendermint/rpc/lib + +COPY Makefile /go/src/github.com/tendermint/tendermint/rpc/lib/ +# COPY glide.yaml /go/src/github.com/tendermint/tendermint/rpc/lib/ +# COPY glide.lock /go/src/github.com/tendermint/tendermint/rpc/lib/ + +COPY . /go/src/github.com/tendermint/tendermint/rpc/lib + +RUN make get_deps diff --git a/rpc/Makefile b/rpc/lib/Makefile similarity index 100% rename from rpc/Makefile rename to rpc/lib/Makefile diff --git a/rpc/README.md b/rpc/lib/README.md similarity index 95% rename from rpc/README.md rename to rpc/lib/README.md index f1ef7485a..75531963e 100644 --- a/rpc/README.md +++ b/rpc/lib/README.md @@ -1,6 +1,6 @@ -# tendermint/rpc +# tendermint/rpc/lib -[![CircleCI](https://circleci.com/gh/tendermint/tendermint/rpc.svg?style=svg)](https://circleci.com/gh/tendermint/tendermint/rpc) +[![CircleCI](https://circleci.com/gh/tendermint/tendermint/rpc/lib.svg?style=svg)](https://circleci.com/gh/tendermint/tendermint/rpc/lib) HTTP RPC server supporting calls via uri params, jsonrpc, and jsonrpc over websockets diff --git a/rpc/circle.yml b/rpc/lib/circle.yml similarity index 100% rename from rpc/circle.yml rename to rpc/lib/circle.yml diff --git a/rpc/client/args_test.go b/rpc/lib/client/args_test.go similarity index 100% rename from rpc/client/args_test.go rename to rpc/lib/client/args_test.go diff --git a/rpc/client/http_client.go b/rpc/lib/client/http_client.go similarity index 96% rename from rpc/client/http_client.go rename to rpc/lib/client/http_client.go index 38a7f20fc..45ff8b8ac 100644 --- a/rpc/client/http_client.go +++ b/rpc/lib/client/http_client.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" wire "github.com/tendermint/go-wire" - types "github.com/tendermint/tendermint/rpc/types" + types "github.com/tendermint/tendermint/rpc/lib/types" ) // HTTPClient is a common interface for JSONRPCClient and URIClient. @@ -27,7 +27,7 @@ func makeHTTPDialer(remoteAddr string) (string, func(string, string) (net.Conn, parts := strings.SplitN(remoteAddr, "://", 2) var protocol, address string if len(parts) != 2 { - log.Warn("WARNING (tendermint/rpc): Please use fully formed listening addresses, including the tcp:// or unix:// prefix") + log.Warn("WARNING (tendermint/rpc/lib): Please use fully formed listening addresses, including the tcp:// or unix:// prefix") protocol = types.SocketType(remoteAddr) address = remoteAddr } else { diff --git a/rpc/client/log.go b/rpc/lib/client/log.go similarity index 100% rename from rpc/client/log.go rename to rpc/lib/client/log.go diff --git a/rpc/client/ws_client.go b/rpc/lib/client/ws_client.go similarity index 98% rename from rpc/client/ws_client.go rename to rpc/lib/client/ws_client.go index 70522265f..ad922dd68 100644 --- a/rpc/client/ws_client.go +++ b/rpc/lib/client/ws_client.go @@ -9,7 +9,7 @@ import ( "github.com/gorilla/websocket" "github.com/pkg/errors" cmn "github.com/tendermint/tmlibs/common" - types "github.com/tendermint/tendermint/rpc/types" + types "github.com/tendermint/tendermint/rpc/lib/types" wire "github.com/tendermint/go-wire" ) diff --git a/rpc/rpc_test.go b/rpc/lib/rpc_test.go similarity index 97% rename from rpc/rpc_test.go rename to rpc/lib/rpc_test.go index ef8832a88..2ce19fa75 100644 --- a/rpc/rpc_test.go +++ b/rpc/lib/rpc_test.go @@ -13,9 +13,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" wire "github.com/tendermint/go-wire" - client "github.com/tendermint/tendermint/rpc/client" - server "github.com/tendermint/tendermint/rpc/server" - types "github.com/tendermint/tendermint/rpc/types" + client "github.com/tendermint/tendermint/rpc/lib/client" + server "github.com/tendermint/tendermint/rpc/lib/server" + types "github.com/tendermint/tendermint/rpc/lib/types" ) // Client and Server should work over tcp or unix sockets diff --git a/rpc/server/handlers.go b/rpc/lib/server/handlers.go similarity index 99% rename from rpc/server/handlers.go rename to rpc/lib/server/handlers.go index a0dbc487a..d7dffd402 100644 --- a/rpc/server/handlers.go +++ b/rpc/lib/server/handlers.go @@ -15,7 +15,7 @@ import ( "github.com/gorilla/websocket" "github.com/pkg/errors" wire "github.com/tendermint/go-wire" - types "github.com/tendermint/tendermint/rpc/types" + types "github.com/tendermint/tendermint/rpc/lib/types" cmn "github.com/tendermint/tmlibs/common" events "github.com/tendermint/tmlibs/events" ) diff --git a/rpc/server/http_params.go b/rpc/lib/server/http_params.go similarity index 100% rename from rpc/server/http_params.go rename to rpc/lib/server/http_params.go diff --git a/rpc/server/http_server.go b/rpc/lib/server/http_server.go similarity index 95% rename from rpc/server/http_server.go rename to rpc/lib/server/http_server.go index b30bc3606..ae0923c39 100644 --- a/rpc/server/http_server.go +++ b/rpc/lib/server/http_server.go @@ -12,7 +12,7 @@ import ( "time" "github.com/pkg/errors" - types "github.com/tendermint/tendermint/rpc/types" + types "github.com/tendermint/tendermint/rpc/lib/types" ) func StartHTTPServer(listenAddr string, handler http.Handler) (listener net.Listener, err error) { @@ -20,7 +20,7 @@ func StartHTTPServer(listenAddr string, handler http.Handler) (listener net.List var proto, addr string parts := strings.SplitN(listenAddr, "://", 2) if len(parts) != 2 { - log.Warn("WARNING (tendermint/rpc): Please use fully formed listening addresses, including the tcp:// or unix:// prefix") + log.Warn("WARNING (tendermint/rpc/lib): Please use fully formed listening addresses, including the tcp:// or unix:// prefix") // we used to allow addrs without tcp/unix prefix by checking for a colon // TODO: Deprecate proto = types.SocketType(listenAddr) diff --git a/rpc/server/log.go b/rpc/lib/server/log.go similarity index 100% rename from rpc/server/log.go rename to rpc/lib/server/log.go diff --git a/rpc/test/data.json b/rpc/lib/test/data.json similarity index 100% rename from rpc/test/data.json rename to rpc/lib/test/data.json diff --git a/rpc/test/integration_test.sh b/rpc/lib/test/integration_test.sh similarity index 100% rename from rpc/test/integration_test.sh rename to rpc/lib/test/integration_test.sh diff --git a/rpc/test/main.go b/rpc/lib/test/main.go similarity index 90% rename from rpc/test/main.go rename to rpc/lib/test/main.go index ea91fcfd0..8e63cdc38 100644 --- a/rpc/test/main.go +++ b/rpc/lib/test/main.go @@ -5,7 +5,7 @@ import ( "net/http" cmn "github.com/tendermint/tmlibs/common" - rpcserver "github.com/tendermint/tendermint/rpc/server" + rpcserver "github.com/tendermint/tendermint/rpc/lib/server" ) var routes = map[string]*rpcserver.RPCFunc{ diff --git a/rpc/types/types.go b/rpc/lib/types/types.go similarity index 100% rename from rpc/types/types.go rename to rpc/lib/types/types.go diff --git a/rpc/version.go b/rpc/lib/version.go similarity index 100% rename from rpc/version.go rename to rpc/lib/version.go diff --git a/rpc/tendermint/test/client_test.go b/rpc/test/client_test.go similarity index 98% rename from rpc/tendermint/test/client_test.go rename to rpc/test/client_test.go index 11ee61a56..67c88356d 100644 --- a/rpc/tendermint/test/client_test.go +++ b/rpc/test/client_test.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/abci/types" - rpc "github.com/tendermint/tendermint/rpc/client" - "github.com/tendermint/tendermint/rpc/tendermint/core" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" + rpc "github.com/tendermint/tendermint/rpc/lib/client" + "github.com/tendermint/tendermint/rpc/core" + ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/state/txindex/null" "github.com/tendermint/tendermint/types" . "github.com/tendermint/tmlibs/common" diff --git a/rpc/tendermint/test/grpc_test.go b/rpc/test/grpc_test.go similarity index 88% rename from rpc/tendermint/test/grpc_test.go rename to rpc/test/grpc_test.go index 4fcc3e856..4935a09d9 100644 --- a/rpc/tendermint/test/grpc_test.go +++ b/rpc/test/grpc_test.go @@ -6,7 +6,7 @@ import ( "golang.org/x/net/context" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/rpc/tendermint/grpc" + "github.com/tendermint/tendermint/rpc/grpc" ) //------------------------------------------- diff --git a/rpc/tendermint/test/helpers.go b/rpc/test/helpers.go similarity index 96% rename from rpc/tendermint/test/helpers.go rename to rpc/test/helpers.go index 4e281f8c3..311f05980 100644 --- a/rpc/tendermint/test/helpers.go +++ b/rpc/test/helpers.go @@ -18,9 +18,9 @@ import ( "github.com/tendermint/tendermint/config/tendermint_test" nm "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/proxy" - client "github.com/tendermint/tendermint/rpc/client" - ctypes "github.com/tendermint/tendermint/rpc/tendermint/core/types" - core_grpc "github.com/tendermint/tendermint/rpc/tendermint/grpc" + client "github.com/tendermint/tendermint/rpc/lib/client" + ctypes "github.com/tendermint/tendermint/rpc/core/types" + core_grpc "github.com/tendermint/tendermint/rpc/grpc" "github.com/tendermint/tendermint/types" ) diff --git a/rpc/tendermint/test/main_test.go b/rpc/test/main_test.go similarity index 100% rename from rpc/tendermint/test/main_test.go rename to rpc/test/main_test.go diff --git a/test/app/grpc_client.go b/test/app/grpc_client.go index 7d55dcd71..e43b8ae39 100644 --- a/test/app/grpc_client.go +++ b/test/app/grpc_client.go @@ -8,7 +8,7 @@ import ( "golang.org/x/net/context" "github.com/tendermint/go-wire" - "github.com/tendermint/tendermint/rpc/tendermint/grpc" + "github.com/tendermint/tendermint/rpc/grpc" ) var grpcAddr = "tcp://localhost:36656"