Documentation
¶
Overview ¶
Package rpc provides RPC-based transaction source functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrConfigRequired is returned when config is nil ErrConfigRequired = errors.New("config is required") // ErrRPCEndpointsRequired is returned when rpcEndpoints is empty ErrRPCEndpointsRequired = errors.New("rpcEndpoints is required") )
View Source
var ( // ErrPollingPanicked is returned when polling handler panics ErrPollingPanicked = errors.New("polling handler panicked") )
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator manages multiple RPC peer connections for sourcing transactions
func NewCoordinator ¶
func NewCoordinator(config *source.Config, broadcast func(ctx context.Context, transactions *mimicry.Transactions) error, log logrus.FieldLogger) (*Coordinator, error)
NewCoordinator creates a new RPC source coordinator
type CoordinatorStatus ¶
CoordinatorStatus represents the status of the RPC coordinator
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer represents an HTTP RPC connection that polls txpool_content
func NewPeer ¶
func NewPeer( _ context.Context, log logrus.FieldLogger, rpcEndpoint string, handler func(ctx context.Context, transactions *mimicry.Transactions) error, sharedCache *cache.SharedCache, txFilterConfig *source.TransactionFilterConfig, metrics *source.Metrics, pollInterval time.Duration, ) (*Peer, error)
NewPeer creates a new HTTP polling peer for sourcing transactions
type PollingPeer ¶
type PollingPeer struct {
// contains filtered or unexported fields
}
PollingPeer represents an HTTP RPC connection that polls txpool_content
func NewPollingPeer ¶
func NewPollingPeer( _ context.Context, log logrus.FieldLogger, rpcEndpoint string, handler func(ctx context.Context, transactions *mimicry.Transactions) error, sharedCache *cache.SharedCache, txFilterConfig *source.TransactionFilterConfig, metrics *source.Metrics, pollInterval time.Duration, ) (*PollingPeer, error)
NewPollingPeer creates a new HTTP polling peer for sourcing transactions
type TxPoolContent ¶
type TxPoolContent struct {
Pending map[string]map[string]*types.Transaction `json:"pending"`
Queued map[string]map[string]*types.Transaction `json:"queued"`
}
TxPoolContent represents the response from txpool_content RPC call
Click to show internal directories.
Click to hide internal directories.