Skip to content

Commit 1ae0ad7

Browse files
Generate rollkit.toml as a separate step
1 parent b205985 commit 1ae0ad7

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

guides/chain-config.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# How to create a chain configuration for a new rollup
2+
3+
#!/bin/sh
4+
5+
# set variables for the chain
6+
VALIDATOR_NAME=validator1
7+
CHAIN_ID=gm
8+
KEY_NAME=gm-key
9+
KEY_2_NAME=gm-key-2
10+
KEY_RELAY=gm-relay
11+
CHAINFLAG="--chain-id ${CHAIN_ID}"
12+
TOKEN_AMOUNT="10000000000000000000000000stake"
13+
STAKING_AMOUNT="1000000000stake"
14+
15+
# build and install the gm chain with Rollkit
16+
go install ./cmd/gmd
17+
18+
# reset any existing genesis/chain data
19+
gmd tendermint unsafe-reset-all
20+
21+
# initialize the validator with the chain ID you set
22+
gmd init $VALIDATOR_NAME --chain-id $CHAIN_ID
23+
24+
# add keys for key 1 and key 2 to keyring-backend test
25+
gmd keys add $KEY_NAME --keyring-backend test
26+
gmd keys add $KEY_2_NAME --keyring-backend test
27+
echo "milk verify alley price trust come maple will suit hood clay exotic" | gmd keys add $KEY_RELAY --keyring-backend test --recover
28+
29+
# add these as genesis accounts
30+
gmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test
31+
gmd genesis add-genesis-account $KEY_2_NAME $TOKEN_AMOUNT --keyring-backend test
32+
gmd genesis add-genesis-account $KEY_RELAY $TOKEN_AMOUNT --keyring-backend test
33+
34+
# set the staking amounts in the genesis transaction
35+
gmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test
36+
37+
# collect genesis transactions
38+
gmd genesis collect-gentxs
39+
40+
# copy centralized sequencer address into genesis.json
41+
# Note: validator and sequencer are used interchangeably here
42+
ADDRESS=$(jq -r '.address' ~/.gm/config/priv_validator_key.json)
43+
PUB_KEY=$(jq -r '.pub_key' ~/.gm/config/priv_validator_key.json)
44+
jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.gm/config/genesis.json > temp.json && mv temp.json ~/.gm/config/genesis.json
45+
46+

tutorials/gm-world.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,31 @@ To make it simple we will download a repository with a `gm-world` rollup that ha
5656
```bash
5757
cd $HOME && bash -c "$(curl -sSL https://rollkit.dev/install-gm-rollup.sh)"
5858
```
59+
## 🧰 Configuring Your Rollup {#configuring-your-rollup}
60+
61+
Generate rollkit.toml file by running:
62+
63+
```bash
64+
rollkit toml init
65+
```
66+
67+
The output should be similar to this:
68+
```
69+
Found rollup entrypoint: /root/gm/cmd/gmd/main.go, adding to rollkit.toml
70+
Could not find rollup config under gm. Please put the chain.config_dir in the rollkit.toml file manually.
71+
Initialized rollkit.toml file in the current directory.
72+
```
73+
74+
From the output, you can see that the rollup entrypoint is `~/gm/cmd/gmd/main.go`.
75+
76+
Open the rollkit.toml file and under the `[chain]` section set `config_dir` to the `./.gm` directory. Your rollkit.toml file should look like this:
77+
78+
```bash
79+
entrypoint = "./cmd/gmd/main.go"
80+
81+
[chain]
82+
config_dir = "./.gm"
83+
```
5984

6085
## 🚀 Starting your rollup {#start-your-rollup}
6186

0 commit comments

Comments
 (0)