🔄 How to restart your Application
This guide will teach you how to restart your Application.
Restart
This section covers the case where you need to restart your chain.
In order to restart your chain, you simply need to run the <your-binary>d start [...args]
command.
For example, if you ran the quick start tutorial, you started your chain with:
{APP_BINARY} start
You would have see output similar to:
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 chain, you can run the same command again:
{APP_BINARY} start
You will see that the block height will continue from where it left off:
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 chain. For example, if you used the --rollkit.da.namespace
flag, you will need to include that flag when restarting your chain to ensure your chain continues to publish blobs to the same namespace.
Restart 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.
In this example, we're using Celestia's Mocha testnet and running the quick start. 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
error. This error is defined by Cosmos SDK as:
// ErrTxInMempoolCache defines an ABCI typed error where a tx already exists in the mempool.
ErrTxInMempoolCache = Register(RootCodespace, 19, "tx already in mempool")
In order to get around this error, and the same error on other applications, you will need to re-fund your Celestia account and increase the gas fee. This will override the transaction that is stuck in the mempool.
If you top up the balance of your node and don't increase the gas fee, you will still encounter the Code: 19
error because there is a transaction (posting block to DA) that is duplicate to one that already exists. In order to get around this, you'll need to increase the gas fee and restart the chain.
🟠 Errors in this example
This is what the errors will look like if your DA node runs out of funding or you restart the chain without changing the gas fee:
4:51PM INF submitting block to DA layer height=28126 module=BlockManager
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
💰 Re-fund 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:
cd $HOME && cd celestia-node
./cel-key list --keyring-backend test --node.type light --p2p.network <network>
⛽ Increase the gas fee
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 guide for more information.
🛢️ 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) and restarting the chain:
🎊 Congrats! You've successfully restarted your chain after running out of TIA.