Documentation
¶
Overview ¶
Package rpc provides RPC-based transaction target 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 ( // ErrAllTransactionsFailed is returned when all transactions fail to send ErrAllTransactionsFailed = errors.New("all transactions failed to send") )
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator manages multiple RPC peer connections for sending transactions
func NewCoordinator ¶
func NewCoordinator(config *target.Config, log logrus.FieldLogger) (*Coordinator, error)
NewCoordinator creates a new RPC target coordinator
func (*Coordinator) SendTransactionsToPeers ¶
func (c *Coordinator) SendTransactionsToPeers(ctx context.Context, transactions *mimicry.Transactions) error
SendTransactionsToPeers sends transactions to all connected RPC peers
type CoordinatorStatus ¶
CoordinatorStatus represents the status of the RPC coordinator
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer represents an RPC connection to an Ethereum node for sending transactions
func NewPeer ¶
func NewPeer(_ context.Context, log logrus.FieldLogger, rpcEndpoint string, sendConcurrency int) (*Peer, error)
NewPeer creates a new RPC target peer
func (*Peer) SendTransactions ¶
func (p *Peer) SendTransactions(ctx context.Context, transactions *mimicry.Transactions) (*SendResult, error)
SendTransactions sends transactions via RPC concurrently
type SendResult ¶
type SendResult struct {
AcceptedByType map[uint8]int // Count of truly accepted transactions by type (not AlreadyKnown)
TotalSent int
}
SendResult contains the results of sending transactions
Click to show internal directories.
Click to hide internal directories.