Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 2 additions & 40 deletions guides/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,15 @@ Metrics will be served under `/metrics` on port 26660 by default. The listening

## List of available metrics

The following metrics are available, grouped by their subsystem:

### Block Manager

| Name | Type | Tags | Description |
|------|------|------|-------------|
| `rollkit_sequencer_height` | Gauge | chain_id | Height of the chain |
| `rollkit_sequencer_num_txs` | Gauge | chain_id | Number of transactions |
| `rollkit_sequencer_block_size_bytes` | Gauge | chain_id | Size of the block |
| `rollkit_sequencer_total_txs` | Gauge | chain_id | Total number of transactions |
| `rollkit_sequencer_latest_block_height` | Gauge | chain_id | The latest block height |

### P2P

| Name | Type | Tags | Description |
|------|------|------|-------------|
| `rollkit_p2p_peers` | Gauge | chain_id | Number of connected peers |
| `rollkit_p2p_peer_receive_bytes_total` | Counter | peer_id, chID | Number of bytes received from a given peer |
| `rollkit_p2p_peer_send_bytes_total` | Counter | peer_id, chID | Number of bytes sent to a given peer |
| `rollkit_p2p_peer_pending_send_bytes` | Gauge | peer_id | Pending bytes to be sent to a given peer |
| `rollkit_p2p_num_txs` | Gauge | peer_id | Number of transactions submitted by each peer |
| `rollkit_p2p_message_receive_bytes_total` | Counter | message_type | Number of bytes of each message type received |
| `rollkit_p2p_message_send_bytes_total` | Counter | message_type | Number of bytes of each message type sent |

