Documentation
¶
Index ¶
- Variables
- type BadBlock
- type BadBlockFilter
- type BadBlockHandler
- type Config
- type Node
- func (n *Node) BlockNumber(ctx context.Context) (uint64, error)
- func (n *Node) ForEachBadBlock(ctx context.Context, stall time.Duration, want BadBlockFilter, ...) error
- func (n *Node) GetBlockNumberByHash(ctx context.Context, hash string) (uint64, error)
- func (n *Node) GetRawDebugBlockTrace(ctx context.Context, hash, client string) (*[]byte, error)
- func (n *Node) Metadata() *services.MetadataService
- func (n *Node) OnReady(_ context.Context, callback func(ctx context.Context) error)
- func (n *Node) Start(ctx context.Context) error
- func (n *Node) Stop() error
Constants ¶
This section is empty.
Variables ¶
var ErrBlockNotFound = errors.New("execution block not found")
ErrBlockNotFound is returned when the execution node does not know about the requested block, e.g. a gloas payload that has not been revealed yet.
Functions ¶
This section is empty.
Types ¶
type BadBlock ¶
type BadBlock struct {
// The hash of the block
Hash string `json:"hash"`
// Block is the actual bad block
Block json.RawMessage `json:"block"`
// RLP is the RLP encoded block
RLP string `json:"rlp"`
}
type BadBlockFilter ¶ added in v0.1.0
BadBlockFilter decides from the hash alone whether a bad block is worth decoding. It runs before the block's body is materialised, which is where the saving is: a node repeats every bad block it has ever seen on every poll, and nearly all of them are already indexed.
type BadBlockHandler ¶ added in v0.1.0
BadBlockHandler receives one decoded bad block at a time. The block is only valid for the duration of the call. Returning an error stops the stream.
type Config ¶
type Config struct {
// The address of the Execution node to connect to
NodeAddress string `yaml:"nodeAddress"`
TraceDisableMemory *bool `yaml:"traceDisableMemory" default:"false"`
TraceDisableStack *bool `yaml:"traceDisableStack" default:"true"`
TraceDisableStorage *bool `yaml:"traceDisableStorage" default:"false"`
}
func (*Config) GetTraceDisableMemory ¶ added in v0.0.12
func (*Config) GetTraceDisableStack ¶ added in v0.0.12
func (*Config) GetTraceDisableStorage ¶ added in v0.0.12
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) BlockNumber ¶ added in v0.1.0
BlockNumber returns the execution node's current head block number.
func (*Node) ForEachBadBlock ¶ added in v0.1.0
func (n *Node) ForEachBadBlock(ctx context.Context, stall time.Duration, want BadBlockFilter, handle BadBlockHandler) error
ForEachBadBlock streams debug_getBadBlocks and hands the blocks that pass want to handle, one at a time, while the response is still arriving. Memory is bounded by one bad block rather than by the node's whole list.
A stream that legitimately runs for minutes cannot live under a whole-request deadline, so instead the call is abandoned once no bytes have arrived for stall, headers included.
func (*Node) GetBlockNumberByHash ¶ added in v0.1.0
GetBlockNumberByHash resolves an execution block number from its hash. Returns ErrBlockNotFound if the node does not (yet) have the block.
func (*Node) GetRawDebugBlockTrace ¶
func (*Node) Metadata ¶
func (n *Node) Metadata() *services.MetadataService