Deploy Arbitrum Orbit with Avail DA

This guide follows the deployment of an Arbitrum Orbit chain (L3) with Arbitrum Sepolia (L2) as the base chain. You can follow the same steps with any other supported chains with the relevant contract addresses.

Prerequisites

Docker

Avail

Arbitrum Sepolia

Download avail-nitro-node docker image

Step-1: Download the avail-nitro-node (opens in a new tab) image from docker hub

docker pull availj/avail-nitro-node:v2.2.1-upstream-v3.2.1

Deploy Rollup Contracts

Step-1: Clone the arbitrum-orbit-sdk (opens in a new tab) with AvailDA

git clone https://github.com/availproject/arbitrum-orbit-sdk.git
git checkout avail-develop-upstream-v0.20.1
cd arbitrum-orbit-sdk/examples/create-avail-rollup-eth

Step-2: Create .env file

Create a copy of .env.sample as .env file and edit the following:

  • Set EVM account keys of settlement layer

    DEPLOYER_PRIVATE_KEY :- Orbit rollup owner, Rollup contract deployer
    BATCH_POSTER_PRIVATE_KEY -: Batch poster
    VALIDATOR_PRIVATE_KEY :- Validator
  • Set avail account info for DA submissions

    AVAIL_ADDR_SEED=
    AVAIL_APP_ID=
  • Set Fallback S3, if you want to enable S3 storage as a fallback for AvailDA (its an optional feature)

    • Fill these required details where make FALLBACKS3_ENABLE = true
    FALLBACKS3_ENABLE=true
    FALLBACKS3_ACCESS_KEY=
    FALLBACKS3_SECRET_KEY=
    FALLBACKS3_REGION=
    FALLBACKS3_OBJECT_PREFIX=
    FALLBACKS3_BUCKET=
  • Set parent chain rpc URL (other than infura will also works)

    PARENT_CHAIN_RPC=https://arbitrum-sepolia.infura.io/v3/YOUR_API_KEY

Step-3: Rollup contract deployment

  • Run avail orbit rollup deployment command

    npm run deploy-avail-orbit-rollup
  • You will find this kind of log


    nitro-stack

  • You will get to see two files added nodeConfig.json and orbitSetupScriptConfig.json, which will be need in next step spin and set up avail orbit rollup

Before proceeding, let's briefly review what just happened:

  1. You submitted a deployment transaction to an Orbit "factory" smart contract on the Arbitrum Sepolia testnet, the public L2 chain that your local Orbit chain will settle transactions to.
  2. This Orbit smart contract then initialized your Orbit chain's base contracts with the values that you specified in the previous step, and deployed these base contracts to the Arbitrum Sepolia testnet.

Your Orbit chain's base contracts are responsible for facilitating the exchange of information between your chain's node(s) and its base chain's nodes. This includes the batch posting of transactions from your Orbit chain to its base chain, the staking of tokens by your Orbit chain's validators the challenge mechanism, bridging mechanisms, and more.

Spin up the avail orbit rollup chain using orbit-setup-script

Step-1: Download orbit-setup-script (opens in a new tab)

git clone https://github.com/availproject/orbit-setup-script.git
cd orbit-setup-script

Step-2 :- Run your chain

Add the nodeConfig.json and orbitSetupScriptConfig.json in ./config , that you get after completing Deploy Rollup contracts

cd orbit-setup-script
docker-compose up -d

A Nitro node and BlockScout explorer instance will be started. Visit http://localhost:4000/ (opens in a new tab) to access your BlockScout explorer instance - this will allow you to view your chain's transactions and blocks, which can be useful for debugging.

Step-3: Final Setup - Token bridge deployment

A Hardhat script that handles the following tasks:

  1. Fund the batch-poster and validator (staker) accounts on your underlying L2 chain.
  2. Deposit ETH into your account on the chain using your chain's newly deployed bridge.
  3. Deploy your Token Bridge contracts on both L2 and local Orbit chains.
  4. Configure parameters on the chain.

