-
Notifications
You must be signed in to change notification settings - Fork 51
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 |
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a discrepancy in the command line argument - 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
Suggested change
|
||||||
``` | ||||||
|
||||||
## 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. | ||||||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
|
||||||
## 💰 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: | ||||||
|
||||||
|
@@ -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" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 - 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
Suggested change
|
||||||
``` | ||||||
|
||||||
🎊 Congrats! You've successfully restarted your Rollkit rollup after running out of TIA. |
There was a problem hiding this comment.
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 toNAMESPACE
in the export statement, but theethermintd start
command still references the old variable name--rollkit.namespace_id
. This should be updated to--rollkit.namespace
to reflect the new naming convention.Commitable suggestion
Start the chain: