Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 2a82f39

Browse files
authored
Merge branch 'main' into fullnode-guide-updates
2 parents 60af5b4 + 8165897 commit 2a82f39

File tree

5 files changed

+152
-70
lines changed

5 files changed

+152
-70
lines changed

.vitepress/config.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ function sidebarHome() {
322322
link: "/guides/use-rollkit-cli",
323323
},
324324
{
325-
text: "Create genesis for your rollup",
326-
link: "/guides/create-genesis",
325+
text: "Use Ignite to create a Rollkit app",
326+
link: "/guides/ignite-rollkit",
327327
},
328328
{
329329
text: "Restart your rollup",
@@ -337,17 +337,13 @@ function sidebarHome() {
337337
text: "Run a rollup full node",
338338
link: "/guides/full-node",
339339
},
340-
{
341-
text: "Run a centralized sequencer",
342-
link: "/guides/centralized-sequencer",
343-
},
344340
{
345341
text: "CometBFT into a Rollkit app",
346342
link: "/guides/cometbft-to-rollkit",
347343
},
348344
{
349-
text: "Use Ignite to create a Rollkit app",
350-
link: "/guides/ignite-rollkit",
345+
text: "Create genesis for your rollup",
346+
link: "/guides/create-genesis",
351347
},
352348
{
353349
text: "Configuration",

guides/centralized-sequencer.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

guides/create-genesis.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,71 @@
22

33
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.
44

5+
## 0. Pre-requisities
6+
7+
For this guide you need to have a chain directory where you have created and built your chain.
8+
9+
If you don't have a chain directory yet, you can initialize a simple ignite chain by following [this guide](./ignite-rollkit.md)
10+
11+
:::tip
12+
This guide will use the simple ignite chain created in linked guide. Make sure to update any relevant variables to match your chain.
13+
:::
14+
515
## 1. Setting variables
616

7-
First, set the necessary variables for your chain, here is an example:
17+
First, set the necessary variables for your chain in the terminal, here is an example:
818

919
```sh
1020
VALIDATOR_NAME=validator1
11-
CHAIN_ID=rollup-chain
21+
CHAIN_ID=gm
1222
KEY_NAME=rollup-key
1323
CHAINFLAG="--chain-id ${CHAIN_ID}"
1424
TOKEN_AMOUNT="10000000000000000000000000stake"
1525
STAKING_AMOUNT="1000000000stake"
1626
```
1727

18-
## 2. Ensuring `rollkit.toml` is present and building entrypoint
28+
## 2. Rebuild your chain
1929

2030
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:
2131

2232
```sh
2333
rollkit rebuild
2434
```
2535

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.
36+
This (re)creates an `entrypoint` binary in the root of your rollup directory. which is used to run all the operations on the rollup chain.
37+
38+
Ensure that the chain configuration directory is set correctly in the `rollkit.toml` file.
39+
40+
For example:
41+
42+
```sh
43+
[chain]
44+
config_dir = "/Users/you/.gm"
45+
```
2746

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:
47+
:::tip
48+
You can always recreate the `rollkit.toml` file by deleting it and re-running the following command:
2949

3050
```sh
3151
rollkit toml init
3252
```
53+
:::
3354

3455
## 3. Resetting existing genesis/chain data
3556

36-
Reset any existing genesis or chain data:
57+
Reset any existing chain data:
3758

3859
```sh
3960
rollkit tendermint unsafe-reset-all
4061
```
4162

63+
Reset any existing genesis data:
64+
65+
```sh
66+
rm -rf $HOME/.$CHAIN_ID/config/gentx
67+
rm $HOME/.$CHAIN_ID/config/genesis.json
68+
```
69+
4270
## 4. Initializing the validator
4371

4472
Initialize the validator with the chain ID you set:
@@ -84,29 +112,21 @@ rollkit genesis collect-gentxs
84112
Copy the centralized sequencer address into `genesis.json`:
85113

86114
```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
115+
ADDRESS=$(jq -r '.address' ~/.$CHAIN_ID/config/priv_validator_key.json)
116+
PUB_KEY=$(jq -r '.pub_key' ~/.$CHAIN_ID/config/priv_validator_key.json)
117+
jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.$CHAIN_ID/config/genesis.json > temp.json && mv temp.json ~/.$CHAIN_ID/config/genesis.json
90118
```
91119

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-
```
120+
## 10. Starting the chain
101121

102-
## 11. Starting the chain
122+
Finally, start the chain with your start command.
103123

104-
Finally, start the chain with the following command:
124+
For example, start the simple ignite chain with the following command:
105125

106126
```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"
127+
rollkit start --rollkit.aggregator --rollkit.sequencer_rollup_id $CHAIN_ID
108128
```
109129

110130
## Summary
111131

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.
132+
By following these steps, you will set up the genesis for your rollup, initialize the validator, add a genesis account, and started the chain. 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.

public/install.sh

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,95 @@
11
#!/bin/bash
22

3-
echo "Downloading Rollkit source code..."
3+
# Define colors for output
4+
RED="\033[31m"
5+
GREEN="\033[32m"
6+
YELLOW="\033[33m"
7+
CYAN="\033[36m"
8+
BOLD="\033[1m"
9+
RESET="\033[0m"
10+
11+
# Function to print headers
12+
print_header() {
13+
echo -e "${CYAN}${BOLD}--> $1${RESET}"
14+
}
15+
16+
# Function to print success messages
17+
print_success() {
18+
echo -e "${GREEN}${BOLD}$1${RESET}"
19+
}
20+
21+
# Function to print warnings
22+
print_warning() {
23+
echo -e "${YELLOW}${BOLD}$1${RESET}"
24+
}
25+
26+
# Function to print errors
27+
print_error() {
28+
echo -e "${RED}${BOLD}$1${RESET}"
29+
}
30+
31+
# Function to compare versions
32+
compare_versions() {
33+
if [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$1" ]; then
34+
if [ "$1" = "$2" ]; then
35+
return 0 # Equal
36+
else
37+
return 1 # First is less
38+
fi
39+
else
40+
return 2 # First is greater
41+
fi
42+
}
43+
44+
print_header "Downloading Rollkit source code..."
445
git clone https://github.com/rollkit/rollkit.git
46+
echo ""
47+
48+
cd rollkit || { print_error "Failed to find the downloaded repository."; exit 1; }
49+
50+
print_header "Extracting Go version from go.mod..."
51+
go_mod_version=$(grep "^go " go.mod | cut -d' ' -f2)
552

53+
if [ -z "$go_mod_version" ]; then
54+
print_error "Error: Could not find a Go version in go.mod."
55+
exit 1
56+
fi
57+
formatted_go_version="go${go_mod_version}"
58+
echo -e " Required Go version: ${BOLD}${formatted_go_version}${RESET}\n"
59+
60+
print_header "Checking if Go is installed..."
661
if ! which go > /dev/null; then
7-
echo "Go is not installed. Attempting to install Go..."
8-
curl -sL "https://rollkit.dev/install-go.sh" | sh -s "go1.22.2"
62+
print_warning "Go is not installed. Attempting to install Go..."
63+
curl -sL "https://rollkit.dev/install-go.sh" | sh -s "$formatted_go_version"
64+
fi
65+
66+
installed_version=$(go version | awk '{print $3}' | sed 's/go//')
67+
echo -e " Installed Go version: ${BOLD}${installed_version}${RESET}\n"
68+
69+
print_header "Validating installed Go version..."
70+
compare_versions "$installed_version" "$go_mod_version"
71+
comparison_result=$?
72+
73+
if [ $comparison_result -eq 1 ]; then
74+
print_error "ERROR: The installed Go version ($installed_version) is less than the required version ($go_mod_version)."
75+
echo " Please upgrade your version of Go."
76+
exit 1
77+
elif [ $comparison_result -eq 2 ]; then
78+
print_warning "INFO: The installed Go version ($installed_version) is greater than the required version ($go_mod_version)."
79+
echo " If you run into issues, try downgrading your version of Go."
980
fi
81+
echo ""
1082

11-
cd rollkit || { echo "Failed to find the downloaded repository."; exit 1; }
12-
git fetch && git checkout $1
13-
echo "Building and installing Rollkit..."
83+
print_header "Fetching and checking out the specified branch or tag..."
84+
git fetch && git checkout "$1"
85+
echo ""
86+
87+
print_header "Building and installing Rollkit..."
1488
make install
89+
print_success "Rollkit CLI installed successfully!"
90+
1591
cd ..
16-
echo "Installation completed successfully."
92+
print_header "Cleaning up downloads..."
93+
rm -rf rollkit
1794

95+
print_success "Installation completed successfully."

tutorials/sequencing/centralized.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ make build
3030
./build/centralized-sequencer -h
3131
```
3232

33+
You should see the following output:
34+
3335
```sh
3436
Usage:
3537
-host string
@@ -50,6 +52,7 @@ Usage:
5052
DA namespace where the sequencer submits transactions
5153
-db_path string
5254
path to the database
55+
...
5356
```
5457

5558
As shown by the help command, a centralized sequencer is configured to serve a rollup (via `rollup_id`). The DA network to persist the sequenced batches are specified using `da_address`, `da_auth_token` and `da_namespace`.
@@ -113,6 +116,24 @@ Then after a few blocks you should see this message confirming that your sequenc
113116
I[2024-11-15|16:04:07.698] successfully submitted Rollkit headers to DA layer module=BlockManager gasPrice=-1 daHeight=1 headerCount=14
114117
```
115118

119+
## Metrics {#metrics}
120+
121+
The `centralized-sequencer` node reports Prometheus metrics when the `-metrics` flag is enabled.
122+
123+
By default, metrics are exported to `http://localhost:8080/metrics`.
124+
125+
The listening address and port can be configured with the `-metrics-address` flag.
126+
127+
The following metrics are available:
128+
129+
| **Name** | **Type** | **Tags** | **Description** |
130+
|-------------------------------------------|-----------|-----------|------------------------------------------------------------------------|
131+
| sequencer_gas_price | Gauge | | Gas price of the DA transaction |
132+
| sequencer_last_blob_size | Gauge | | Last blob size submitted to the DA |
133+
| sequencer_transaction_status | Gauge | | Transaction status of the DA transaction |
134+
| sequencer_num_pending_blocks | Gauge | | Number of blocks pending DA submission |
135+
| sequencer_included_block_height | Gauge | | Block height of the last DA transaction |
136+
116137
## Summary {#summary}
117138

118139
By following these steps, you will have successfully set up and connected your chain to the centralized sequencer. You can now start submitting transactions to your chain.

0 commit comments

Comments
 (0)