Documentation
¶
Index ¶
- Variables
- func NewAdminAPI(dr driverClient, log log.Logger) *adminAPI
- func NewConductorClient(cfg *config.Config, log log.Logger, metrics *metrics.Metrics) conductor.SequencerConductor
- func NewNodeAPI(config *rollup.Config, depSet depset.DependencySet, l2Client l2EthClient, ...) *nodeAPI
- func NewOpstackAPI(eng engine.RollupAPI, publisher apis.PublishAPI) *opstackAPI
- type BeaconClient
- type ConductorClient
- func (c *ConductorClient) Close()
- func (c *ConductorClient) CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
- func (c *ConductorClient) Enabled(ctx context.Context) bool
- func (c *ConductorClient) Leader(ctx context.Context) (bool, error)
- func (c *ConductorClient) OverrideLeader(ctx context.Context) error
- type InitializationOverrides
- type L1Beacon
- type L1Client
- type L1Source
- type OpNode
- func (n *OpNode) HTTPEndpoint() string
- func (n *OpNode) HTTPPort() (int, error)
- func (n *OpNode) InteropRPC() (rpcEndpoint string, jwtSecret eth.Bytes32)
- func (n *OpNode) InteropRPCPort() (int, error)
- func (n *OpNode) P2P() p2p.Node
- func (n *OpNode) PublishBlock(ctx context.Context, signedEnvelope *opsigner.SignedExecutionPayloadEnvelope) error
- func (n *OpNode) RequestL2Range(ctx context.Context, start, end eth.L2BlockRef) error
- func (n *OpNode) RuntimeConfig() runcfg.ReadonlyRuntimeConfig
- func (n *OpNode) SignAndPublishL2Payload(ctx context.Context, envelope *eth.ExecutionPayloadEnvelope) error
- func (n *OpNode) Start(ctx context.Context) error
- func (n *OpNode) Stop(ctx context.Context) error
- func (n *OpNode) Stopped() bool
- type SafeDBReader
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyClosed = errors.New("node is already closed")
Functions ¶
func NewAdminAPI ¶
func NewConductorClient ¶ added in v1.5.0
func NewConductorClient(cfg *config.Config, log log.Logger, metrics *metrics.Metrics) conductor.SequencerConductor
NewConductorClient returns a new conductor client for the op-conductor RPC service.
func NewNodeAPI ¶
func NewNodeAPI(config *rollup.Config, depSet depset.DependencySet, l2Client l2EthClient, dr driverClient, safeDB SafeDBReader, log log.Logger) *nodeAPI
func NewOpstackAPI ¶ added in v1.13.3
func NewOpstackAPI(eng engine.RollupAPI, publisher apis.PublishAPI) *opstackAPI
Types ¶
type BeaconClient ¶ added in v1.14.3
type BeaconClient interface {
GetVersion(ctx context.Context) (string, error)
GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)
}
BeaconClient is the interface that op-node uses to interact with L1 Beacon. This allows wrapped or mocked clients to be used
type ConductorClient ¶ added in v1.5.0
type ConductorClient struct {
// contains filtered or unexported fields
}
ConductorClient is a client for the op-conductor RPC service.
func (*ConductorClient) Close ¶ added in v1.5.0
func (c *ConductorClient) Close()
func (*ConductorClient) CommitUnsafePayload ¶ added in v1.5.0
func (c *ConductorClient) CommitUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
CommitUnsafePayload commits an unsafe payload to the conductor log.
func (*ConductorClient) Enabled ¶ added in v1.9.4
func (c *ConductorClient) Enabled(ctx context.Context) bool
Enabled returns true if the conductor is enabled, and since the conductor client is initialized, the conductor is always enabled.
func (*ConductorClient) Leader ¶ added in v1.5.0
func (c *ConductorClient) Leader(ctx context.Context) (bool, error)
Leader returns true if this node is the leader sequencer.
func (*ConductorClient) OverrideLeader ¶ added in v1.8.0
func (c *ConductorClient) OverrideLeader(ctx context.Context) error
OverrideLeader implements conductor.SequencerConductor.
type InitializationOverrides ¶ added in v1.14.3
type L1Beacon ¶ added in v1.14.3
type L1Beacon interface {
GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)
}
L1Beacon provides access to L1 beacon chain data, specifically for blob data retrieval.
type L1Client ¶ added in v1.14.3
type L1Client interface {
L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)
L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1BlockRef, error)
L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error)
InfoByNumber(ctx context.Context, number uint64) (eth.BlockInfo, error)
InfoByLabel(ctx context.Context, label eth.BlockLabel) (eth.BlockInfo, error)
InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, types.Transactions, error)
InfoAndTxsByNumber(ctx context.Context, number uint64) (eth.BlockInfo, types.Transactions, error)
InfoAndTxsByLabel(ctx context.Context, label eth.BlockLabel) (eth.BlockInfo, types.Transactions, error)
FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
GetProof(ctx context.Context, address common.Address, storage []common.Hash, blockTag string) (*eth.AccountResult, error)
GetStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockTag string) (common.Hash, error)
ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error)
SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
ChainID(ctx context.Context) (*big.Int, error)
Close()
}
L1Client is the interface that op-node uses to interact with L1. This allows wrapped or mocked clients to be used
type L1Source ¶ added in v1.14.3
type L1Source interface {
L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)
L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1BlockRef, error)
L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error)
InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error)
InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, types.Transactions, error)
FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
Close()
}
L1Source provides the necessary L1 blockchain data for the node.
type OpNode ¶
type OpNode struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, cfg *config.Config, log log.Logger, appVersion string, m *metrics.Metrics) (*OpNode, error)
New creates a new OpNode instance. The provided ctx argument is for the span of initialization only; the node will immediately Stop(ctx) before finishing initialization if the context is canceled during initialization.
func NewWithOverride ¶ added in v1.14.3
func NewWithOverride(ctx context.Context, cfg *config.Config, log log.Logger, appVersion string, m *metrics.Metrics, override InitializationOverrides) (*OpNode, error)
NewWithOverride creates a new OpNode instance with optional initialization overrides. This allows callers to override specific initialization steps, enabling resource sharing (e.g., shared L1Client across multiple nodes) without duplicating connections or caches. If override is nil or any of its fields are nil, the default initialization is used for those steps.
func (*OpNode) HTTPEndpoint ¶
func (*OpNode) InteropRPC ¶ added in v1.11.0
func (*OpNode) InteropRPCPort ¶ added in v1.13.2
func (*OpNode) PublishBlock ¶ added in v1.13.3
func (*OpNode) RequestL2Range ¶
func (*OpNode) RuntimeConfig ¶ added in v1.1.6
func (n *OpNode) RuntimeConfig() runcfg.ReadonlyRuntimeConfig