grpc: register trading server

This commit is contained in:
なるみ 2022-04-16 23:44:21 +08:00
parent 8ba0b8c81d
commit 6920ac9090
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

@ -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 {