client

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: 22 Imported by: 0

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 NewClient

func NewClient(logger log.Logger) *Client

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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