server

package
v0.0.0-...-41d3419 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleveragingServer

type DeleveragingServer struct {
	// contains filtered or unexported fields
}

DeleveragingServer defines the fields required for deleveraging updates.

type PriceFeedServer

type PriceFeedServer struct {
	// contains filtered or unexported fields
}

PriceFeedServer defines the fields required for price updates.

type SDAIServer

type SDAIServer struct {
	// contains filtered or unexported fields
}

sDAIServer defines the fields required for sDAI conversion rate updates.

type Server

type Server struct {
	SDAIServer
	PriceFeedServer
	DeleveragingServer
	// 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) AddsDAIEvent

func (s *Server) AddsDAIEvent(
	ctx context.Context,
	req *api.AddsDAIEventRequest,
) (
	response *api.AddsDAIEventResponse,
	err error,
)

AddsDAIEvents stores any conversion rate recognized by the daemon 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) UpdateSubaccountsListForDeleveragingDaemon

func (s *Server) UpdateSubaccountsListForDeleveragingDaemon(
	ctx context.Context,
	req *api.UpdateSubaccountsListForDeleveragingDaemonRequest,
) (
	response *api.UpdateSubaccountsListForDeleveragingDaemonResponse,
	err error,
)

UpdateSubaccountsListForDeleveragingDaemon stores the list of subaccount ids that can be deleveraged against in a go-routine safe slice.

func (*Server) WithDaemonDeleveragingInfo

func (server *Server) WithDaemonDeleveragingInfo(
	daemonDeleveragingInfo *deleveragingtypes.DaemonDeleveragingInfo,
) *Server

WithDaemonDeleveragingInfo sets the `daemonDeleveragingInfo` field. This is updated by the deleveraging service with a list of subaccounts with open positions for each perp.

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.

func (*Server) WithsDAIEventManager

func (server *Server) WithsDAIEventManager(
	sDAIEventManager bdtypes.SDAIEventManager,
) *Server

WithsDAIEventManager sets the `sDAIEventManager` field. This is updated by the sDAI service with a new conversion rate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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