Skip to content

Commit b48dc54

Browse files
committed
Avail docs
1 parent a047e11 commit b48dc54

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ function sidebarHome() {
238238
text: "Celestia",
239239
link: "/tutorials/celestia-da",
240240
},
241+
{
242+
text: "Avail",
243+
link: "/tutorials/avail-da",
244+
},
241245
],
242246
},
243247
{

tutorials/avail-da.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# GM world rollup: Deploying to Avail
2+
3+
## 🌞 Introduction {#introduction}
4+
5+
Avail DA offers scalable data availability that underpins the Avail ecosystem and ensures instantaneous and reliable data integrity, enabling rollups to grow, through the use of cutting-edge zero knowledge and KZG Polynomial commitments.
6+
7+
This tutorial serves as a comprehensive guide for deploying your GM world rollup on Avail's data availability (DA) network.
8+
9+
Before proceeding, ensure that you have completed the [GM world rollup](/tutorials/gm-world) tutorial, which covers setting up a local sovereign gm-world rollup and connecting it to a local (mock) DA node.
10+
11+
## 🪶 Running an avail light node
12+
13+
Before you can start your rollup node, you need to initiate, sync, and possibly fund a light node on Turing testnet which is the test network of Avail
14+
15+
- [Local Development](https://github.com/rollkit/avail-da/blob/main/README.md)
16+
- [Turing Testnet](https://docs.availproject.org/docs/networks)
17+
18+
### 🚀 Using Turing Testnet
19+
20+
- To fund your wallet address for using Turing Testnet: get AVAIL tokens from [Faucet]((https://faucet.avail.tools/))
21+
- Paste your mnemonic in the `identity.toml` file by creating a `identity.toml` with the following command:
22+
```touch identity.toml```
23+
Example:
24+
```bash
25+
avail_secret_uri = '<paste your mnemonic here>'
26+
```
27+
- Running just an Avail light node is enough for Turing testnet. Run the Avail light node using the following command
28+
```bash
29+
cargo run --release -- --network turing --app-id 1 --clean --identity identity.toml
30+
```
31+
32+
If you want to sync avail light node with your desired block number, you can add the following config in your `config.yaml` file from [here](https://github.com/availproject/avail-light/blob/main/config.yaml.template)
33+
```bash
34+
http_server_host = '127.0.0.1'
35+
http_server_port = 8000
36+
port = 38000
37+
sync_start_block = 322264
38+
```
39+
40+
After successfully starting a light node, it's time to start posting the batches of blocks of data that your rollup generates.
41+
42+
## 🧹 Cleaning previous chain history
43+
44+
From the [GM world rollup](/tutorials/gm-world) tutorial, you should already have the `gmd` binary and the `$HOME/.gm` directory.
45+
46+
To clear old rollup data:
47+
48+
```bash
49+
rm -r $(which gmd) && rm -rf $HOME/.gm
50+
```
51+
52+
## 🏗️ Building your rollup
53+
54+
Now we need to rebuild our rollup by simply running the existing `init.sh` script:
55+
56+
```bash
57+
cd $HOME/gm && bash init.sh
58+
```
59+
60+
This process creates a new `$HOME/.gm` directory and a new `gmd` binary. Next, we need to connect our rollup to the running avail light node.
61+
62+
## 🛠️ Configuring flags for DA
63+
64+
Now we're prepared to initiate our rollup and establish a connection with the avail light node. The `gmd start` command requires two DA configuration flags:
65+
66+
- `--rollkit.da_start_height`
67+
- `--rollkit.da_address`
68+
69+
Let's determine what to provide for each of them.
70+
71+
First, let's query the DA Layer start height using an RPC endpoint provided by avail Labs. For local it would be - [https://localhost:8000/v1/latest_block](https://localhost:8000/v1/latest_block), and for turing testnet - [https://rpc.lunaroasis.net/block](https://rpc.lunaroasis.net/block)
72+
73+
Here is an example for the local development (replace URL for Turing Testnet if needed):
74+
75+
```bash
76+
DA_BLOCK_HEIGHT=$(curl https://localhost:8000/v1/latest_block | jq -r '.result.block.header.height')
77+
echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n"
78+
```
79+
80+
You will see the output like this:
81+
82+
```bash
83+
Your DA_BLOCK_HEIGHT is 35
84+
```
85+
86+
## 🔥 Running your rollup connected to an avail light node
87+
88+
Now let's run our rollup node with all DA flags:
89+
90+
```bash
91+
gmd start \
92+
--rollkit.aggregator \
93+
--rollkit.da_address="grpc://localhost:3000" \
94+
--rollkit.da_start_height $DA_BLOCK_HEIGHT \
95+
--minimum-gas-prices="0.1stake"
96+
```
97+
98+
Now, the rollup is running and posting blocks (aggregated in batches) to avail. You can view your rollup by finding your account on [Turing testnet](https://avail-turing.subscan.io/)
99+
100+
::: info
101+
For details on configuring gas prices specifically for the DA network, see our [DA Network Gas Price Guide](/guides/gas-price). This is separate from the `--minimum-gas-prices="0.025stake"` setting, which is used for rollup network operations.
102+
:::
103+
104+
## 🎉 Next steps
105+
106+
Congratulations! You've built a local rollup that posts to avail's testnets as well as locally. Well done! Now, go forth and build something great! Good luck!

0 commit comments

Comments
 (0)