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: update restart guide #272

Merged
merged 3 commits into from
Nov 16, 2023
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
6 changes: 3 additions & 3 deletions scripts/cosmwasm/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ CHAINFLAG="--chain-id ${CHAIN_ID}"
TXFLAG="--chain-id ${CHAIN_ID} --gas-prices 0uwasm --gas auto --gas-adjustment 1.3"

# create a random Namespace ID for your rollup to post blocks to
NAMESPACE_ID=$(openssl rand -hex 10)
echo $NAMESPACE_ID
NAMESPACE=$(openssl rand -hex 10)
echo $NAMESPACE

# query the DA Layer start height, in this case we are querying
# an RPC endpoint provided by Celestia Labs. The RPC endpoint is
Expand Down Expand Up @@ -51,4 +51,4 @@ wasmd gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend tes
export AUTH_TOKEN=$(celestia light auth write --p2p.network arabica)

# start the chain
wasmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT
wasmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT
4 changes: 2 additions & 2 deletions scripts/gm/init-full-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gmd --home "$BASE_DIR" init FullNode --chain-id $CHAIN_ID
cp -R "$HOME/.gm/config/genesis.json" "$BASE_DIR/config/genesis.json"

DA_BLOCK_HEIGHT=your-block-height
NAMESPACE_ID="your-namespace"
NAMESPACE="your-namespace"
P2P_ID="your-p2p-id"

# rollkit logo
Expand Down Expand Up @@ -45,4 +45,4 @@ cat <<'EOF'

EOF

gmd --home $BASE_DIR start --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:46657 --grpc.address 127.0.0.1:9390 --grpc-web.address 127.0.0.1:9391 --p2p.seeds [email protected]:36656 --p2p.laddr "0.0.0.0:46656" --log_level debug
gmd --home $BASE_DIR start --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:46657 --grpc.address 127.0.0.1:9390 --grpc-web.address 127.0.0.1:9391 --p2p.seeds [email protected]:36656 --p2p.laddr "0.0.0.0:46656" --log_level debug
8 changes: 4 additions & 4 deletions scripts/gm/init-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TOKEN_AMOUNT="10000000000000000000000000stake"
STAKING_AMOUNT="1000000000stake"

# create a random Namespace ID for your rollup to post blocks to
NAMESPACE_ID=$(openssl rand -hex 10)
NAMESPACE=$(openssl rand -hex 10)

# query the DA Layer start height, in this case we are querying
# our local devnet at port 26657, the RPC. The RPC endpoint is
Expand Down Expand Up @@ -52,7 +52,7 @@ cat <<'EOF'
EOF

# echo variables for the chain
echo -e "\n\n\n\n\n Your NAMESPACE_ID is $NAMESPACE_ID \n\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n\n\n\n\n"
echo -e "\n\n\n\n\n Your NAMESPACE is $NAMESPACE \n\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n\n\n\n\n"

# build the gm chain with Rollkit
ignite chain build
Expand All @@ -78,7 +78,7 @@ gmd gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test
gmd collect-gentxs

# start the chain
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"

# uncomment the next command if you are using lazy aggregation
# gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rollkit.lazy_aggregator
# gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rollkit.lazy_aggregator
6 changes: 3 additions & 3 deletions scripts/gm/init-mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ STAKING_AMOUNT="1000000000stake"

# use a custom namespace ID for your chain
# this example uses "rollkit" in hexadecimal
NAMESPACE_ID=000000726f6c6c6b6974
echo $NAMESPACE_ID
NAMESPACE=000000726f6c6c6b6974
echo $NAMESPACE

# query the DA Layer start height, in this case we are querying
# an RPC endpoint provided by Celestia Labs. The RPC endpoint is
Expand Down Expand Up @@ -51,4 +51,4 @@ gmd collect-gentxs
AUTH_TOKEN=$(celestia light auth write)

# start the chain
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rollkit.lazy_aggregator
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rollkit.lazy_aggregator
6 changes: 3 additions & 3 deletions scripts/gm/init-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ TOKEN_AMOUNT="10000000000000000000000000stake"
STAKING_AMOUNT="1000000000stake"

# create a random Namespace ID for your rollup to post blocks to
NAMESPACE_ID=$(openssl rand -hex 10)
echo $NAMESPACE_ID
NAMESPACE=$(openssl rand -hex 10)
echo $NAMESPACE

# query the DA Layer start height, in this case we are querying
# an RPC endpoint provided by Celestia Labs. The RPC endpoint is
Expand Down Expand Up @@ -50,4 +50,4 @@ gmd collect-gentxs
export AUTH_TOKEN=$(celestia light auth write --p2p.network arabica)

# start the chain
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT
6 changes: 3 additions & 3 deletions scripts/recipes/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ TOKEN_AMOUNT="10000000000000000000000000stake"
STAKING_AMOUNT="1000000000stake"

# create a random Namespace ID for your rollup to post blocks to
NAMESPACE_ID=$(openssl rand -hex 10)
echo $NAMESPACE_ID
NAMESPACE=$(openssl rand -hex 10)
echo $NAMESPACE

# query the DA Layer start height, in this case we are querying
# an RPC endpoint provided by Celestia Labs. The RPC endpoint is
Expand Down Expand Up @@ -47,4 +47,4 @@ recipesd collect-gentxs
export AUTH_TOKEN=$(celestia light auth write --p2p.network arabica)

# start the chain
recipesd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT
recipesd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT
6 changes: 3 additions & 3 deletions scripts/wordle/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ TOKEN_AMOUNT="10000000000000000000000000stake"
STAKING_AMOUNT="1000000000stake"

# create a random Namespace ID for your rollup to post blocks to
NAMESPACE_ID=$(openssl rand -hex 10)
echo $NAMESPACE_ID
NAMESPACE=$(openssl rand -hex 10)
echo $NAMESPACE

# query the DA Layer start height, in this case we are querying
# an RPC endpoint provided by Celestia Labs. The RPC endpoint is
Expand Down Expand Up @@ -47,4 +47,4 @@ wordled collect-gentxs
export AUTH_TOKEN=$(celestia light auth write --p2p.network arabica)

# start the chain
wordled start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT
wordled start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT
4 changes: 2 additions & 2 deletions tutorials/bitcoin.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ bash init.sh
Set variables for starting the chain:

```bash
export NAMESPACE_ID=$(openssl rand -hex 8)
export NAMESPACE=$(openssl rand -hex 8)
```

<!-- export DA_HEIGHT=$(bitcoin-core.cli -regtest -rpcport=18332 -rpcuser=rpcuser rpcpassword=rpcpass getblockcount) -->

Start the chain:

```bash
ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height 1
ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height 1
```
Comment on lines 329 to 341
Copy link
Contributor

Choose a reason for hiding this comment

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

The variable NAMESPACE_ID has been correctly updated to NAMESPACE in the export statement, but the ethermintd start command still references the old variable name --rollkit.namespace_id. This should be updated to --rollkit.namespace to reflect the new naming convention.

- ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height 1
+ ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace $NAMESPACE --rollkit.da_start_height 1

Commitable suggestion

[!IMPORTANT]
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Set variables for starting the chain:
```bash
export NAMESPACE_ID=$(openssl rand -hex 8)
export NAMESPACE=$(openssl rand -hex 8)
```
<!-- export DA_HEIGHT=$(bitcoin-core.cli -regtest -rpcport=18332 -rpcuser=rpcuser rpcpassword=rpcpass getblockcount) -->
Start the chain:
```bash
ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height 1
ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height 1
```
Set variables for starting the chain:
```bash
export NAMESPACE=$(openssl rand -hex 8)

Start the chain:

ethermintd start --rollkit.aggregator true --rollkit.da_layer bitcoin --rollkit.da_config='{"host":"127.0.0.1:18332","user":"rpcuser","pass":"rpcpass","http_post_mode":true,"disable_tls":true}' --rollkit.namespace $NAMESPACE --rollkit.da_start_height 1

</details>
<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->


Congratulations! Now that you have your Ethermint and Bitcoin rollup running, you're ready to deploy some smart contracts to the EVM!
Expand Down
2 changes: 2 additions & 0 deletions tutorials/cosmwasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ This tutorial will explore developing with Rollkit,
which is still in Alpha stage. If you run into bugs, please write a Github
[Issue ticket](https://github.com/rollkit/docs/issues/new)
or let us know in our [Telegram](https://t.me/rollkit).

Learn how to [restart your rollup](restart-rollup.md).
:::

::: warning
Expand Down
10 changes: 5 additions & 5 deletions tutorials/full-and-sequencer-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in [Part One](./gm-world#part-one).

## Getting started

For running a full node, you will need to update `NAMESPACE_ID`,
For running a full node, you will need to update `NAMESPACE`,
`DA_HEIGHT`, and `P2P_ID` manually. You can retrieve
namespace and height from your terminal output
from when you ran the `init-local.sh` script.
Expand All @@ -37,7 +37,7 @@ ______ _ _ _ _ _
\_| \_| \___/ |_||_||_|\_\|_| \__|


Your NAMESPACE_ID is 31e2c345c895c3577bea // [!code focus]
Your NAMESPACE is 31e2c345c895c3577bea // [!code focus]

Your DA_BLOCK_HEIGHT is 5 // [!code focus]
```
Expand All @@ -59,8 +59,8 @@ Next, you can open the script and set your namespace and DA height from above:
```sh
DA_BLOCK_HEIGHT=your-block-height // [!code --]
DA_BLOCK_HEIGHT=5 // [!code ++]
NAMESPACE_ID="your-namespace" // [!code --]
NAMESPACE_ID="31e2c345c895c3577bea" // [!code ++]
NAMESPACE="your-namespace" // [!code --]
NAMESPACE="31e2c345c895c3577bea" // [!code ++]
P2P_ID="your-p2p-id"
```