To run this script, issue the following command from the root of the orbit-setup-script repository, replacing OxYourPrivateKey with the private key of the Owner account you used to deploy your chain's contracts, and replacing http://localhost:8449 with the RPC URL of your chain's node.

PRIVATE_KEY="0xYourPrivateKey" L2_RPC_URL="https://sepolia-rollup.arbitrum.io/rpc" L3_RPC_URL="http://localhost:8449" yarn run setup

Hurray!

Congratulations, Your local Orbit chain with Avail DA is now running.

Appendix A:- Use Arbitrum bridge for your local chain

After completing final setup, you can find two files network.json and outputInfo.json. Add in your avail orbit rollup testnet to the bridge (opens in a new tab). This will only be for local testing. Paste outputInfo.json configuration in setting section of bridge

Appendix B: Logging

Run this command in the root directory of your orbit setup script repo to view your chain's logs:

docker-compose logs -f nitro

Appendix C: Depositing ETH/native token

If you need to deposit more ETH (or native tokens) into your Orbit chain account, run this command on the base directory of the setup script, replacing 0xYourPrivateKey with the private key of the originating account, and <AMOUNT> with the amount to send:

Using Arbitrum Sepolia:

PRIVATE_KEY="0xYourPrivateKey" L2_RPC_URL="https://sepolia-rollup.arbitrum.io/rpc" L3_RPC_URL="http://localhost:8449"
AMOUNT="<AMOUNT>" yarn run deposit

Appendix D: Refunding (For testing environments)

Once you're done with your local Orbit chain and want to refund any remaining balance from the batch poster and validator wallets, you can use the refund script by running:

PRIVATE_KEY="0xYourPrivateKey" L2_RPC_URL="<https://sepolia-rollup.arbitrum.io/rpc>" TARGET_ADDRESS="0xYourTargetAddress" yarn run refund

Make sure to replace "0xYourPrivateKey" with the private key of the wallet you used to deploy the rollup contracts, and "0xYourTargetAddress" with the address where you want to receive the refunded funds.

This will transfer any remaining balance from the batch poster and validator wallets to the specified target address.

Appendix E: Troubleshooting

You may see error getting latest batch count in your node's output logs (from Appendix B). This is usually safe to ignore. It's usually displayed when your Orbit chain's base contract deployment isn't yet finalized on the L1 chain. This finalization can take 15-20 minutes, but don't worry - the deployment doesn't need to be L1-finalized in order for your chain to function properly.

Learn more about customizing and using your Orbit chain from the Arbitrum Orbit Docs (opens in a new tab).

Reference

Currently chains supporting Arbitrum orbit chain deployment with AvailDA:-

Soon will add more chains

Smart contract addresses

The following information may be useful to those building on Arbitrum. We list the addresses of the smart contracts related to the protocol

