Skip to content

Commit 5168dc1

Browse files
authored
Merge pull request #338 from availproject/staging
feat: updated the arbitrum-orbit docs
2 parents 385f623 + cf7fe80 commit 5168dc1

File tree

1 file changed

+114
-29
lines changed

1 file changed

+114
-29
lines changed

pages/docs/build-with-avail/Optimium/arbitrum-nitro/nitro-stack.mdx

+114-29
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,138 @@
1+
import { Callout } from 'nextra/components'
2+
13
# Deploy Arbitrum Orbit with Avail DA
24

3-
## Prerequisites
5+
### Prerequisites
46

57
1. You need to have [docker](https://docs.docker.com/engine/) and [docker-compose](https://docs.docker.com/compose/) installed on your machine.
68
2. An Avail account with some AVAIL tokens in it. You can refer to [our docs here](/docs/end-user-guide/accounts) to get started.
7-
3. This guide will use [Arbitrum's ArbSepolia](https://docs.arbitrum.io/build-decentralized-apps/public-chains#arbitrum-sepolia) and [Avail's Turing](/docs/networks) testnets.
9+
3. At least 1 ETH over Arbsepolia Testnet. You can follow [Step 1](https://docs.arbitrum.io/launch-orbit-chain/orbit-quickstart#step-1-acquire-arbitrum-testnet-eth-and-the-native-token-for-orbit-chains-with-custom-gas-tokens) on Arbitrum Orbit Doc for acquiring testnet $ETH
10+
4. This guide will use [Arbitrum's ArbSepolia](https://docs.arbitrum.io/build-decentralized-apps/public-chains#arbitrum-sepolia) and [Avail's Turing](/docs/networks) testnets.
11+
12+
<Callout type="info">
13+
This guide is based on [Arbitrum Orbit Quickstart](https://docs.arbitrum.io/launch-orbit-chain/orbit-quickstart)
14+
</Callout>
815

9-
### Step-1 :- Download avail nitro node docker image
16+
## Download avail nitro node docker image
1017

11-
1. Download the avail-nitro-node image from docker hub:- [avail-nitro-node-dev](https://hub.docker.com/repository/docker/availrishabh/avail-nitro-node-dev/tags).
18+
### Step-1: Download the [avail-nitro-node](https://hub.docker.com/repository/docker/availrishabh/avail-nitro-node-dev/tags) image from docker hub
1219

1320
```bash
1421
docker pull availrishabh/avail-nitro-node-dev:v2.3.1
1522
```
1623

1724

18-
### Step-2 :- Deploy Rollup Contracts
25+
## Deploy Rollup Contracts
1926

20-
1. Download the nitro-contract with Avail DA :- Clone the [nitro-contracts](https://github.com/availproject/nitro-contracts/tree/data-availability-verification-v2.3.1)
27+
### Step-1: Download the [nitro-contract](https://github.com/availproject/nitro-contracts/tree/data-availability-verification-v2.3.1) with Avail DA
2128

2229
```bash
2330
git clone https://github.com/availproject/nitro-contracts.git
2431
cd nitro-contracts
25-
git checkout data-availability-verifiaction-v2.3.1
32+
git checkout avail-develop-v2.3.1
2633
yarn install
2734
yarn build
2835
```
2936

30-
2. Create `.env` file as per `.env.sample` and Set Rollup Creator Address and Devnet Private key
37+
### Step-2: Create `.env` file
38+
Create a copy of `.env.sample` as `.env` file and Set Rollup Creator Address at `ROLLUP_CREATOR_ADDRESS` and Private key of well funded ArbSepolia accout in `DEVNET_PRIVKEY`
3139

3240
```bash
3341
ROLLUP_CREATOR_ADDRESS="0xADCBE5c221566FA6e6Ebf5BA08759c83177DfCDA"
42+
DEVNET_PRIVKEY="<--Private-key-->"
3443
```
3544

36-
3. Set the config file `scripts/config.ts` with required configurations where `wasmModuleRoot`.
37-
This must be based on your cpu arch.
45+
### Step-3: Create `.script/config.ts` file
46+
47+
Create a copy of `scripts/config.ts.example` as `scripts/config.ts` and set this config file with required configurations where `wasmModuleRoot` must be this based on your cpu arch
3848

3949
```jsx
4050
// for amd64
4151
wasmModuleRoot:'0xba5ff5ddc46b5c63fa02168819b8e236fa18b4b551f20eba378e3543477298bf'
4252
// for arm64
4353
wasmModuleRoot:'0x1cc4dd8f036f93e37b6c9fa4edfbefaf19cf893558e9358ad41ccb3804684092'
4454
```
55+
56+
```jsx
57+
config = {
58+
rollupConfig: {
59+
confirmPeriodBlocks: ethers.BigNumber.from('45818'),
60+
extraChallengeTimeBlocks: ethers.BigNumber.from('200'),
61+
stakeToken: ethers.constants.AddressZero,
62+
baseStake: ethers.utils.parseEther('0.0001'),
63+
wasmModuleRoot:
64+
'0x1cc4dd8f036f93e37b6c9fa4edfbefaf19cf893558e9358ad41ccb3804684092',
65+
owner: '0x1234123412341234123412341234123412341234',
66+
loserStakeEscrow: ethers.constants.AddressZero,
67+
chainId: ethers.BigNumber.from('20121999'),
68+
chainConfig:
69+
'{"chainId":20121999,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0xd41996ED89bb5BF7dBfB181D8D93E8067446200B","GenesisBlockNum":0}}',
70+
genesisBlockNum: ethers.BigNumber.from('0'),
71+
sequencerInboxMaxTimeVariation: {
72+
delayBlocks: ethers.BigNumber.from('5760'),
73+
futureBlocks: ethers.BigNumber.from('12'),
74+
delaySeconds: ethers.BigNumber.from('86400'),
75+
futureSeconds: ethers.BigNumber.from('3600'),
76+
},
77+
},
78+
},
79+
validators: [
80+
'0x1234123412341234123412341234123412341234',
81+
],
82+
batchPosters: ['0x1234123412341234123412341234123412341234',],
83+
batchPosterManager: '0x1234123412341234123412341234123412341234'
84+
85+
```
86+
87+
The below table provides a brief description of each of these configuration parameters. We recommend sticking to the defaults; to learn more about customizing your Orbit chain's deployment configuration, visit [**How (and when) to customize your Orbit chain's deployment config**](https://docs.arbitrum.io/launch-orbit-chain/how-tos/customize-deployment-configuration):
88+
89+
| Parameter | Description |
90+
| --- | --- |
91+
| Chain ID(chainID) | A unique integer identifier that represents your chain's network. Your Chain ID can be submitted to chain indexes like http://chainlist.org/. For devnets, this is randomly generated for each deployment - don't worry about it for now. |
92+
| Challenge period (confirmPeriodBlocks) | The amount of time that your Orbit chain's nodes have to dispute the current state of the chain before it's confirmed (and ultimately finalized) on the underlying L2 chain (e.g. Arbitrum Sepolia). Note that this refers to the number of blocks on the underlying L1 chain (e.g. Ethereum's Sepolia chain). |
93+
| Stake token(stakeToken) | The token that your chain's validators must stake in order to participate in your chain. This is hardcoded to $ETH for now, but future versions of Orbit chains will let you specify an arbitrary ERC-20 token contract here. |
94+
| Base stake(baseStacke) | The amount of your configured Stake token that your chain's validators must stake in order to participate in your chain. Should be greater than 0. |
95+
| Owner(owner) | The administrative Ethereum address that will deploy, own, and update your chain's base contracts. This will default to your connected wallet's address. This needs to be a standard Ethereum wallet account - an EOA, not a contract address. Note that you'll have to specify this wallet's private key within a local JSON file later. |
96+
| Gas token | The address of the ERC-20 token on the parent chain that is intended to be used as the native gas token on the Orbit chain. This token must already be deployed natively on the parent chain and is bridged to the Orbit chain during chain deployment. This feature is only supported on AnyTrust chains currently, and more information around token restrictions can be found https://docs.arbitrum.io/launch-orbit-chain/how-tos/customize-deployment-configuration. |
97+
| Validators | Your chain's validators are responsible for validating the integrity of transactions and posting assertions of the current state of your Orbit chain to its base chain. Add the address in the list which you want to be added to an allow-list in your chain’s base contract |
98+
| Batch Poster | Your batch poster address is responsible for posting batches of transactions from your Orbit chain to its base contracts on its base chain. Added the address which you want to act as batch-poster for your orbit chain |
99+
100+
<Callout type="info">
101+
When we say "base contracts" and "base chain", we're referring to your Orbit chain's L2 contracts and the L2 chain that they're deployed to, respectively. We'll use these terms throughout the rest of this guide.
102+
</Callout>
103+
45104

46-
4. Now deploy rollup contract using
105+
### Step-4: Deploy your chain's base contracts to Arbitrum Sepolia!
47106

48107
```bash
49-
yarn run deploy-eth-rollup -network arbSepolia
108+
yarn run deploy-eth-rollup --network arbSepolia
50109
```
51-
52-
5. You will get to see this way of addresses:
110+
You will get to see your chain’s base contracts addresses, which will be need in next step to fill in `nodeConfig.json`
53111
<br/>
54112
<img src="/img/nitro-stack.png" alt="nitro-stack" width="100%"/>
55-
113+
<br/>
114+
Before proceeding, let's briefly review what just happened:
115+
- You submitted a deployment transaction to an Orbit "factory" smart contract on the Arbitrum testnet, the public L2 chain that your local Orbit chain will settle transactions to.
116+
- 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 testnet.
56117

57-
### Step-3 :- Spin up the chain using orbit-setup-script
118+
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.
58119

59-
1. Download orbit-setup-script:- Clone [orbit-setup-script](https://github.com/OffchainLabs/orbit-setup-script.git)
120+
## Spin up the chain using orbit-setup-script
121+
122+
### Step-1: Download [orbit-setup-script](https://github.com/OffchainLabs/orbit-setup-script.git)
60123

61124
```bash
62125
git clone https://github.com/OffchainLabs/orbit-setup-script.git
63126
cd orbit-setup-script
64127
```
65128

66-
2. Add the `nodeConfig.json` in `./config`, and update the file with the correct values as highlighted below:
67-
129+
### Step-2: Add the `nodeConfig.json` in `./config`
130+
This is the nodeConfig.json file, encapsulating your chain's node configuration. It is crucial as it contains the private keys for your validator and batch poster, essential for signing transactions for RBlocks and batch postings to your chain's base contracts on the L2 chain.
68131
```json
69132
{
70133
"chain": {
71-
"info-json": "[{\"chain-id\":555371422,\"parent-chain-id\":421614,\"parent-chain-is-arbitrum\":true,\"chain-name\":\"My Arbitrum L3 Chain\",\"chain-config\":{\"homesteadBlock\":0,\"daoForkBlock\":null,\"daoForkSupport\":true,\"eip150Block\":0,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"clique\":{\"period\":0,\"epoch\":0},\"arbitrum\":{\"EnableArbOS\":true,\"AllowDebugPrecompiles\":false,\"DataAvailabilityCommittee\":false,\"InitialArbOSVersion\":11,\"GenesisBlockNum\":0,\"MaxCodeSize\":24576,\"MaxInitCodeSize\":49152,\"InitialChainOwner\":\"0xd41996ED89bb5BF7dBfB181D8D93E8067446200B\"},\"chainId\":555371422},\"rollup\":{\"bridge\":\"0x1F4f5F72376a163B2e39db27d73CA029145d16f1\",\"inbox\":\"0x909f9B9aE47e28E4e37C06E47d848a6f49C3ed63\",\"sequencer-inbox\":\"0x4a063a85c0198887e6bA499a50e2226f8AE9F43b\",\"rollup\":\"0xC067884D8ED8EC03cB913e901A05C60532f63C02\",\"validator-utils\":\"0xB11EB62DD2B352886A4530A9106fE427844D515f\",\"validator-wallet-creator\":\"0xEb9885B6c0e117D339F47585cC06a2765AaE2E0b\",\"deployed-at\":27754620}}]",
72-
"name": "My Arbitrum L3 Chain"
134+
"info-json": "[{\"chain-id\":<Insert your chain-id>,\"parent-chain-id\":421614,\"parent-chain-is-arbitrum\":true,\"chain-name\":\"<Insert chain name>\",\"chain-config\":{\"homesteadBlock\":0,\"daoForkBlock\":null,\"daoForkSupport\":true,\"eip150Block\":0,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"clique\":{\"period\":0,\"epoch\":0},\"arbitrum\":{\"EnableArbOS\":true,\"AllowDebugPrecompiles\":false,\"DataAvailabilityCommittee\":false,\"InitialArbOSVersion\":11,\"GenesisBlockNum\":0,\"MaxCodeSize\":24576,\"MaxInitCodeSize\":49152,\"InitialChainOwner\":\"<Insert chain owner address>\"},\"chainId\":<Insert chain id>},\"rollup\":{\"bridge\":\"<Bridge proxy address>\",\"inbox\":\"<Inbox address>\",\"sequencer-inbox\":\"<Sequencer inbox address>\",\"rollup\":\"<Rollup proxy address>\",\"validator-utils\":\"<Validator until address>\",\"validator-wallet-creator\":\"<Validator wallet creator address>\",\"deployed-at\":<Insert deployed-at block number>}}]",
135+
"name": "<Insert chain name>"
73136
},
74137
"parent-chain": {
75138
"connection": {
@@ -119,12 +182,12 @@
119182
},
120183
"avail": {
121184
"enable": true,
122-
"seed": "Enter a seed phrase here",
123-
"api-url": "wss://turing-rpc.avail.so/ws",
124-
"app-id": 1,
125-
"timeout":'100s',
185+
"seed": "<Enter your seed phrase here>",
186+
"avail-api-url": "wss://turing-rpc.avail.so/ws",
187+
"app-id": "<Enter your avail app id>",
188+
"timeout":"100s",
126189
"vectorx": "0xA712dfec48AF3a78419A8FF90fE8f97Ae74680F0",
127-
"arbSepolia-rpc": "<Enter an arbSepolia RPC here>"
190+
"arbSepolia-rpc": "<Enter an arbSepolia wss url here>"
128191
}
129192
},
130193
"execution": {
@@ -141,8 +204,30 @@
141204
}
142205

143206
```
144-
145-
3. Update `docker-compose` file of `orbit-setup-script`
207+
208+
<Callout type="info">
209+
Make sure to update these params based on your chain's configuration and base contract addresses
210+
211+
<details className="border p-3 rounded-md bg-[#EFF6FF] border-[#] hover:!bg-[#EFF6FF]">
212+
<summary>
213+
List of params to be configured
214+
</summary>
215+
- `chain.chain-id`
216+
- `chain.chain-name`
217+
- `chain.InitialChainOwner`
218+
- `chain.chainId`
219+
- `chain.rollup`
220+
- `chain.name`
221+
- `node.batch-poster.parent-chain-wallet.private-key`
222+
- `node.staker.parent-chain-wallet.private-key`
223+
- `node.avail.seed`
224+
- `node.avail.app-id`
225+
- `node.avail.arbSepolia-rpc`
226+
227+
</details>
228+
</Callout>
229+
230+
### Step-3: Update `docker-compose` file of `orbit-setup-script`
146231
147232
```json
148233
...
@@ -152,7 +237,7 @@
152237
...
153238
```
154239

155-
4. Run your chain
240+
### Step-4: Run your chain
156241

157242
```bash
158243
cd orbit-setup-script

0 commit comments

Comments
 (0)