Expand Down Expand Up @@ -89,7 +89,7 @@ for your script to use:

```bash
DA_BLOCK_HEIGHT=5
NAMESPACE_ID="31e2c345c895c3577bea"
NAMESPACE="31e2c345c895c3577bea"
P2P_ID="your-p2p-id" // [!code --]
P2P_ID="12D3KooWCmfJLkQjZUArWpNUDJSezeFiLYzCULXe1dEKY6ZpXZpk" // [!code ++]
```
Expand Down
2 changes: 2 additions & 0 deletions tutorials/gm-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ This tutorial will explore developing with Rollkit,
which is still in Alpha stage. If you run into bugs, please write a Github
[Issue ticket](https://github.com/rollkit/docs/issues/new)
or let us know in our [Telegram](https://t.me/rollkit).

Learn how to [restart your rollup](restart-rollup.md).
:::

::: warning
Expand Down
4 changes: 4 additions & 0 deletions tutorials/polaris-evm.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ layer. This integration uses a local-celestia-devnet. Rollkit
is used to deploy a Polaris EVM rollup without needing to set up a data
availability and consensus network.

::: tip
Learn how to [restart your rollup](restart-rollup.md).
:::

## Prerequisites

Before you can run Polaris EVM using Rollkit, you need to have the
Expand Down
2 changes: 2 additions & 0 deletions tutorials/recipe-book.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This tutorial will explore developing with Rollkit,
which is still in Alpha stage. If you run into bugs, please write a Github
[Issue ticket](https://github.com/rollkit/docs/issues/new)
or let us know in our [Telegram](https://t.me/rollkit).

Learn how to [restart your rollup](restart-rollup.md).
:::

::: warning
Expand Down
72 changes: 44 additions & 28 deletions tutorials/restart-rollup.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
# 🔄 How to restart your rollup

This guide will teach you how to restart your Rollkit rollup in the case that the node that you are using to post blocks to your DA and consensus layer runs out of funds (tokens).
This guide will teach you how to restart your Rollkit rollup.

## 📋 Table of contents for this tutorial {#toc}
## Restart rollup

The following tutorial is broken down into the following
sections:
This section covers the case where you need to restart your rollup.

::: details Table of contents
In order to restart your rollup, you will 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/d5a763dadb147e32a98127cd362c818960d62129/scripts/gm/init-local.sh#L81).

[[toc]]
For the GM World tutorial, you can restart the chain by running the `restart-local.sh`
script that was generated by `init-local.sh`.

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

## 💻 Setup of this example {#setup}
Using the `gmd` rollup as an example, you can add something similar to your
respective start script to make it easier to save variables for later use:

In this example, we're using Celestia's [Blockspacerace testnet](https://docs.celestia.org/nodes/blockspace-race/) and running an Ethermint chain. In this example, our Celestia DA light node ran out of Blockspace Race 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:
```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 "gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{\"base_url\":\"http://localhost:26658\",\"timeout\":60000000000,\"fee\":600000,\"gas_limit\":6000000,\"auth_token\":\"'\$AUTH_TOKEN'\"}' --rollkit.namespace_id \$NAMESPACE --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr \"0.0.0.0:36656\"" >> restart-local.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a discrepancy in the command line argument --rollkit.namespace_id which should be updated to --rollkit.namespace as per the pull request summary. This needs to be corrected to maintain consistency across the documentation and the codebase.

- echo "gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{\"base_url\":\"http://localhost:26658\",\"timeout\":60000000000,\"fee\":600000,\"gas_limit\":6000000,\"auth_token\":\"'\$AUTH_TOKEN'\"}' --rollkit.namespace_id \$NAMESPACE --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr \"0.0.0.0:36656\"" >> restart-local.sh
+ echo "gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{\"base_url\":\"http://localhost:26658\",\"timeout\":60000000000,\"fee\":600000,\"gas_limit\":6000000,\"auth_token\":\"'\$AUTH_TOKEN'\"}' --rollkit.namespace \$NAMESPACE --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr \"0.0.0.0:36656\"" >> restart-local.sh

Commitable suggestion

[!IMPORTANT]
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
echo "gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{\"base_url\":\"http://localhost:26658\",\"timeout\":60000000000,\"fee\":600000,\"gas_limit\":6000000,\"auth_token\":\"'\$AUTH_TOKEN'\"}' --rollkit.namespace_id \$NAMESPACE --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr \"0.0.0.0:36656\"" >> restart-local.sh
echo "gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{\"base_url\":\"http://localhost:26658\",\"timeout\":60000000000,\"fee\":600000,\"gas_limit\":6000000,\"auth_token\":\"'\$AUTH_TOKEN'\"}' --rollkit.namespace \$NAMESPACE --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr \"0.0.0.0:36656\"" >> restart-local.sh

```

## Restart rollup after running out of funds

This section covers the case that the node that
you are using to post blocks to your DA and consensus layer runs out of funds (tokens),
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
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:

```go
// ErrTxInMempoolCache defines an ABCI typed error where a tx already exists in the mempool.
Expand All @@ -35,12 +60,9 @@ This is what the errors will look like if your DA node runs out of funding or yo
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=1 module=BlockManager
4:51PM ERR DA layer submission failed Error="Codespace: 'sdk', Code: 19, Message: " attempt=2 module=BlockManager
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=3 module=BlockManager
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=4 module=BlockManager
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=5 module=BlockManager
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=6 module=BlockManager
```
Comment on lines 60 to 63
Copy link
Contributor

Choose a reason for hiding this comment

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

The error messages are helpful for troubleshooting, but it would be beneficial to include the full error message for clarity. The current snippet shows an incomplete message with "Message: ". It should be completed or explained that the actual message will vary based on the context.


## 💰 Re-fund your account {#refund-your-account}
### 💰 Re-fund your account {#refund-your-account}

First, you'll need to send more tokens to the account running your Celestia node. If you didn't keep track of your key, you can run the following to get your address:

Expand All @@ -49,34 +71,28 @@ cd $HOME && cd celestia-node
./cel-key list --keyring-backend test --node.type light --p2p.network <network>
```

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

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

## 🔁 Restarting your rollup {#restarting-your-rollup}
### 🛑 Stopping your rollup {#stopping-your-rollup}

First, be sure that you are using the same Namespace ID as you were before your Celestia node ran out of tokens.

Next, you'll need to fetch the current block height and set the variable accordingly for your start command. In this example, we're using [Blockspace Race testnet](https://docs.celestia.org/nodes/blockspace-race) on Celestia for DA and consensus:

```bash
DA_BLOCK_HEIGHT=$(curl https://rpc-blockspacerace.pops.one/block | jq -r '.result.block.header.height')
```
You can stop your gm chain (or other Rollkit 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
ethermintd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26659","timeout":60000000000,"gas_limit":6000000,"fee":8900}' --rollkit.namespace_id 8BE3175CBF305BC2 --rollkit.da_start_height $DA_BLOCK_HEIGHT
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":800000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
```

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

Follow the [restart rollup](#restart-rollup) section above.

### 🛢️ Reduce gas fee & restart again {#reduce-gas-fee-restart-again}

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), fetching current block height, and restarting the chain:
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
ethermintd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26659","timeout":60000000000,"gas_limit":6000000,"fee":8000}' --rollkit.namespace_id 8BE3175CBF305BC2 --rollkit.da_start_height $DA_BLOCK_HEIGHT
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
Copy link
Contributor

Choose a reason for hiding this comment

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

The commands provided for increasing and reducing the gas fee are clear and show the necessary changes. However, the --rollkit.namespace_id argument should be updated to --rollkit.namespace to reflect the new naming convention.

- gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":800000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
+ gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":800000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"

- gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
+ gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"

Commitable suggestion

[!IMPORTANT]
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"
gmd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --p2p.laddr "0.0.0.0:36656"

```

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