> For the complete documentation index, see [llms.txt](https://services.liveraven.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://services.liveraven.net/cosmos-testnets/mantra-chain/maintenance.md).

# Maintenance

{% tabs %}
{% tab title="⚡️ Utility" %}

#### UPDATE PORTS

{% code overflow="wrap" fullWidth="false" %}

```bash
CUSTOM_PORT=11
```

{% endcode %}

**set custom ports in config.toml file**

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%g;
s%:26657%:${CUSTOM_PORT}657%g;
s%:6060%:${CUSTOM_PORT}060%g;
s%:26656%:${CUSTOM_PORT}656%g;
s%:26660%:${CUSTOM_PORT}660%g" $HOME/.mantrachain/config/config.toml
```

{% endcode %}

**set custom ports in app.toml**

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i.bak -e "s%:1317%:${CUSTOM_PORT}317%g;
s%:8080%:${CUSTOM_PORT}080%g;
s%:9090%:${CUSTOM_PORT}090%g;
s%:9091%:${CUSTOM_PORT}091%g;
s%:8545%:${CUSTOM_PORT}545%g;
s%:8546%:${CUSTOM_PORT}546%g;
s%:6065%:${CUSTOM_PORT}065%g" $HOME/.mantrachain/config/app.toml
```

{% endcode %}

**set custom ports in client.toml file**

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i.bak -e "s%:26657%:${CUSTOM_PORT}657%g" $HOME/.mantrachain/config/client.toml
```

{% endcode %}

#### UPDATE INDEXER

**Disable indexer**

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.mantrachain/config/config.toml
```

{% endcode %}

**Enable indexer**

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i -e 's|^indexer *=.*|indexer = "kv"|' $HOME/.mantrachain/config/config.toml
```

{% endcode %}

#### UPDATE PRUNING

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i   -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
  $HOME/.mantrachain/config/app.toml
```

{% endcode %}
{% endtab %}

{% tab title="🚨 Maintenance" %}

#### GET VALIDATOR INFO

{% code overflow="wrap" fullWidth="false" %}

```bash
mantrachaind status 2>&1 | jq .ValidatorInfo
```

{% endcode %}

#### GET SYNC INFO

{% code overflow="wrap" fullWidth="false" %}

```bash
mantrachaind status 2>&1 | jq .SyncInfo
```

{% endcode %}

#### GET NODE PEER

{% code overflow="wrap" fullWidth="false" %}

```bash
echo $(mantrachaind tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.mantrachain/config/config.toml \
| sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
```

{% endcode %}

#### CHECK IF VALIDATOR KEY IS CORRECT

{% code overflow="wrap" fullWidth="false" %}

```bash
[[ $(mantrachaind q staking validator $(mantrachaind keys show wallet --bech val -a) -oj \
| jq -r .consensus_pubkey.key) = $(mantrachaind status | jq -r .ValidatorInfo.PubKey.value) ]] \
&& echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"
```

{% endcode %}

#### GET LIVE PEERS

{% code overflow="wrap" fullWidth="false" %}

```bash
curl -sS http://localhost:15657/net_info \
| jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' \
| awk -F ':' '{print $1":"$(NF)}'
```

{% endcode %}

#### SET MINIMUM GAS PRICE

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0002uom\"/" $HOME/.mantrachain/config/app.toml
```

{% endcode %}

#### ENABLE PROMETHEUS

{% code overflow="wrap" fullWidth="false" %}

```bash
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.mantrachain/config/config.toml
```

{% endcode %}

#### RESET CHAIN DATA - !!!BE CAREFUL HERE!!!

{% code overflow="wrap" fullWidth="false" %}

```bash
mantrachaind tendermint unsafe-reset-all --keep-addr-book --home $HOME/.mantrachain --keep-addr-book
```

{% endcode %}

#### REMOVE NODE

Please, before proceeding with the next step! All chain data will be lost! Make sure you have backed up your priv\_validator\_key.json!

{% code overflow="wrap" fullWidth="false" %}

```bash
cd $HOME
sudo systemctl stop mantrachaind.service
sudo systemctl disable mantrachaind.service
sudo rm /etc/systemd/system/mantrachaind.service
sudo systemctl daemon-reload
rm -f $(which mantrachaind)
rm -rf $HOME/.mantrachain
rm -rf $HOME/mantrachaind
```

{% endcode %}
{% endtab %}

{% tab title="⚙️ Service Management" %}

#### RELOAD SERVICE CONFIGURATION

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl daemon-reload
```

{% endcode %}

#### ENABLE SERVICE

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl enable mantrachaind.service
```

{% endcode %}

#### DISABLE SERVICE

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl disable mantrachaind.service
```

{% endcode %}

#### START SERVICE

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl start mantrachaind.service
```

{% endcode %}

#### STOP SERVICE

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl stop mantrachaind.service
```

{% endcode %}

#### RESTART SERVICE

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl restart mantrachaind.service
```

{% endcode %}

#### CHECK SERVICE STATUS

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo systemctl status mantrachaind.service
```

{% endcode %}

#### CHECK SERVICE LOGS

{% code overflow="wrap" fullWidth="false" %}

```bash
sudo journalctl -u mantrachaind.service -f --no-hostname -o cat --since 1h
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://services.liveraven.net/cosmos-testnets/mantra-chain/maintenance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
