op-node implements rollup-specific functionality as the Consensus Layer, similar to an L1 beacon node. It provides RPC methods for querying rollup state, managing peers, and controlling sequencer operations.
Use
eth_gasPrice instead of rollup_gasPrices for the L2 gas price.
For the L1 gas price, you can call the GasPriceOracle’s l1BaseFee function.
If you want to estimate the cost of a transaction, you can use the SDK.Making RPC Requests
The following examples show you how to make requests withcurl and cast.
Protip: piping these commands into
jq will give you nicely formatted JSON responses.$ cast rpc optimism_syncStatus --rpc-url http://localhost:9545 | jqoptimism Namespace
Optimism-specific rollup methods for querying chain state and configuration.optimism_outputAtBlock
Get the output root at a specific block. This method is documented in the specifications.- curl
- cast
optimism_syncStatus
Get the synchronization status of the rollup node. This method provides detailed information about L1 and L2 block processing states.- curl
- cast
optimism_rollupConfig
Get the rollup configuration parameters.- curl
- cast
optimism_version
Get the software version of the op-node.At the moment, building from source will not give you the correct version, but our docker images will.
- curl
- cast
opp2p Namespace
Theopp2p namespace handles peer-to-peer networking interactions, allowing you to manage peer connections, discovery, and network policies.
opp2p_self
Returns your node’s peer information including peer ID, addresses, and network configuration.- curl
- cast
opp2p_peers
Returns a list of your node’s peers with detailed connection information.- curl
- cast
opp2p_peerStats
Returns aggregate statistics about your peer connections.- curl
- cast
opp2p_discoveryTable
Returns your peer discovery table containing node records (ENRs) of discovered peers.- curl
- cast
opp2p_blockPeer
Blocks a peer by peer ID, preventing future connections.- curl
- cast
opp2p_unblockPeer
Unblocks a previously blocked peer.- curl
- cast
opp2p_listBlockedPeers
Returns a list of blocked peer IDs.- curl
- cast
opp2p_blockAddr
Blocks connections from a specific IP address.- curl
- cast
opp2p_unblockAddr
Unblocks a previously blocked IP address.- curl
- cast
opp2p_listBlockedAddrs
Returns a list of blocked IP addresses.- curl
- cast
opp2p_blockSubnet
Blocks connections from a specific subnet (CIDR notation).- curl
- cast
opp2p_unblockSubnet
Unblocks a previously blocked subnet.- curl
- cast
opp2p_listBlockedSubnets
Returns a list of blocked subnets.- curl
- cast
opp2p_protectPeer
Protects a peer from being pruned from the connection pool.- curl
- cast
opp2p_unprotectPeer
Removes protection from a peer, allowing it to be pruned if necessary.- curl
- cast
opp2p_connectPeer
Initiates a connection to a peer using its multiaddress.- curl
- cast
opp2p_disconnectPeer
Disconnects from a specific peer.- curl
- cast
admin Namespace
Administrative methods for controlling sequencer operations and the derivation pipeline.admin_resetDerivationPipeline
Resets the derivation pipeline, forcing it to re-derive L2 blocks from L1 data.- curl
- cast
admin_startSequencer
Starts the sequencer if it was previously stopped. This allows the node to begin producing new blocks.- curl
- cast
admin_stopSequencer
Stops the sequencer, preventing it from producing new blocks. The node will continue to sync from other sequencers.- curl
- cast
admin_sequencerActive
Returns whether the sequencer is currently active and producing blocks.- curl
- cast