Skip to content

Commit

Permalink
grpc: register trading server
Browse files Browse the repository at this point in the history
  • Loading branch information
narumiruna committed Apr 16, 2022
1 parent 8ba0b8c commit 6920ac9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
File renamed without changes.
13 changes: 13 additions & 0 deletions evans/tradingService/submit_order_max.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"session": "max",
"submit_orders": [
{
"exchange": "max",
"symbol": "BTCTWD",
"side": "BUY",
"price": "20000",
"quantity": "0.02",
"order_type": "LIMIT"
}
]
}
6 changes: 6 additions & 0 deletions pkg/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ func (s *Server) ListenAndServe(bind string) error {
Trader: s.Trader,
})

pb.RegisterTradingServiceServer(grpcServer, &TradingService{
Config: s.Config,
Environ: s.Environ,
Trader: s.Trader,
})

reflection.Register(grpcServer)

if err := grpcServer.Serve(conn); err != nil {
Expand Down

0 comments on commit 6920ac9

Please sign in to comment.