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.
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
cd ~
git clone https://github.com/ethereum-optimism/op-geth.git
cd op-geth
make geth
γ For more information on supported `op-geth, please check the Production Releases in the optimism repository.
Fill out environment variables
cd ~/optimism
cp .envrc.example .envrc
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:
##################################################
# Getting Started #
##################################################
# Admin account
export GS_ADMIN_ADDRESS=0x82eeB61600f290ce3F9400d345aAEcBe5faF7AEB
export GS_ADMIN_PRIVATE_KEY=0x7c726817d047ee62cbb060312fe2620ba5462495e34f7e8279ba22faa96bca20
# Batcher account
export GS_BATCHER_ADDRESS=0x7BECbC4C747922d92e4F917951D9D8c3Ada7eb60
export GS_BATCHER_PRIVATE_KEY=0xc7dfaa7b8449f00480196377da50d29318b2397fd0296d0ab4f11d48ee3cf723
# Proposer account
export GS_PROPOSER_ADDRESS=0x773F4527fECc889d6DD3Cd7d044F4AC1Ad765a31
export GS_PROPOSER_PRIVATE_KEY=0xed6029a5928e83c5d2a28d9574304bae9a825e19f7f18a50d34edc13b505afed
# Sequencer account
export GS_SEQUENCER_ADDRESS=0x2B43c41FCbabc5437A6E1B97F47cA085a4B16f61
export GS_SEQUENCER_PRIVATE_KEY=0x0a7d4ce467fe4d00b8930215c98335e06c16db34cd501c8c3f3173015487662e
##################################################
# Chain Information #
##################################################
# L1 chain information
export L1_CHAIN_ID=11155111
export L1_BLOCK_TIME=12
# L2 chain information
export L2_CHAIN_ID=42069
export L2_BLOCK_TIME=2
##################################################
# op-node Configuration #
##################################################
# The kind of RPC provider, used to inform optimal transactions receipts
# fetching. Valid options: alchemy, quicknode, infura, parity, nethermind,
# debug_geth, erigon, basic, any.
export L1_RPC_KIND=infura
##################################################
# Contract Deployment #
##################################################
# RPC URL for the L1 network to interact with
export L1_RPC_URL=https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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:
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.