Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove gm tutorial reference from restart guide and clean up #490

Closed
wants to merge 1 commit into from
Closed
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
56 changes: 29 additions & 27 deletions guides/restart-rollup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,40 @@ This guide will teach you how to restart your Rollkit rollup.

This section covers the case where you need to restart your rollup.

In order to restart your rollup, you will need to run the `<your-binary>d start [...args]`
In order to restart your rollup, you simply need to run the `<your-binary>d start [...args]`
command for your rollup.
This [is the example for the GM world tutorial](https://github.com/rollkit/docs/blob/8c69bfc1a545b758a260198feecb39806e9794a7/scripts/gm/init-local.sh#L94).

For the GM world tutorial, you can restart the chain by
[running the `restart-local.sh` script that was generated by `init-local.sh`](https://github.com/rollkit/docs/blob/8c69bfc1a545b758a260198feecb39806e9794a7/scripts/gm/init-local.sh#L85-L91).
For example, if you ran the [quick start](../tutorials/quick-start.md) tutorial, you started your rollup with:

Use the `DA_START_HEIGHT`, `NAMESPACE`, and `AUTH_TOKEN` variables from your original
start command.
```bash
rollkit start
```

You would have see output similar to:

```bash
I[2024-10-17|14:52:12.845] Creating and publishing block module=BlockManager height=7
I[2024-10-17|14:52:12.845] finalized block module=BlockManager height=7 num_txs_res=0 num_val_updates=0 block_app_hash=
I[2024-10-17|14:52:12.845] executed block module=BlockManager height=7 app_hash=
I[2024-10-17|14:52:12.846] indexed block events module=txindex height=7
```

If you need to restart your rollup, you can run the same command again:

```bash
rollkit start
```

Using the `rollkit` rollup as an example, you can add something similar to your
respective start script to make it easier to save variables for later use:
You will see that the block height will continue from where it left off:

```bash
# the rest of your init script

# create a restart-local.sh file to restart the chain later
rm restart-local.sh
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-local.sh
echo "NAMESPACE=$NAMESPACE" >> restart-local.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-local.sh
echo "rollkit start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace \$NAMESPACE --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\"" >> restart-local.sh
I[2024-10-17|14:52:13.845] Creating and publishing block module=BlockManager height=8
I[2024-10-17|14:52:13.845] finalized block module=BlockManager height=8 num_txs_res=0 num_val_updates=0 block_app_hash=
I[2024-10-17|14:52:13.845] executed block module=BlockManager height=8 app_hash=
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.

## Restart rollup after running out of funds

Expand All @@ -38,7 +48,7 @@ you are using to post blocks to your DA and consensus layer runs out of funds (t
and you need to restart your rollup.

In this example, we're using Celestia's [Mocha testnet](https://docs.celestia.org/nodes/mocha-testnet/)
and running a [GM world rollup](./gm-world.md). In this example, our Celestia DA light node
and running the [quick start](../tutorials/quick-start.md). In this example, our Celestia DA light node
ran out of Mocha testnet TIA and we are unable to post new blocks to Celestia due to a
[`Code: 19`](https://github.com/cosmos/cosmos-sdk/blob/main/types/errors/errors.go#L95)
error. This error is defined by Cosmos SDK as:
Expand Down Expand Up @@ -74,15 +84,11 @@ cd $HOME && cd celestia-node

### 🛑 Stopping your rollup {#stopping-your-rollup}

You can stop your gm chain (or other Rollkit rollup) by using `Control + C` in your terminal where the node is running.
You can stop your rollup by using `Control + C` in your terminal where the node is running.

### ⛽ Increase the gas fee {#increase-gas-fee}

To reiterate, before restarting the chain, you will need to increase the gas fee in order to avoid a `Code: 19` error:

```bash
rollkit start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --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"
```
To reiterate, before restarting the chain, you will need to increase the gas fee in order to avoid a `Code: 19` error. See the [How to configure gas price](./gas-price.md) guide for more information.

### 🔁 Restarting your rollup {#restarting-your-rollup}

Expand All @@ -92,8 +98,4 @@ Follow the [restart rollup](#restart-rollup) section above.

In order to save your TIA, we also recommend stopping the chain with `Control + C`, changing the gas fee back to the default (in our case, 8000 utia) and restarting the chain:

```bash
rollkit start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --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"
```

🎊 Congrats! You've successfully restarted your Rollkit rollup after running out of TIA.
Loading