Merge pull request #535 from narumiruna/grpc/register-trading-server

fix: grpc: register trading server
This commit is contained in:
Yo-An Lin 2022-04-17 00:50:25 +08:00 committed by GitHub
commit 41c78f9035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,13 @@
{
"session": "max",
"submit_orders": [
{
"exchange": "max",
"symbol": "BTCTWD",
"side": "BUY",
"price": "20000",
"quantity": "0.02",
"order_type": "LIMIT"
}
]
}

View File

@ -345,6 +345,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 {