Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartBridgeDaemonTaskLoop ¶
func StartBridgeDaemonTaskLoop( ctx context.Context, c *Client, ticker *time.Ticker, stop <-chan bool, s SubTaskRunner, ethClient types.EthClient, queryClient bridgetypes.QueryClient, serviceClient api.BridgeServiceClient, )
StartBridgeDaemonTaskLoop operates the continuous loop that runs the bridge 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 bridge daemon. The bridge daemon periodically queries the Ethereum blockchain for new bridge events 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 RunBridgeDaemonTaskLoop function.
type SubTaskRunner ¶
type SubTaskRunner interface { RunBridgeDaemonTaskLoop( ctx context.Context, logger log.Logger, ethClient types.EthClient, queryClient bridgetypes.QueryClient, serviceClient api.BridgeServiceClient, ) error }
type SubTaskRunnerImpl ¶
type SubTaskRunnerImpl struct{}
func (*SubTaskRunnerImpl) RunBridgeDaemonTaskLoop ¶
func (s *SubTaskRunnerImpl) RunBridgeDaemonTaskLoop( ctx context.Context, logger log.Logger, ethClient types.EthClient, queryClient bridgetypes.QueryClient, serviceClient api.BridgeServiceClient, ) error
RunBridgeDaemonTaskLoop does the following: 1) Fetches configuration information by querying the gRPC server. 2) Fetches Ethereum events from a configured Ethereum client. 3) Sends newly-recognized bridge events to the gRPC server.