In addition to these, [go-libp2p metrics](https://github.com/libp2p/go-libp2p/tree/master/dashboards) are exported as well.

### Single Sequencer

| Name | Type | Tags | Description |
|------|------|------|-------------|
| `sequencer_gas_price` | Gauge | chain_id | The gas price of DA |
| `sequencer_last_blob_size` | Gauge | chain_id | The size in bytes of the last DA blob |
| `sequencer_transaction_status` | Counter | chain_id, status | Count of transaction statuses for DA submissions |
| `sequencer_num_pending_blocks` | Gauge | chain_id | The number of pending blocks for DA submission |
| `sequencer_included_block_height` | Gauge | chain_id | The last DA included block height |

### Based Sequencer

The Based Sequencer uses the same metrics as the Single Sequencer, with additional metrics related to the based DA layer.
You can find the full list of available metrics in the [Technical Specifications](https://rollkit.github.io/rollkit/specs/block-manager.html#metrics).

## Viewing Metrics

Once your Rollkit node is running with metrics enabled, you can view the metrics by:

1. Accessing the metrics endpoint directly:

```
```bash
curl http://localhost:26660/metrics
```

Expand Down
56 changes: 35 additions & 21 deletions guides/reset-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,59 @@ In order to complete this guide, you will need to have completed either the [qui

## Quick Start

When you run your chain with `rollkit start` you will create a `.rollkit` directory in your root directory.
When you run your chain with `testapp start` you will create a `.testapp` directory in your root directory.

This directory will look like the following.

```bash
tree $HOME/.rollkit
tree $HOME/.testapp

├── config
│   ├── config.toml
│   ├── genesis.json
│   ├── node_key.json
│   └── priv_validator_key.json
│   ├── rollkit.yaml
│   └── signer.json
└── data
├── priv_validator_state.json
└── rollkit
├── cache
│   ├── data
│   │   ├── da_included.gob
│   │   ├── hashes.gob
│   │   ├── items_by_hash.gob
│   │   └── items_by_height.gob
│   └── header
│   ├── da_included.gob
│   ├── hashes.gob
│   ├── items_by_hash.gob
│   └── items_by_height.gob
├── executor
│   ├── 000001.sst
│   ├── 000002.vlog
│   ├── 000003.vlog
│   ├── 00003.mem
│   ├── DISCARD
│   ├── KEYREGISTRY
│   ├── LOCK
│   └── MANIFEST
└── testapp
├── 000001.sst
├── 000001.vlog
├── 000002.sst
├── 000002.vlog
├── 000003.sst
├── 000003.vlog
├── DISCARD
├── KEYREGISTRY
└── MANIFEST
```

To reset the state of the chain, delete the entire `.rollkit` directory.
To reset the state of the chain, delete the content of the `data` directory.

Alternatively, you can use this command.

```bash
${BINARY} unsafe-clean
testapp unsafe-clean
```

When you launch your chain again with `rollkit start` your `.rollkit` directory will be re-created and you will see your chain starting at block height 1 again.
When you launch your chain again with `testapp start` your `data` directory will be re-populated and you will see your chain starting at block height 1 again.

## gm-world

Expand Down Expand Up @@ -114,20 +136,12 @@ tree $HOME/.gm
└── e24d9eeca2d24193bdd98ed9116ff70f8a2e2b5e.address
```

The directories you need to delete to reset your state are in the `./data` directory.

```bash
$HOME/.gm/data/application.db
$HOME/.gm/data/rollkit
$HOME/.gm/data/snapshots
$HOME/.gm/data/cache

```
The directories you need to delete to reset your state are in the `data` directory.

You can delete them with the following command:
Alternatively, you can run the following command to delete the data directories:

```bash
gmd tendermint unsafe-reset-all
gmd comet unsafe-reset-all
```

When you launch your chain again with your `gmd start <flags>` command, these data directories will be re-created and you will see your chain starting at block height 1 again.
6 changes: 3 additions & 3 deletions guides/restart-rollup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ command for your rollup.
For example, if you ran the [quick start](/guides/quick-start.md) tutorial, you started your rollup with:

```bash
rollkit start
testapp start
```

You would have see output similar to:
Expand All @@ -27,7 +27,7 @@ I[2024-10-17|14:52:12.846] indexed block events module=t
If you need to restart your rollup, you can run the same command again:

```bash
rollkit start
testapp start
```

You will see that the block height will continue from where it left off:
Expand All @@ -39,7 +39,7 @@ I[2024-10-17|14:52:13.845] executed block module=B
I[2024-10-17|14:52:13.845] indexed block events module=txindex height=8
```

It is important to include any additional flags that you used when you first started your rollup. For example, if you used the `--rollkit.da_namespace` flag, you will need to include that flag when restarting your rollup to ensure your rollup continues to publish blobs to the same namespace.
It is important to include any additional flags that you used when you first started your rollup. For example, if you used the `--rollkit.da.namespace` flag, you will need to include that flag when restarting your rollup to ensure your rollup continues to publish blobs to the same namespace.

## Restart rollup after running out of funds

Expand Down
4 changes: 2 additions & 2 deletions public/gm/init-arabica-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh

echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh

# start the chain
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake"
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake"
4 changes: 2 additions & 2 deletions public/gm/init-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-local.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-local.sh

echo "gmd start --rollkit.aggregator --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --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"" >> restart-local.sh
echo "gmd start --rollkit.node.aggregator --rollkit.da.auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da.start_height \$DA_BLOCK_HEIGHT --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"" >> restart-local.sh

# start the chain
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --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"
gmd start --rollkit.node.aggregator --rollkit.da.auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da.start_height $DA_BLOCK_HEIGHT --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"
4 changes: 2 additions & 2 deletions public/gm/init-mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-mainnet.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-mainnet.sh

echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --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"" >> restart-mainnet.sh
echo "gmd start --rollkit.aggregator --rollkit.da.auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da.start_height \$DA_BLOCK_HEIGHT --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"" >> restart-mainnet.sh

Comment on lines +57 to 58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Broken quoting in generated restart script

The restart script suffers from the same SC2140 pattern. Refactor with a here-doc as shown for the Arabica script.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 57-57: Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A"B"C"?

(SC2140)

🤖 Prompt for AI Agents
In public/gm/init-mainnet.sh around lines 57 to 58, the echo command appending
to restart-mainnet.sh has broken quoting causing SC2140 issues. Refactor this by
replacing the echo with a here-doc to properly handle the complex quoting and
variable expansions, similar to the approach used in the Arabica script,
ensuring the generated restart script is correctly formatted and free of quoting
errors.

# start the chain
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --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"
gmd start --rollkit.aggregator --rollkit.da.auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da.start_height $DA_BLOCK_HEIGHT --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"
4 changes: 2 additions & 2 deletions public/gm/init-mocha-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh

echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --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"" >> restart-testnet.sh
echo "gmd start --rollkit.aggregator --rollkit.da.auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da.start_height \$DA_BLOCK_HEIGHT --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"" >> restart-testnet.sh

# start the chain
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --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"
gmd start --rollkit.aggregator --rollkit.da.auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da.start_height $DA_BLOCK_HEIGHT --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"