Documentation
¶
Index ¶
- type BridgeServer
- type LiquidationServer
- type PriceFeedServer
- type Server
- func (s *Server) AddBridgeEvents(ctx context.Context, req *api.AddBridgeEventsRequest) (*api.AddBridgeEventsResponse, error)
- func (s *Server) LiquidateSubaccounts(ctx context.Context, req *api.LiquidateSubaccountsRequest) (*api.LiquidateSubaccountsResponse, error)
- func (server *Server) Start()
- func (server *Server) Stop()
- func (s *Server) UpdateMarketPrices(ctx context.Context, req *api.UpdateMarketPricesRequest) (*api.UpdateMarketPricesResponse, error)
- func (server *Server) WithBridgeEventManager(bridgeEventManager *bdtypes.BridgeEventManager) *Server
- func (server *Server) WithLiquidatableSubaccountIds(liquidatableSubaccountIds *liquidationtypes.LiquidatableSubaccountIds) *Server
- func (server *Server) WithPriceFeedMarketToExchangePrices(marketToExchange *pricefeedtypes.MarketToExchangePrices) *Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeServer ¶
type BridgeServer struct {
// contains filtered or unexported fields
}
BridgeServer defines the fields required for bridge event updates.
type LiquidationServer ¶
type LiquidationServer struct {
// contains filtered or unexported fields
}
LiquidationServer defines the fields required for liquidation updates.
type PriceFeedServer ¶
type PriceFeedServer struct {
// contains filtered or unexported fields
}
PriceFeedServer defines the fields required for price updates.
type Server ¶
type Server struct { BridgeServer PriceFeedServer LiquidationServer // contains filtered or unexported fields }
Server struct defines the shared gRPC server for all daemons. The struct contains fields related to gRPC server that are common to all daemons. In addition, the struct contains fields that are specific to various daemon services. needed for various services.
func NewServer ¶
func NewServer( logger log.Logger, grpcServer lib.GrpcServer, fileHandler lib.FileHandler, socketAddress string, ) *Server
NewServer creates a single gRPC server that's shared across multiple daemons for communication.
func (*Server) AddBridgeEvents ¶
func (s *Server) AddBridgeEvents( ctx context.Context, req *api.AddBridgeEventsRequest, ) ( *api.AddBridgeEventsResponse, error, )
AddBridgeEvents stores any bridge events recognized by the daemon in a go-routine safe slice.
func (*Server) LiquidateSubaccounts ¶
func (s *Server) LiquidateSubaccounts( ctx context.Context, req *api.LiquidateSubaccountsRequest, ) (*api.LiquidateSubaccountsResponse, error)
LiquidateSubaccounts stores the list of potentially liquidatable subaccount ids in a go-routine safe slice.
func (*Server) Start ¶
func (server *Server) Start()
Start clears the current socket and establishes a new socket connection on the local filesystem. See URL for more information: https://eli.thegreenplace.net/2019/unix-domain-sockets-in-go/
func (*Server) UpdateMarketPrices ¶
func (s *Server) UpdateMarketPrices( ctx context.Context, req *api.UpdateMarketPricesRequest, ) (*api.UpdateMarketPricesResponse, error)
UpdateMarketPrices updates prices from exchanges for each market provided.
func (*Server) WithBridgeEventManager ¶
func (server *Server) WithBridgeEventManager( bridgeEventManager *bdtypes.BridgeEventManager, ) *Server
WithBridgeEventManager sets the `bridgeEventManager` field. This is updated by the bridge service with a list of recognized bridge events.
func (*Server) WithLiquidatableSubaccountIds ¶
func (server *Server) WithLiquidatableSubaccountIds( liquidatableSubaccountIds *liquidationtypes.LiquidatableSubaccountIds, ) *Server
WithLiquidatableSubaccountIds sets the `liquidatableSubaccountIds` field. This is updated by the liquidation service with a list of potentially liquidatable subaccount ids to be processed by the `PerpetualLiquidationsKeeper`.
func (*Server) WithPriceFeedMarketToExchangePrices ¶
func (server *Server) WithPriceFeedMarketToExchangePrices( marketToExchange *pricefeedtypes.MarketToExchangePrices, ) *Server
WithPriceFeedMarketToExchangePrices sets the `MarketToExchangePrices` field. This is used by the price feed service to communicate price updates to the main application.