Documentation ¶
Overview ¶
Package opdevnet contains helpers to build and run an OP devnet, including the L1 but excluding the OP execution engine.
Index ¶
- Variables
- func DefaultDeployConfig(l1Deployments *genesis.L1Deployments) (*genesis.DeployConfig, error)
- func DefaultL1Allocs() (*foundry.ForgeAllocs, error)
- func DefaultL1Deployments() (*genesis.L1Deployments, error)
- func DefaultL2Allocs() (*foundry.ForgeAllocs, error)
- func EncodePrivKey(priv *ecdsa.PrivateKey) hexutil.Bytes
- func EncodePrivKeyToString(priv *ecdsa.PrivateKey) string
- type Addresses
- type L1Config
- type MnemonicConfig
- type OPConfig
- type Secrets
Constants ¶
This section is empty.
Variables ¶
var DefaultMnemonicConfig = &MnemonicConfig{
Mnemonic: "test test test test test test test test test test test junk",
CliqueSigner: "m/44'/60'/0'/0/0",
Proposer: "m/44'/60'/0'/0/1",
Batcher: "m/44'/60'/0'/0/2",
Deployer: "m/44'/60'/0'/0/3",
Alice: "m/44'/60'/0'/0/4",
SequencerP2P: "m/44'/60'/0'/0/5",
Bob: "m/44'/60'/0'/0/7",
Mallory: "m/44'/60'/0'/0/8",
SysCfgOwner: "m/44'/60'/0'/0/9",
}
DefaultMnemonicConfig is the default mnemonic used in testing. We prefer a mnemonic rather than direct private keys to make it easier to export all testing keys in external tooling for use during debugging. If these values are changed, it is subject to breaking tests. They must be in sync with the values in the DeployConfig used to create the system.
Functions ¶
func DefaultDeployConfig ¶
func DefaultDeployConfig(l1Deployments *genesis.L1Deployments) (*genesis.DeployConfig, error)
func DefaultL1Allocs ¶
func DefaultL1Allocs() (*foundry.ForgeAllocs, error)
func DefaultL1Deployments ¶
func DefaultL1Deployments() (*genesis.L1Deployments, error)
func DefaultL2Allocs ¶
func DefaultL2Allocs() (*foundry.ForgeAllocs, error)
func EncodePrivKey ¶
func EncodePrivKey(priv *ecdsa.PrivateKey) hexutil.Bytes
EncodePrivKey encodes the given private key in 32 bytes
func EncodePrivKeyToString ¶
func EncodePrivKeyToString(priv *ecdsa.PrivateKey) string
Types ¶
type Addresses ¶
type Addresses struct { Deployer common.Address CliqueSigner common.Address SysCfgOwner common.Address // rollup actors Proposer common.Address Batcher common.Address SequencerP2P common.Address // prefunded L1/L2 accounts for testing Alice common.Address Bob common.Address Mallory common.Address }
Addresses bundles the addresses for all common rollup addresses for testing purposes.
type L1Config ¶
type L1Config struct { Genesis *core.Genesis BlobsDirPath string BlockTime uint64 URL *e2eurl.URL BeaconURL *e2eurl.URL }
func BuildL1Config ¶
func BuildL1Config( deployConfig *genesis.DeployConfig, l1Deployments *genesis.L1Deployments, l1Allocs *foundry.ForgeAllocs, url *e2eurl.URL, beaconURL *e2eurl.URL, blobsDirPath string, ) (*L1Config, error)
type MnemonicConfig ¶
type MnemonicConfig struct { Mnemonic string CliqueSigner string Deployer string SysCfgOwner string // rollup actors Proposer string Batcher string SequencerP2P string // prefunded L1/L2 accounts for testing Alice string Bob string Mallory string }
MnemonicConfig configures the private keys for the hive testnet. It's json-serializable, so we can ship it to e.g. the hardhat script client.
func (*MnemonicConfig) Secrets ¶
func (m *MnemonicConfig) Secrets() (*Secrets, error)
Secrets computes the private keys for all mnemonic paths, which can then be kept around for fast precomputed private key access.
type OPConfig ¶
type OPConfig struct { Proposer *proposer.CLIConfig Batcher *batcher.CLIConfig Node *opnode.Config }
func BuildOPConfig ¶
func BuildOPConfig( deployConfig *opgenesis.DeployConfig, batcherPrivKey *ecdsa.PrivateKey, proposerPrivKey *ecdsa.PrivateKey, l1Header *types.Header, l2OutputOracleAddr common.Address, l2Genesis eth.BlockID, l1URL *e2eurl.URL, opNodeURL *e2eurl.URL, l2EngineURL *e2eurl.URL, l2EthURL *e2eurl.URL, beaconURL *e2eurl.URL, jwtSecret [32]byte, ) (*OPConfig, error)
type Secrets ¶
type Secrets struct { Deployer *ecdsa.PrivateKey CliqueSigner *ecdsa.PrivateKey SysCfgOwner *ecdsa.PrivateKey // rollup actors Proposer *ecdsa.PrivateKey Batcher *ecdsa.PrivateKey SequencerP2P *ecdsa.PrivateKey // prefunded L1/L2 accounts for testing Alice *ecdsa.PrivateKey Bob *ecdsa.PrivateKey Mallory *ecdsa.PrivateKey // Share the wallet to be able to generate more accounts Wallet *hdwallet.Wallet }
Secrets bundles secp256k1 private keys for all common rollup actors for testing purposes.