Skip to content

Commit

Permalink
Merge pull request #7 from MinterTeam/orderbook
Browse files Browse the repository at this point in the history
Orderbook
  • Loading branch information
Klimov Sergey authored Oct 13, 2021
2 parents 1051860 + 7e2957b commit 97a0b21
Show file tree
Hide file tree
Showing 30 changed files with 11,932 additions and 10,115 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ jobs:

steps:
- uses: actions/checkout@v2

- uses: wizhi/setup-buf@v1
with:
version: 0.51.0
- name: Install Protoc
uses: arduino/setup-protoc@master
with:
version: '3.14'
version: '3.17'

- uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: '1.16'

- run: go generate gen.go

Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ all:
google.golang.org/grpc/cmd/protoc-gen-go-grpc \
github.com/rakyll/statik
mkdir -p api_pb
protoc -I . \
--go_out ./api_pb \
--grpc-gateway_out=logtostderr=true,generate_unbound_methods=true:./api_pb \
--openapiv2_out=use_go_templates=true,json_names_for_fields=false,disable_default_errors=true,simple_operation_ids=true,allow_merge=true,merge_file_name=api:./docs \
--go-grpc_out=./api_pb ./*.proto
sed -i 's~api_pb~~g' docs/api.swagger.json
sed -i 's~#/definitions/rpcStatus~~g' docs/api.swagger.json
buf generate
rm -rf api_pb/*
mv ./gen/go/* ./api_pb/
rm ./docs/api.swagger.json
mv ./gen/openapiv2/api.swagger.json ./docs/
sed -i 's~api_pb~~g' ./docs/api.swagger.json
sed -i 's~#/definitions/rpcStatus~~g' ./docs/api.swagger.json
statik -m -f -src docs/
37 changes: 33 additions & 4 deletions api.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
syntax = "proto3";

option go_package = "github.com/MinterTeam/node-grpc-gateway/gen/go;api_pb";
package api_pb;

import "google/protobuf/empty.proto";
import "resources.proto";
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

package api_pb;

option go_package = ".;api_pb";

service ApiService {
// Subscribe
//
Expand Down Expand Up @@ -370,4 +369,34 @@ service ApiService {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}

// LimitOrder
//
//
rpc LimitOrder (LimitOrderRequest) returns (LimitOrderResponse) {
option (google.api.http) = {
get: "/limit_order/{order_id}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}

// LimitOrdersOfPool
//
//
rpc LimitOrdersOfPool (LimitOrdersOfPoolRequest) returns (LimitOrdersOfPoolResponse) {
option (google.api.http) = {
get: "/limit_orders/{sell_coin}/{buy_coin}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}

// LimitOrders
//
//
rpc LimitOrders (LimitOrdersRequest) returns (LimitOrdersResponse) {
option (google.api.http) = {
get: "/limit_orders"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
}
527 changes: 280 additions & 247 deletions api_pb/api.pb.go

Large diffs are not rendered by default.

Loading

0 comments on commit 97a0b21

Please sign in to comment.