Skip to content

Commit

Permalink
Use chimera-api for protofiles (#18)
Browse files Browse the repository at this point in the history
* Use chimera-api for protofiles

Signed-off-by: Puneetha <puneetha17@gmail.com>

* Fix testcases for protofiles in Chimera-API

Signed-off-by: Puneetha <puneetha17@gmail.com>
  • Loading branch information
Puneetha17 authored and conor10 committed Jul 24, 2018
1 parent 0b8d850 commit c9bc8aa
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 115 deletions.
15 changes: 14 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 1 addition & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,8 @@ IGNORED_PACKAGES := /vendor/
.PHONY: all
all: build

protofiles: proto grpc

proto:
$Q protoc -I protofiles/ \
-I $(GOPATH)/../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:protofiles \
protofiles/*.proto

grpc:
$Q protoc -I protofiles/ \
-I $(GOPATH)/../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--grpc-gateway_out=logtostderr=true:protofiles \
protofiles/grpc.proto


.PHONY: build
build: protofiles .GOPATH/.ok
build: .GOPATH/.ok
$Q go install $(if $V,-v) $(VERSION_FLAGS) $(IMPORT_PATH)

### Code not in the repository root? Another binary? Add to the path like this.
Expand All @@ -41,7 +26,6 @@ build: protofiles .GOPATH/.ok

clean:
$Q rm -rf bin .GOPATH
$Q rm -f server/*\.pb*

test: .GOPATH/.ok
$Q go test $(if $V,-v) -i -race $(allpackages) # install -race libs to speed up next run
Expand Down Expand Up @@ -90,17 +74,9 @@ setup: clean .GOPATH/.ok
echo "/.GOPATH" >> .gitignore; \
echo "/bin" >> .gitignore; \
fi
$Q curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
$Q unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
$Q mv protoc3/bin/* .GOPATH/bin/
$Q mv protoc3/include/* .GOPATH/include/
$Q rm -r protoc3
$Q rm protoc-3.5.1-linux-x86_64.zip
go get -u github.com/golang/dep/cmd/dep
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/wadey/gocovmerge
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
@test -f Gopkg.toml || \
(cd $(CURDIR)/.GOPATH/src/$(IMPORT_PATH) && ./bin/dep init)
(cd $(CURDIR)/.GOPATH/src/$(IMPORT_PATH) && ./bin/dep ensure)
Expand Down
2 changes: 1 addition & 1 deletion api/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"encoding/json"
"net/http/httputil"
"fmt"
"github.com/blk-io/crux/protofiles"
"github.com/blk-io/chimera-api/protofiles"
"golang.org/x/net/context"
"google.golang.org/grpc"
"net/url"
Expand Down
40 changes: 0 additions & 40 deletions protofiles/grpc.proto

This file was deleted.

45 changes: 0 additions & 45 deletions protofiles/messages.proto

This file was deleted.

2 changes: 1 addition & 1 deletion server/proto_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/blk-io/crux/utils"
"net"
"google.golang.org/grpc/credentials"
"github.com/blk-io/crux/protofiles"
"github.com/blk-io/chimera-api/protofiles"
)

func (tm *TransactionManager) startRpcServer(port int, grpcJsonPort int, ipcPath string, tls bool, certFile, keyFile string) error {
Expand Down
2 changes: 1 addition & 1 deletion server/server_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/kevinburke/nacl"
"encoding/json"
"github.com/blk-io/crux/api"
"github.com/blk-io/crux/protofiles"
"github.com/blk-io/chimera-api/protofiles"
)

type Server struct {
Expand Down
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/kevinburke/nacl"
"github.com/blk-io/crux/enclave"
"github.com/blk-io/crux/storage"
"github.com/blk-io/crux/protofiles"
"github.com/blk-io/chimera-api/protofiles"
"golang.org/x/net/context"
"google.golang.org/grpc"
"path"
Expand Down

0 comments on commit c9bc8aa

Please sign in to comment.