Documentation ¶
Index ¶
- Constants
- func NewDroppedBundle(message string) error
- func NewInternalError(message string) error
- func NewSimulationFailureError(tx string, message string) error
- func NewStateAuctionBidRejectedError(auction string, tip uint64) error
- func NewWinningBatchBidRejectedError(auction string, tip uint64) error
- type BundleRejectionError
- type BundleResponse
- type Relayer
- func (r *Relayer) OnStartExpiringPacketStream(ctx context.Context) (<-chan *block_engine_pb.StartExpiringPacketStreamResponse, <-chan error, error)
- func (r *Relayer) OnSubscribeAccountsOfInterest(ctx context.Context) (<-chan *block_engine_pb.AccountsOfInterestUpdate, <-chan error, error)
- func (r *Relayer) OnSubscribeProgramsOfInterest(ctx context.Context) (<-chan *block_engine_pb.ProgramsOfInterestUpdate, <-chan error, error)
- func (r *Relayer) StartExpiringPacketStream(opts ...grpc.CallOption) (block_engine_pb.BlockEngineRelayer_StartExpiringPacketStreamClient, error)
- func (r *Relayer) SubscribeAccountsOfInterest(opts ...grpc.CallOption) (block_engine_pb.BlockEngineRelayer_SubscribeAccountsOfInterestClient, error)
- func (r *Relayer) SubscribeProgramsOfInterest(opts ...grpc.CallOption) (block_engine_pb.BlockEngineRelayer_SubscribeProgramsOfInterestClient, error)
- type SearcherClient
- func (c *SearcherClient) GetConnectedLeaders(opts ...grpc.CallOption) (*searcher_pb.ConnectedLeadersResponse, error)
- func (c *SearcherClient) GetConnectedLeadersRegioned(regions []string, opts ...grpc.CallOption) (*searcher_pb.ConnectedLeadersRegionedResponse, error)
- func (c *SearcherClient) GetNextScheduledLeader(regions []string, opts ...grpc.CallOption) (*searcher_pb.NextScheduledLeaderResponse, error)
- func (c *SearcherClient) GetRandomTipAccount(opts ...grpc.CallOption) (string, error)
- func (c *SearcherClient) GetRegions(opts ...grpc.CallOption) (*searcher_pb.GetRegionsResponse, error)
- func (c *SearcherClient) GetTipAccounts(opts ...grpc.CallOption) (*searcher_pb.GetTipAccountsResponse, error)
- func (c *SearcherClient) NewBundle(transactions []*solana.Transaction) (*bundle_pb.Bundle, error)
- func (c *SearcherClient) NewBundleSubscriptionResults(opts ...grpc.CallOption) (searcher_pb.SearcherService_SubscribeBundleResultsClient, error)
- func (c *SearcherClient) SendBundle(transactions []*solana.Transaction, opts ...grpc.CallOption) (*searcher_pb.SendBundleResponse, error)
- func (c *SearcherClient) SendBundleWithConfirmation(ctx context.Context, transactions []*solana.Transaction, ...) (*BundleResponse, error)
- type Validator
- func (v *Validator) GetBlockBuilderFeeInfo(opts ...grpc.CallOption) (*block_engine_pb.BlockBuilderFeeInfoResponse, error)
- func (v *Validator) OnBundleSubscription(ctx context.Context) (<-chan []*bundle_pb.BundleUuid, <-chan error, error)
- func (v *Validator) OnPacketSubscription(ctx context.Context) (<-chan *block_engine_pb.SubscribePacketsResponse, <-chan error, error)
- func (v *Validator) SubscribeBundles(opts ...grpc.CallOption) (block_engine_pb.BlockEngineValidator_SubscribeBundlesClient, error)
- func (v *Validator) SubscribePackets(opts ...grpc.CallOption) (block_engine_pb.BlockEngineValidator_SubscribePacketsClient, error)
Constants ¶
const ( CheckBundleRetries = 5 // Number of times to retry checking bundle status CheckBundleRetryDelay = 5 * time.Second // Delay between retries for checking bundle status SignaturesConfirmationTimeout = 15 * time.Second // Timeout for confirming signatures SignaturesConfirmationRetryDelay = 1 * time.Second // Delay between retries for confirming signatures )
Constants for retry and timeout configurations
Variables ¶
This section is empty.
Functions ¶
func NewDroppedBundle ¶
NewDroppedBundle creates a new error indicating that a bundle was dropped.
func NewInternalError ¶
NewInternalError creates a new internal error.
func NewSimulationFailureError ¶
NewSimulationFailureError creates a new error indicating that a bundle failed simulation.
func NewStateAuctionBidRejectedError ¶
NewStateAuctionBidRejectedError creates a new error indicating that a bundle lost the state auction.
func NewWinningBatchBidRejectedError ¶
NewWinningBatchBidRejectedError creates a new error indicating that a bundle won the state auction but failed the global auction.
Types ¶
type BundleRejectionError ¶
type BundleRejectionError struct {
Message string // Error message
}
BundleRejectionError represents an error when a bundle is rejected.
func (BundleRejectionError) Error ¶
func (e BundleRejectionError) Error() string
Error implements the error interface for BundleRejectionError.
type BundleResponse ¶
type BundleResponse struct { BundleResponse *searcher_pb.SendBundleResponse // Response from sending bundle Signatures []solana.Signature // Signatures of transactions in the bundle }
BundleResponse represents a response from sending a bundle.
type Relayer ¶
type Relayer struct { GRPCConn *grpc.ClientConn // gRPC connection Client block_engine_pb.BlockEngineRelayerClient // Relayer client AuthenticationService *pkg.AuthenticationService // Authentication service ErrChan <-chan error // Error channel }
Relayer is a client for interacting with the Block Engine Relayer service.
func NewRelayer ¶
func NewRelayer( ctx context.Context, grpcAddr string, keyPair *solana.PrivateKey, opts ...grpc.DialOption, ) (*Relayer, error)
NewRelayer initializes a new Relayer with the given context, gRPC address, and Solana private key. It establishes a gRPC connection, sets up authentication if a keyPair is provided, and returns the Relayer.
func (*Relayer) OnStartExpiringPacketStream ¶
func (r *Relayer) OnStartExpiringPacketStream(ctx context.Context) ( <-chan *block_engine_pb.StartExpiringPacketStreamResponse, <-chan error, error)
OnStartExpiringPacketStream starts a stream for receiving expiring packet updates and handles the incoming updates and errors. It returns channels for the updates and errors.
func (*Relayer) OnSubscribeAccountsOfInterest ¶
func (r *Relayer) OnSubscribeAccountsOfInterest(ctx context.Context) ( <-chan *block_engine_pb.AccountsOfInterestUpdate, <-chan error, error)
OnSubscribeAccountsOfInterest subscribes to accounts of interest updates and handles the incoming updates and errors. It returns channels for the updates and errors.
func (*Relayer) OnSubscribeProgramsOfInterest ¶
func (r *Relayer) OnSubscribeProgramsOfInterest(ctx context.Context) ( <-chan *block_engine_pb.ProgramsOfInterestUpdate, <-chan error, error)
OnSubscribeProgramsOfInterest subscribes to programs of interest updates and handles the incoming updates and errors. It returns channels for the updates and errors.
func (*Relayer) StartExpiringPacketStream ¶
func (r *Relayer) StartExpiringPacketStream(opts ...grpc.CallOption) ( block_engine_pb.BlockEngineRelayer_StartExpiringPacketStreamClient, error)
StartExpiringPacketStream starts a stream for receiving expiring packet updates from the BlockEngineRelayer service. It returns a client for receiving these updates.
func (*Relayer) SubscribeAccountsOfInterest ¶
func (r *Relayer) SubscribeAccountsOfInterest(opts ...grpc.CallOption) ( block_engine_pb.BlockEngineRelayer_SubscribeAccountsOfInterestClient, error)
SubscribeAccountsOfInterest subscribes to accounts of interest updates from the BlockEngineRelayer service. It returns a client for receiving these updates.
func (*Relayer) SubscribeProgramsOfInterest ¶
func (r *Relayer) SubscribeProgramsOfInterest(opts ...grpc.CallOption) ( block_engine_pb.BlockEngineRelayer_SubscribeProgramsOfInterestClient, error)
SubscribeProgramsOfInterest subscribes to programs of interest updates from the BlockEngineRelayer service. It returns a client for receiving these updates.
type SearcherClient ¶
type SearcherClient struct { GRPCConn *grpc.ClientConn // gRPC connection RPCConn *rpc.Client // Standard RPC connection JitoRPCConn *rpc.Client // Jito RPC connection SearcherService searcher_pb.SearcherServiceClient // Searcher service client BundleStreamSubscription searcher_pb.SearcherService_SubscribeBundleResultsClient // Bundle stream subscription AuthenticationService *pkg.AuthenticationService // Authentication service ErrChan <-chan error // Error channel }
SearcherClient is a client for interacting with the Searcher service.
func NewSearcherClient ¶
func NewSearcherClient( ctx context.Context, grpcAddr string, jitoRPCClient, rpcClient *rpc.Client, keyPair *solana.PrivateKey, opts ...grpc.DialOption, ) (*SearcherClient, error)
NewSearcherClient initializes a new SearcherClient with the provided context, gRPC address, Jito and standard RPC clients, Solana private key, and additional gRPC dial options. It establishes a gRPC connection, sets up authentication if a keyPair is provided, and returns the SearcherClient.
func (*SearcherClient) GetConnectedLeaders ¶
func (c *SearcherClient) GetConnectedLeaders(opts ...grpc.CallOption) (*searcher_pb.ConnectedLeadersResponse, error)
GetConnectedLeaders retrieves the connected leaders from the Searcher service. It returns a ConnectedLeadersResponse or an error.
func (*SearcherClient) GetConnectedLeadersRegioned ¶
func (c *SearcherClient) GetConnectedLeadersRegioned(regions []string, opts ...grpc.CallOption) (*searcher_pb.ConnectedLeadersRegionedResponse, error)
GetConnectedLeadersRegioned retrieves the connected leaders for specified regions from the Searcher service. It returns a ConnectedLeadersRegionedResponse or an error.
func (*SearcherClient) GetNextScheduledLeader ¶
func (c *SearcherClient) GetNextScheduledLeader(regions []string, opts ...grpc.CallOption) (*searcher_pb.NextScheduledLeaderResponse, error)
GetNextScheduledLeader retrieves the next scheduled leader for the specified regions from the Searcher service. It returns a NextScheduledLeaderResponse or an error.
func (*SearcherClient) GetRandomTipAccount ¶
func (c *SearcherClient) GetRandomTipAccount(opts ...grpc.CallOption) (string, error)
GetRandomTipAccount retrieves a random tip account from the list of tip accounts. It returns the selected account or an error.
func (*SearcherClient) GetRegions ¶
func (c *SearcherClient) GetRegions(opts ...grpc.CallOption) (*searcher_pb.GetRegionsResponse, error)
GetRegions retrieves the regions from the Searcher service. It returns a GetRegionsResponse or an error.
func (*SearcherClient) GetTipAccounts ¶
func (c *SearcherClient) GetTipAccounts(opts ...grpc.CallOption) (*searcher_pb.GetTipAccountsResponse, error)
GetTipAccounts retrieves the tip accounts from the Searcher service. It returns a GetTipAccountsResponse or an error.
func (*SearcherClient) NewBundle ¶
func (c *SearcherClient) NewBundle(transactions []*solana.Transaction) (*bundle_pb.Bundle, error)
NewBundle creates a new bundle protobuf object from a slice of transactions. It converts the transactions into protobuf packets and includes them in the bundle.
func (*SearcherClient) NewBundleSubscriptionResults ¶
func (c *SearcherClient) NewBundleSubscriptionResults(opts ...grpc.CallOption) (searcher_pb.SearcherService_SubscribeBundleResultsClient, error)
NewBundleSubscriptionResults subscribes to bundle result updates from the Searcher service. It uses the provided gRPC call options to set up the subscription.
func (*SearcherClient) SendBundle ¶
func (c *SearcherClient) SendBundle( transactions []*solana.Transaction, opts ...grpc.CallOption, ) (*searcher_pb.SendBundleResponse, error)
SendBundle creates and sends a bundle of transactions to the Searcher service. It converts transactions to a protobuf packet and sends it using the SearcherService.
func (*SearcherClient) SendBundleWithConfirmation ¶
func (c *SearcherClient) SendBundleWithConfirmation( ctx context.Context, transactions []*solana.Transaction, opts ...grpc.CallOption, ) (*BundleResponse, error)
SendBundleWithConfirmation sends a bundle of transactions and waits for confirmation of signatures. It attempts to send the bundle, then continuously checks for the result of the bundle and validates the signatures of the transactions.
type Validator ¶
type Validator struct { GRPCConn *grpc.ClientConn // gRPC connection Client block_engine_pb.BlockEngineValidatorClient // Validator client AuthenticationService *pkg.AuthenticationService // Authentication service ErrChan <-chan error // Error channel }
Validator is a client for interacting with the Block Engine Validator service.
func NewValidator ¶
func NewValidator( ctx context.Context, grpcAddr string, keyPair *solana.PrivateKey, opts ...grpc.DialOption, ) (*Validator, error)
NewValidator initializes a new Validator with the provided context, gRPC address, and Solana private key. It establishes a gRPC connection, sets up authentication if a keyPair is provided, and returns the Validator.
func (*Validator) GetBlockBuilderFeeInfo ¶
func (v *Validator) GetBlockBuilderFeeInfo( opts ...grpc.CallOption, ) (*block_engine_pb.BlockBuilderFeeInfoResponse, error)
GetBlockBuilderFeeInfo retrieves the block builder fee information from the BlockEngineValidator service. It returns a BlockBuilderFeeInfoResponse or an error.
func (*Validator) OnBundleSubscription ¶
func (v *Validator) OnBundleSubscription(ctx context.Context) ( <-chan []*bundle_pb.BundleUuid, <-chan error, error)
OnBundleSubscription subscribes to bundle updates and handles the incoming updates and errors. It returns channels for the updates and errors.
func (*Validator) OnPacketSubscription ¶
func (v *Validator) OnPacketSubscription( ctx context.Context, ) (<-chan *block_engine_pb.SubscribePacketsResponse, <-chan error, error)
OnPacketSubscription subscribes to packet updates and handles the incoming updates and errors. It returns channels for the updates and errors.
func (*Validator) SubscribeBundles ¶
func (v *Validator) SubscribeBundles( opts ...grpc.CallOption, ) (block_engine_pb.BlockEngineValidator_SubscribeBundlesClient, error)
SubscribeBundles subscribes to bundle updates from the BlockEngineValidator service. It returns a client for receiving these updates.
func (*Validator) SubscribePackets ¶
func (v *Validator) SubscribePackets( opts ...grpc.CallOption, ) (block_engine_pb.BlockEngineValidator_SubscribePacketsClient, error)
SubscribePackets subscribes to packet updates from the BlockEngineValidator service. It returns a client for receiving these updates.