server

package
v0.0.0-...-cc24d94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

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 daemontypes.GrpcServer,
	fileHandler daemontypes.FileHandler,
	socketAddress string,
) *Server

NewServer creates a single gRPC server that's shared across multiple daemons for communication. uniqueTestIdentifier is a string that can be used to identify services spawned by a particular test case, so that they can be cleaned up after the test case is complete.

func (*Server) AddBridgeEvents

func (s *Server) AddBridgeEvents(
	ctx context.Context,
	req *api.AddBridgeEventsRequest,
) (
	response *api.AddBridgeEventsResponse,
	err 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,
) (
	response *api.LiquidateSubaccountsResponse,
	err 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) Stop

func (server *Server) Stop()

Stop stops the daemon server's gRPC service.

func (*Server) UpdateMarketPrices

func (s *Server) UpdateMarketPrices(
	ctx context.Context,
	req *api.UpdateMarketPricesRequest,
) (
	response *api.UpdateMarketPricesResponse,
	err 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) WithDaemonLiquidationInfo

func (server *Server) WithDaemonLiquidationInfo(
	daemonLiquidationInfo *liquidationtypes.DaemonLiquidationInfo,
) *Server

WithDaemonLiquidationInfo sets the `daemonLiquidationInfo` 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL