Sunrise's Data Availability Layer supports Layer 2 blockchains created using OP Stack This is a guide to connecting an L2 chain created using OP Stack to Sunrise chain with Sunrise Data. Data Availability layer is supported in Sunrise v0.3.0 and later.
This version of the OP Stack requires the L1 EVM chain for operation. Use some kind of testnet or local chain.
How to set up OP Stack
As an example, here is how to use OP Stack to create an L2 chain and run it on the Sunrise's Data Availability Layer.
This guide uses the Ethereum Sepolia testnet to meet the OP Stack requirements, but a local EVM chain will also work.
Dependencies
Dependencies and general installation instructions for Ubuntu 22.04.
γWe have confirmed the operation with the latest version at the time of document update. If you use other versions, please check the differences.
Run the following to check you have all dependencies
Build all packages associated with Optimism
If you are having issues with this step, make sure your versions match those in the optimism docs. Specifically, you may have to downgrade your go version.
Clone and build op-geth
γ For more information on supported `op-geth, please check the Production Releases in the optimism repository.
Fill out environment variables
Run the script to generate addresses with the following command in the optimism repo: ./packages/contracts-bedrock/scripts/getting-started/wallets.sh
The output will look like the following which will you need to paste into the environment file as well:
API key for RPC URL can be found in Infura or other providers.
Fund the addresses with enough Sepolia ETH, the optimism docs recommend the following:
Load environment variables with direnv direnv allow You should see something similar to this after:
If you do not see any output, try
nano ~/.zshrc
nano ~/.bashrc
Add the following line depending on whether you use bash or zsh
Save the changes with
source ~/.zshrc
source ~/.bashrc
Configure the network
You can view the config in the deploy-config/getting-started.json file Add the following at the bottom of the config generated
Deploy the L1 contracts
L2 Allocs
Use your L2 chain id in --chain.
If you see a nondescript error that includes EvmError: Revert and Script failed then you likely need to change the IMPL_SALT environment variable. This variable determines the addresses of various smart contracts that are deployed via CREATE2(opens in a new tab). If the same IMPL_SALT is used to deploy the same contracts twice, the second deployment will fail. You can generate a new IMPL_SALT by running direnv allow anywhere in the Optimism Monorepo.
Generate the L2 config files
Check the end of the generated rollup.json
Create an authentication key
Copy genesis files into op-geth directory
Initialize op-geth
Start L2
Before optimism start, set up sunrised & sunrise-data, etc.