Documentation
¶
Overview ¶
Package rpcsource lives outside package sync because rpc/v10, whose types it decodes, imports sync.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mode ¶
type Mode uint8
func (Mode) MarshalText ¶
func (Mode) MarshalYAML ¶
func (*Mode) UnmarshalText ¶
type Option ¶
type Option func(*Source)
func WithErrorPause ¶
WithErrorPause sets how long BlockByNumber waits before returning an error.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func New ¶
func New( chain *blockchain.Blockchain, client *rpc.Client, feeder sync.DataSource, mode Mode, logger log.StructuredLogger, opts ...Option, ) *Source
func (*Source) BlockByNumber ¶
func (s *Source) BlockByNumber( ctx context.Context, blockNumber uint64, ) (sync.CommittedBlock, error)
BlockByNumber pauses before reporting an RPC error: the synchronizer refetches as soon as it fails, most often while polling for a block the remote doesn't have yet.