Arbitrum Sepolia (opens in a new tab)Base Sepolia (opens in a new tab)
RollupCreator0xE917553b67f630C3982236B6A1d7844B1021B9090x66667c90de1E169e705F248614c72076aA1a2240
Bridge0x4A9722A440506469CcA933969f790923Ac59A0A50x6a7a97E34E6D75724BB58C0d8EFF8cEB27b23A56
AvailDABridge0x5EE5FAd194260bF039b32DEe0bC3D809989A3d000x36cE36dc5BE3E89F6B25315d8346503B307546A6
SequencerInbox0xA04d516D245D1E11Eb7cF8D38Ec1540A25c2DCB50x7C44660caB5b6d330cd38a9468F3F84F2f175E9C
Inbox0x790d2BCD12Fa25db147fc033515CBCEc89d89E200x48dCee9af45842A905FDE5ff5a502EFd06862E49
RollupEventInbox0x62F82278559e8aBdCe222D1A4c2D45dFD6D8C26E0x1cd6c66A1C6b260147909bbd3211Fb9f4424A480
Outbox0xdd414356a4D573865D78D0C5E05d62686c14E3760xdB991f2943CD1A3c17FDb5b78434F4b7331bFb37
ERC20Bridge0x6582b333408D8eF71a951a77E61a263857cd570C0x3d238cf78f740E94753254f9B6339ACaa66c1574
ERC20SequencerInbox0xA878d9432DaCCb14A94EAcB8f6158954e538874a0xE6Cb93cA92f1C65D5709059456ad232721A87c02
ERC20Inbox0x7484e03fF084Fd9C1Bc30de40D7A2ed4acb22AFC0xa5E5c409f39e929087DFbb182C29FE8350Ad1bC8
ERC20RollupEventInbox0xE26d16aAb33950C7bEEcf0F46C161bAc0495dB000x09Cb2789481759613886b5747c5fE49FAb7c4650
ERC20Outbox0xC313E4F98C525b555A972a564A01bdB76D69BA100xa183436DAb3ea069010912e0beBB4c734A4aD90c
BridgeCreator0xe188683D96b82a3A1314424E5e9c438461667EdE0xE6DeCD823d1480069348931833F97C3810ea7Ea5
OneStepProver00x6404d3539B6d37ebc9AC50d7f528Ee8168ece5cC0x6032313a93F78b9Db91885E6d83e40626f371052
OneStepProverMemory0x71FF43aeb6E788B855410447Bbc1F71916Bb98Ec0x5AFee8C856386Ac18E56CdA14470637e13C1D47b
OneStepProverMath0xcCe345C15E7a9AA7784601e28811671cf41bF7110x91EF8ffce4AbB1b256662A6a6C4C7051534aD575
OneStepProverHostlo0x65DCCc4bA7836B743D2370A5fbea8Ef3263789d90x49Fb114B5c708eF2a5aa6Ba413da55E5F07389C4
OneStepProofEntry0x7452e148a7faffac053f442080DE8f305d0C86420xd0A9C68313233C568AD19B55FECac9148245Fb76
ChallengeManager0x1c8285a7BFc8E5F4960aB105ca0E595Ce80858b20x71BF09F4787187b3c62dA0a89c893Ca5687ffef0
RollupAdminLogic0x0922ce6b911B420EBC5851943Adfba40587B68520x488088F12D354b2bEe8c5d5C27Dd266f0b70c5eb
RollupUserLogic0x256E8dD36893f00E6C0c1B1099561b8322692B910x3A12b3eB213CAb423324400D49Ec7d61c903ac20
UpgradeExecutor0x0c78cDc973de62ae83D99cEe87D8bD45d5Cd20840x2F6DdA8EA7b41186c1C00980fF1b96df23E4D442
ValidatorUtils0x0911837C1cdC5b5C6ACDBc887Be223A05c3c6FDD0xCa56EB65F0C84e2BeCCd6A42Ff2ADAC5e362705e
ValidatorWalletCreator0x367Ad15A9aDFF8C2D1D51892F2d717bF2B86a3aD0xD3E785B544bf85f124fa0f3aC557127882Ed2f09
DeployHelper0xD58aa678074840c5A74c29d85A493723c4f48e8c0xaD98D017aA12d0a7A265d4BFAfd289CE9968943f
VectorX0xA712dfec48AF3a78419A8FF90fE8f97Ae74680F00x13cBE46E168460a101c07efb6Ab7B9ec637F02aA
Avail Bridge0x420953898afC97147675F793a90d3793b974698b0xBC3071f9dE256B3b9C6304731F28C98f102425De
Avail Bridge Proxy0xa3e9e20875b7A7461C4829663497F7c2baB9E13b0x9378F9E35ff46a131406FEb7a226F7da4395DB48

Previous Releases

v2.1.0-upstream-v3.1.0

v2.0.0-upstream-v2.3.1

v1.0.0

โš ๏ธ

The previous release of v1 is not recommended for install any more, but we will continue supporting it until a migration path from v1 to current release is provided.