Skip to content

Commit 5691e84

Browse files
Update to use rollkit cli instead of <binary>d
Generate rollkit.toml as a separate step Update wordle to use rollkit cli and latest ignite Celestia DA with a rollkit CLI Wordle tut with a rollkit CLI Guide on connecting to local da Update How-To titles Add rollkit cli how to guide Add how to create a genesis config Change heading for celestia-da tutorial Use --no-module for scaffolding Separate config section in how-to guides Max pending blocks guide Fix broken .vitepress Update tutorials/wordle.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update guides/max-pending-blocks.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update guides/connect-local-da.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update guides/create-genesis.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Add language specifier for fenced code Update tutorials/celestia-da.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Add a blank line above the heading for proper Markdown formatting Fix formatting Markdown adjustments Fix unterminated str literal Fix Update guides/create-genesis.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update tutorials/gm-world.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update tutorials/gm-world.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update guides/create-genesis.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update guides/create-genesis.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Add md extension to a use-rollkit-cli guide Update guides/connect-local-da.md Co-authored-by: joshcs.eth <[email protected]> Update .vitepress/config.ts Co-authored-by: joshcs.eth <[email protected]> Update guides/connect-local-da.md Co-authored-by: joshcs.eth <[email protected]> Update guides/connect-local-da.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/create-genesis.md Co-authored-by: joshcs.eth <[email protected]> Update guides/max-pending-blocks.md Co-authored-by: joshcs.eth <[email protected]> Update tutorials/celestia-da.md Co-authored-by: joshcs.eth <[email protected]> Update tutorials/celestia-da.md Co-authored-by: joshcs.eth <[email protected]> Update tutorials/celestia-da.md Co-authored-by: joshcs.eth <[email protected]> Update tutorials/gm-world.md Co-authored-by: joshcs.eth <[email protected]> Update tutorials/gm-world.md Co-authored-by: joshcs.eth <[email protected]> Update guides/use-rollkit-cli.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 3b5831a commit 5691e84

File tree

11 files changed

+404
-97
lines changed

11 files changed

+404
-97
lines changed

