Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartsDAIDaemonTaskLoop ¶
func StartsDAIDaemonTaskLoop( ctx context.Context, c *Client, ticker *time.Ticker, stop <-chan bool, s SubTaskRunner, ethClient *ethclient.Client, queryClient ethqueryclienttypes.EthQueryClient, serviceClient api.SDAIServiceClient, )
StartsDAIDaemonTaskLoop operates the continuous loop that runs the sDAI daemon. It receives as arguments a ticker and a stop channel that are used to control and halt the loop.
Types ¶
type Client ¶
type Client struct { daemontypes.HealthCheckable // contains filtered or unexported fields }
Client encapsulates the logic and interface for the sDAI daemon. The sDAI daemon periodically queries the Ethereum blockchain for new sDAI conversion rate and relays them to the Cosmos gRPC server.
func (*Client) Start ¶
func (c *Client) Start( ctx context.Context, flags daemonflags.DaemonFlags, appFlags appflags.Flags, grpcClient daemontypes.GrpcClient, ) error
Start begins a job that periodically runs the RunSDAIDaemonTaskLoop function.
type SubTaskRunner ¶
type SubTaskRunner interface { RunsDAIDaemonTaskLoop( ctx context.Context, logger log.Logger, ethClient *ethclient.Client, queryClient ethqueryclienttypes.EthQueryClient, serviceClient api.SDAIServiceClient, ) error }
type SubTaskRunnerImpl ¶
type SubTaskRunnerImpl struct{}
func (*SubTaskRunnerImpl) RunsDAIDaemonTaskLoop ¶
func (s *SubTaskRunnerImpl) RunsDAIDaemonTaskLoop( ctx context.Context, logger log.Logger, ethClient *ethclient.Client, queryClient ethqueryclienttypes.EthQueryClient, serviceClient api.SDAIServiceClient, ) error
RunsDAIDaemonTaskLoop does the following: 1) Fetches sDAI conversion rate from a configured Ethereum client. 2) Sends sDAI conversion rate to the gRPC server.
Click to show internal directories.
Click to hide internal directories.