Discover how to utilize Avail as a data availability layer.
Introduction
Embark on setting up your own OP stack chain in alt-da mode using Avail as Data Availability layer . This guide targets Ethereum's Sepolia testnet and Avail Turing testnet. For a detailed understanding, review the Optimism Documentation.
Prerequisites
Ensure you have installed the following software.
Installation commands are based on Ubuntu 24.04 LTS:
Admin:Successfully created new keypair.Address: 0xc4A01194958DE0D90A876e8A5fc9D7B530072148Private key: 0xb8e39bd94a210e410c4024e1cc91014de45a5eb1e42f3aa99a368b5a5ac19b45Proposer:Successfully created new keypair.Address: 0xFC0374Ae658e46cA4022acA179d3cb6D8e1A4934Private key: 0xa9bc1b3f5deb1e00251df68bf86e3493b25bc5430665433546f2f9aacc748d1aBatcher:Successfully created new keypair.Address: 0xD6857B5BE9468Be67d64ABaB48459378d5329b96Private key: 0xe9cd8960fc7984a301d567b819e0c62871eb2c7239c2e66b8f319eaa45c3cbd5Sequencer:Successfully created new keypair.Address: 0x33348817E4B1192D576C4f157e9a5EC93dc5392DPrivate key: 0xd98b49e11e4e0be9931017831395e6644a50c36285d08e14d1a479af5ee08675
You'll need to fund Admin, Proposer, and Batcher with Sepolia ETH (0.5 ETH for Admin, 0.2 ETH for Proposer, 0.1 ETH for Batcher).
⚠️Warning
NOTE FOR PRODUCTION
Use secure hardware for key management in production environments.
cast wallet is not designed for production deployments.
Generate a jwt.txt file, which is crucial for the secure interaction between op-node and op-geth client:
openssl rand -hex 32 > jwt.txt
Contract Deployment using op-deployer
Deploy essential L1 contracts for the chain’s functionality:
cd op-nodegit checkout op-node/v1.13.3make op-node
Move the rollup.json and jwt.txt files into its directory:
cp rollup.json ~/op-nodecp jwt.txt ~/op-node
Run op-node
# Set env variable from `.envrc`direnv allow .## Run op-node./bin/op-node \--l2=http://localhost:8551 \--l2.jwt-secret=./jwt.txt \--sequencer.enabled \--sequencer.l1-confs=5 \--verifier.l1-confs=4 \--rollup.config=./rollup.json \--rpc.addr=0.0.0.0 \--rpc.port=8547 \--p2p.disable \--rpc.enable-admin \--p2p.sequencer.key=$GS_SEQUENCER_PRIVATE_KEY \--l1=$L1_RPC_URL \--l1.rpckind=$L1_RPC_KIND \--altda.enabled=true \--altda.da-server=$DA_SERVER_HTTP_URL \--altda.da-service=true \--l1.beacon.ignore=true
Block creation will commence once op-node starts processing L1 information and interfaces with op-geth.To optimize synchronization and avoid network resource waste:
Disable p2p sync (--p2p.disable) by default.
Use specific command line parameters for synchronization among multiple nodes.
cd op-batchergit checkout op-batcher/v1.13.2make op-batcher
Run op-batcher
# Set env variable from `.envrc`direnv allow .## Run op-batcher./bin/op-batcher \--l2-eth-rpc=http://localhost:8545 \--rollup-rpc=http://localhost:8547 \--poll-interval=1s \--sub-safety-margin=6 \--num-confirmations=1 \--safe-abort-nonce-too-low-count=3 \--resubmission-timeout=30s \--rpc.addr=0.0.0.0 \--rpc.port=8548 \--rpc.enable-admin \--max-channel-duration=25 \--l1-eth-rpc=$L1_RPC_URL \--private-key=$GS_BATCHER_PRIVATE_KEY \--altda.enabled=true \--altda.da-service=true \--altda.da-server=$DA_SERVER_HTTP_URL \--throttle-threshold=0
Adjust the --max-channel-duration=n setting to balance transaction frequency on L1 and the operational costs of the batcher. Recommended is a minimum of 2 since avail block time is 20s and ethereum's 12sec.
You now have a fully operational Avail-Powered Optimism-based EVM Rollup. You can interact with your Rollup the same way you'd interact with any other EVM chain. Send some transactions, deploy some contracts, and see what happens!