.vitepress/config.ts

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -255,46 +255,68 @@ function sidebarHome() {
255255
collapsed: true,
256256
items: [
257257
{
258+
text: "Configuration",
259+
collapsed: true,
258260
items: [
259261
{
260-
text: "How to restart your rollup",
261-
link: "/guides/restart-rollup",
262+
text: "Use the Rollkit CLI",
263+
link: "/guides/use-rollkit-cli",
262264
},
263265
{
264-
text: "How to run as a full and sequencer node",
265-
link: "/guides/full-and-sequencer-node",
266+
text: "Connect to a local DA",
267+
link: "/guides/connect-local-da",
266268
},
267269
{
268-
text: "How to configure gas price",
269-
link: "/guides/gas-price",
270+
text: "Create genesis for your rollup",
271+
link: "/guides/create-genesis",
270272
},
271273
{
272-
text: "How to change speed of block production",
273-
link: "/guides/block-times",
274+
text: "Restart your rollup",
275+
link: "/guides/restart-rollup",
274276
},
275277
{
276-
text: "How to use lazy sequencing (aggregation)",
277-
link: "/guides/lazy-sequencing",
278+
text: "Run as a full and sequencer node",
279+
link: "/guides/full-and-sequencer-node",
278280
},
279281
{
280-
text: "How to test and deploy smart-contracts",
281-
link: "/guides/cw-orch",
282+
text: "Configure gas price",
283+
link: "/guides/gas-price",
282284
},
283-
{ text: "How to add zkML to your rollup", link: "/guides/zkml" },
284285
{
285-
text: "How to add an IBC connection to your rollup",
286-
link: "/guides/ibc-connection",
286+
text: "Configure max pending blocks",
287+
link: "/guides/max-pending-blocks",
287288
},
288289
{
289-
text: "How to integrate Range with your rollup",
290-
link: "/guides/rollkit-monitoring",
290+
text: "Configure DA chain block sync time",
291+
link: "/guides/da-block-time",
291292
},
292293
{
293-
text: "How to use IBC token (TIA) as gas token in your rollup",
294-
link: "/guides/use-tia-for-gas",
294+
text: "Change speed of block production",
295+
link: "/guides/block-times",
296+
},
297+
{
298+
text: "Use lazy sequencing (aggregation)",
299+
link: "/guides/lazy-sequencing",
295300
},
296301
],
297302
},
303+
{
304+
text: "Test and deploy smart-contracts",
305+
link: "/guides/cw-orch",
306+
},
307+
{ text: "Add zkML to your rollup", link: "/guides/zkml" },
308+
{
309+
text: "Add an IBC connection to your rollup",
310+
link: "/guides/ibc-connection",
311+
},
312+
{
313+
text: "Integrate Range with your rollup",
314+
link: "/guides/rollkit-monitoring",
315+
},
316+
{
317+
text: "Use IBC token (TIA) as gas token in your rollup",
318+
link: "/guides/use-tia-for-gas",
319+
},
298320
],
299321
},
300322
{

.vitepress/constants/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ const constants = Object.freeze({
1010

1111
localDALatestTag: "v0.2.0",
1212

13-
igniteVersionTag: "v28.3.0",
13+
igniteVersionTag: "v28.4.0",
1414
});
1515
export default constants;

guides/connect-local-da.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# How to connect a rollup to a local DA network
2+
3+
This guide provides a quick and straightforward method to start a local Data Availability (DA) network and configure your rollup to post data to it.
4+
5+
## Setting Up a Local DA Network
6+
7+
To set up a local DA network node on your machine, run the following script to install and start the local DA node:
8+
9+
```bash
10+
curl -sSL https://rollkit.dev/install-local-da.sh | bash -s {{constants.localDALatestTag}}
11+
```
12+
13+
This script will build and run the node, which will then listen on port `7980`.
14+
15+
## Configuring your rollup to connect to the local DA network
16+
17+
To connect your rollup to the local DA network, you need to pass the `--rollkit.da_address` flag with the local DA node address.
18+
19+
## Run your rollup
20+
21+
Start your rollup node with the following command, ensuring to include the DA address flag:
22+
23+
```bash
24+
rollkit start \
25+
--rollkit.da_address http://localhost:7980 \
26+
<other-flags>
27+
```
28+
29+
## Summary
30+
31+
By following these steps, you will set up a local DA network node and configure your rollup to post data to it. This setup is useful for testing and development in a controlled environment.

guides/create-genesis.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# How to create a genesis for your rollup
2+
3+
This guide will walk you through the process of setting up a genesis for your rollup. Follow the steps below to initialize your rollup chain, add a genesis account, and start the chain.
4+
5+
## 1. Setting variables
6+
7+
First, set the necessary variables for your chain, here is an example:
8+
9+
```sh
10+
VALIDATOR_NAME=validator1
11+
CHAIN_ID=rollup-chain
12+
KEY_NAME=rollup-key
13+
CHAINFLAG="--chain-id ${CHAIN_ID}"
14+
TOKEN_AMOUNT="10000000000000000000000000stake"
15+
STAKING_AMOUNT="1000000000stake"
16+
```
17+
18+
## 2. Ensuring `rollkit.toml` is present and building entrypoint
19+
20+
Ensure that `rollkit.toml` is present in the root of your rollup directory (if not, follow a [Guide](/guides/use-rollkit-cli) to set it up) and run the following command to (re)generate an entrypoint binary out of the code:
21+
22+
```sh
23+
rollkit rebuild
24+
```
25+
26+
This creates an `entrypoint` binary in the root of your rollup directory. which is used to run all the operations on the rollup chain.
27+
28+
Ensure that the chain configuration directory is set correctly in the `rollkit.toml` file, if you doubt it, you can remove the `rollkit.toml` file and run the following command to generate a new one:
29+
30+
```sh
31+
rollkit toml init
32+
```
33+
34+
## 3. Resetting existing genesis/chain data
35+
36+
Reset any existing genesis or chain data:
37+
38+
```sh
39+
rollkit tendermint unsafe-reset-all
40+
```
41+
42+
## 4. Initializing the validator
43+
44+
Initialize the validator with the chain ID you set:
45+
46+
```sh
47+
rollkit init $VALIDATOR_NAME --chain-id $CHAIN_ID
48+
```
49+
50+
## 5. Adding a key to keyring backend
51+
52+
Add a key to the keyring-backend:
53+
54+
```sh
55+
rollkit keys add $KEY_NAME --keyring-backend test
56+
```
57+
58+
## 6. Adding a genesis account
59+
60+
Add a genesis account with the specified token amount:
61+
62+
```sh
63+
rollkit genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test
64+
```
65+
66+
## 7. Setting the staking amount in the genesis transaction
67+
68+
Set the staking amount in the genesis transaction:
69+
70+
```sh
71+
rollkit genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test
72+
```
73+
74+
## 8. Collecting genesis transactions
75+
76+
Collect the genesis transactions:
77+
78+
```sh
79+
rollkit genesis collect-gentxs
80+
```
81+
82+
## 9. Configuring the genesis file
83+
84+
Copy the centralized sequencer address into `genesis.json`:
85+
86+
```sh
87+
ADDRESS=$(jq -r '.address' ~/.rollup/config/priv_validator_key.json)
88+
PUB_KEY=$(jq -r '.pub_key' ~/.rollup/config/priv_validator_key.json)
89+
jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.rollup/config/genesis.json > temp.json && mv temp.json ~/.rollup/config/genesis.json
90+
```
91+
92+
## 10. Creating a restart script
93+
94+
Create a `restart-rollup.sh` file to restart the chain later, notice the `rollkit.da_address` flag which is the address of the data availability node, for other DA layers it will be a different set of flags (in case of Celestia check out the tutorial [here](/tutorials/celestia-da)):
95+
96+
```sh
97+
[ -f restart-rollup.sh ] && rm restart-rollup.sh
98+
99+
echo "rollkit start --rollkit.aggregator --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices=\"0.025stake\" --rollkit.da_address \"http://localhost:7980\"" >> restart-rollup.sh
100+
```
101+
102+
## 11. Starting the chain
103+
104+
Finally, start the chain with the following command:
105+
106+
```sh
107+
rollkit start --rollkit.aggregator --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" --rollkit.da_address "http://localhost:7980"
108+
```
109+
110+
## Summary
111+
112+
By following these steps, you will set up the genesis for your rollup, initialize the validator, add a genesis account, and start the chain on a local data availability network (DA). This guide provides a basic framework for configuring and starting your rollup using the Rollkit CLI. Make sure `rollkit.toml` is present in the root of your rollup directory, and use the `rollkit` command for all operations.

guides/da-block-time.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# How to configure DA chain block syncing time
2+
3+
The `--rollkit.da_block_time` flag is used to configure the time in seconds that the rollup will wait for a block to be synced from the DA chain.
4+
5+
```bash
6+
--rollkit.da_block_time duration
7+
```
8+
9+
An example command would look like this:
10+
11+
```bash
12+
rollkit start [existing flags...] // [!code --]
13+
rollkit start [existing flags...] --rollkit.da_block_time=30s // [!code ++]
14+
```

guides/max-pending-blocks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# How to configure the maximum number of blocks pending DA submission
2+
3+
The `--rollkit.max_pending_blocks` flag is used to configure the maximum limit of blocks pending DA submission (0 for no limit)
4+
5+
```bash
6+
--rollkit.max_pending_blocks uint
7+
```
8+
9+
An example command would look like this:
10+
11+
```bash
12+
rollkit start [existing flags...] // [!code --]
13+
rollkit start [existing flags...] --rollkit.max_pending_blocks=100 // [!code ++]
14+
```
15+

guides/use-rollkit-cli.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# How to Use Rollkit CLI
2+
3+
This guide will walk you through the basics of installing and using Rollkit CLI. You'll learn how to install the CLI, initialize a configuration file (`rollkit.toml`), and run rollup commands.
4+
5+
## 1. Installing Rollkit CLI
6+
7+
<!-- markdownlint-disable MD033 -->
8+
<script setup>
9+
import constants from '../.vitepress/constants/constants.js'
10+
</script>
11+
12+
To install Rollkit CLI, execute the following command:
13+
14+
```bash-vue
15+
curl -sSL https://rollkit.dev/install.sh | sh -s {{constants.rollkitLatestTag}}
16+
```
17+
18+
This command downloads and installs the Rollkit CLI of specified version.
19+
20+
## 2. Initializing `rollkit.toml`
21+
22+
The `rollkit.toml` file is a configuration file that Rollkit uses to understand the structure and entry point of your rollup. To initialize this file, follow these steps:
23+
24+
### Steps to Generate `rollkit.toml`:
25+
26+
1. Run the following command to generate the `rollkit.toml` file:
27+
28+
```bash
29+
rollkit toml init
30+
```
31+
32+
2. You should see an output similar to this (example taken from [GM world](/tutorials/gm-world) tutorial):
33+
34+
```bash
35+
Found rollup entrypoint: /root/gm/cmd/gmd/main.go, adding to rollkit.toml
36+
Could not find rollup config under gm. Please put the chain.config_dir in the rollkit.toml file manually.
37+
Initialized rollkit.toml file in the current directory.
38+
```
39+
40+
3. The output indicates that the rollup entrypoint is `~/gm/cmd/gmd/main.go`.
41+
42+
4. Open the `rollkit.toml` file, and under the `[chain]` section, set `config_dir` to the appropriate directory where your chain configuration is. For GM World tutorial, `rollkit.toml` file looks like this:
43+
44+
```toml
45+
entrypoint = "./cmd/gmd/main.go"
46+
47+
[chain]
48+
config_dir = "./.gm"
49+
```
50+
51+
Adjust `entrypoint` and `config_dir` according to your project structure.
52+
53+
## 3. Running Rollup Commands Using Rollkit CLI
54+
55+
Once you have the `rollkit.toml` file set up, you can run any rollup command using the Rollkit CLI. Ensure you are in the directory containing the `rollkit.toml` file when executing commands.
56+
57+
### Example:
58+
59+
1. Navigate to the directory containing the `rollkit.toml` file.
60+
61+
2. Now you could do:
62+
63+
```bash
64+
# instead of <rollup>d start
65+
rollkit start
66+
# instead of <rollup>d tx
67+
rollkit tx
68+
# for any <rollup>d <command>
69+
rollkit <command>
70+
```
71+
## Summary
72+
73+
By following these steps, you can install the Rollkit CLI, initialize the `rollkit.toml` configuration file, and run rollup commands. This setup helps you manage and interact with your rollup project efficiently.

public/install-gm-rollup.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
echo "Downloading GM tutorial rollup source code..."
44
git clone https://github.com/rollkit/gm.git
55
cd gm || { echo "Failed to find the downloaded repository"; exit 1; }
6-
git fetch && git checkout remotes/origin/tutorial-local-da
7-
echo "Building and configuring rollup chain..."
8-
bash init.sh
6+
git fetch && git checkout remotes/origin/tutorial-local-da-rollkit

0 commit comments

Comments
 (0)