Deployer
op-deployer
simplifies the process of deploying the OP Stack. It works similarly to Terraform (opens in a new tab). Like Terraform, you define a declarative config file called an "intent," then run a command to apply the intent to your chain. op-deployer
will compare the state of your chain against the intent, and make whatever changes are necessary for them to match. In its current state, it is intended to deploy new standard chains that utilize the Superchain wide contracts.
Installation
The recommended way to install op-deployer
is to download the latest release from the monorepo's
release page (opens in a new tab). To install a release, download the binary
for your platform then extract it somewhere on your PATH
. The rest of this tutorial will assume that you have
installed op-deployer
using this method.
Deployment usage
The base use case for op-deployer
is deploying new OP Chains. This process is broken down into three steps:
init
: configure your chain
To get started with op-deployer
, create an intent file that defines your desired chain configuration. Use the built-in op-deployer
utility to generate this file:
op-deployer uses a declarative intent file to determine how a new chain should be configured. Then, it runs through a deployment pipeline to actually deploy the chain.
./bin/op-deployer init --l1-chain-id 11155111 --l2-chain-ids <l2-chain-id> --workdir .deployer
Replace <l2-chain-id>
with the exact value.
This command will create a directory called .deployer
in your current working directory containing the intent file and an empty state.json
file. state.json
is populated with the results of your deployment, and never needs to be edited directly.
Your intent file will need to be modified to your parameters, but it will initially look something like this:
Do not use the default addresses in the intent for a production chain! They are generated from the test... junk
mnemonic. Any funds they hold will be stolen on a live chain.
configType = "standard-overrides"
l1ChainID = 11155111 # The chain ID of Sepolia (L1) you'll be deploying to.
fundDevAccounts = true # Whether or not to fund dev accounts using the test... junk mnemonic on L2.
l1ContractsLocator = "tag://op-contracts/v1.8.0-rc.4" # L1 smart contracts versions
l2ContractsLocator = "tag://op-contracts/v1.7.0-beta.1+l2-contracts" # L2 smart contracts versions
# Delete this table if you are using the shared Superchain contracts on the L1
# If you are deploying your own SuperchainConfig and ProtocolVersions contracts, fill in these details
[superchainRoles]
proxyAdminOwner = "0x1eb2ffc903729a0f03966b917003800b145f56e2"
protocolVersionsOwner = "0x79add5713b383daa0a138d3c4780c7a1804a8090"
guardian = "0x7a50f00e8d05b95f98fe38d8bee366a7324dcf7e"
# List of L2s to deploy. op-deployer can deploy multiple L2s at once
[[chains]]
# Your chain's ID, encoded as a 32-byte hex string
id = "0x00000000000000000000000000000000000000000000000000000a25406f3e60"
# Update the fee recipient contract
baseFeeVaultRecipient = "0x100f829718B5Be38013CC7b29c5c62a08D00f1ff"
l1FeeVaultRecipient = "0xbAEaf33e883068937aB4a50871f2FD52e241013A"
sequencerFeeVaultRecipient = "0xd0D5D18F0ebb07B7d728b14AAE014eedA814d6BD"
eip1559DenominatorCanyon = 250
eip1559Denominator = 50
eip1559Elasticity = 6
# Various ownership roles for your chain. When you use op-deployer init, these roles are generated using the
# test... junk mnemonic. You should replace these with your own addresses for production chains.
[chains.roles]
l1ProxyAdminOwner = "0xdf5a644aed1b5d6cE0DA2aDd778bc5f39d97Ac88"
l2ProxyAdminOwner = "0xC40445CD88dDa2A410F86F6eF8E00fd52D8381FD"
systemConfigOwner = "0xB32296E6929F2507dB8153A64b036D175Ac6E89e"
unsafeBlockSigner = "0xA53526b516df4eEe3791734CE85311569e0eAD78"
batcher = "0x8680d36811420359093fd321ED386a6e76BE2AF3"
proposer = "0x41b3B204099771aDf857F826015703A1030b6675"
challenger = "0x7B51A480dAeE699CA3a4F68F9AAA434452112eF7"
By default, op-deployer
will fill in all other configuration variables with those that match the standard configuration (opens in a new tab). You can override these default settings by adding them to your intent file using the table below:
[globalDeployOverrides]
l2BlockTime = 1 # 1s L2blockTime is also standard, op-deployer defaults to 2s
You can also do chain by chain configurations in the chains
table.
apply
: deploy your chain
Hardware wallets are not supported, but you can use ephemeral hot wallets since this deployer key has no privileges.
Now that you've created your intent file, you can apply it to your chain to deploy the L1 smart contracts:
./bin/op-deployer apply --workdir .deployer --l1-rpc-url <rpc-url> --private-key <private key hex>
- Replace
<rpc-url>
with yourL1_RPC_URL
and<private key>
with your private key
This command will deploy the OP Stack to L1. It will deploy all L2s specified in the intent file. Superchain configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the Superchain pause (opens in a new tab) and will use the same protocol versions (opens in a new tab) address as other chains on the Superchain.
inspect
: generate genesis files and chain information
To add your chain to the Superchain Registry (opens in a new tab) you will need to provide the chain artifacts. To get these chain artifacts, you will need to write the output of these commands to new files.
Inspect the state.json
file by navigating to your working directory. With the contracts deployed, generate the genesis and rollup configuration files by running the following commands:
./bin/op-deployer inspect genesis --workdir .deployer <l2-chain-id> > .deployer/genesis.json
./bin/op-deployer inspect rollup --workdir .deployer <l2-chain-id> > .deployer/rollup.json
Now that you have your genesis.json
and rollup.json
you can spin up a node on your network. You can also use the following inspect subcommands to get additional chain artifacts:
./bin/op-deployer inspect l1 --workdir .deployer <l2-chain-id> # outputs all L1 contract addresses for an L2 chain
./bin/op-deployer inspect deploy-config --workdir .deployer <l2-chain-id> # outputs the deploy config for an L2 chain
./bin/op-deployer inspect l2-semvers --workdir .deployer <l2-chain-id> # outputs the semvers for all L2 chains
Bootstrap usage
The bootstrap commands are specialized tools primarily used for initializing a new superchain on an L1 network that hasn't previously hosted one.
Available commands
op-deployer bootstrap superchain
op-deployer bootstrap implementations
op-deployer bootstrap proxy
Use cases
The bootstrap commands are specifically designed for scenarios such as:
- Setting up a superchain on a new EVM-compatible L1.
- Initializing superchain contracts on a new Ethereum testnet (e.g., an alternative to Sepolia).
- Creating the foundational infrastructure for a brand new superchain deployment.
For standard chain deployments, use the op-deployer apply
command.
Next steps
- For more details, check out the tool and documentation in the op-deployer repository (opens in a new tab).
- For more information on OP Contracts Manager, refer to the OPCM documentation.