# Node Installation

<figure><img src="https://explorer.indonode.net/logos/c4e.png" alt="" width="188"><figcaption></figcaption></figure>

***

| Version | Chain-id | Wasm     |
| ------- | -------- | -------- |
| 1.2.1   | perun-1  | DISABLED |

### Setup Server

```shell
# Update Packages
sudo apt update && apt upgrade -y
sudo apt install curl git jq lz4 build-essential unzip fail2ban ufw -y

# Set Firewall
sudo apt install -y ufw
sudo ufw default allow outgoing
sudo ufw default deny incoming
sudo ufw allow ssh
sudo ufw allow 9100

# Enable Firewall
sudo ufw enable

# Install Go
ver="1.20"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version

# Install Cosmovisor (OPTIONAL If you are using Cosmovisor)
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
```

### Node Installation

There is 2 ways to install node , using Cosmovisor or Run the binary directly, you can choose whats you prefer

{% tabs %}
{% tab title="Cosmovisor (Recommended)" %}
{% code fullWidth="true" %}

```sh
# Download and install binary
cd $HOME
rm -rf c4e-chain/
git clone https://github.com/chain4energy/c4e-chain.git
cd c4e-chain/
git checkout v1.2.1
make build


# Setup Cosmovisor Symlinks
mkdir -p $HOME/.c4e-chain/cosmovisor/genesis/bin
mv build/c4ed $HOME/.c4e-chain/cosmovisor/genesis/bin/
rm -rf build

sudo ln -s $HOME/.c4e-chain/cosmovisor/genesis $HOME/.c4e-chain/cosmovisor/current
sudo ln -s $HOME/.c4e-chain/cosmovisor/current/bin/c4ed /usr/local/bin/c4ed


# Set Configuration for your node
c4ed config chain-id perun-1
c4ed config keyring-backend file


# Init your node
# You can change "MyNode" to anything you like
c4ed init MyNode --chain-id perun-1


# Add Genesis File and Addrbook
wget https://raw.githubusercontent.com/chain4energy/c4e-chains/main/perun-1/genesis.json -O $HOME/.c4e-chain/config/genesis.json


#Configure Seeds and Peers
SEEDS=""
PEERS="7c7c5158c5b67797f85a4e376db8b79da0dadbac@212.109.147.99:26656,6e07322479eb7e31c1b33513544e03245b6de561@185.252.235.83:26656,d81f51b4a1aae66792fb1717589fa28975f328b0@164.68.125.243:26656,bb9cbee9c391f5b0744d5da0ea1abc17ed0ca1b2@159.69.56.25:26656,d1c10bb6a139ddb29af596fc888bd57c143124b7@93.189.30.124:26656,0dd318e3945ff5c1821e844b68e26e8eac67c063@95.216.42.88:35656,8e002ff6811e18bc6686beb4e3f15038ef6a35d3@65.109.163.248:36656,66cccfd5af1180c5858baf331cf790d1bc4f70a6@65.109.92.240:17096,c68883e64bc211dbdd3cc2be72cc9fa09f7ddde4@65.109.133.87:26656,d09b54188bda615c13cdd92a18bef11bed8d4735@79.137.68.96:26656"

sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.c4e-chain/config/config.toml


# Set Pruning, Enable Prometheus, Gas Price, and Indexer
PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.c4e-chain/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.c4e-chain/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025uc4e\"/" $HOME/.c4e-chain/config/app.toml

# Set Service file
sudo tee /etc/systemd/system/c4ed.service > /dev/null << EOF
[Unit]
Description=c4ed node service
After=network-online.target

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.c4e-chain"
Environment="DAEMON_NAME=c4ed"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable c4ed


# Start the Node
sudo systemctl restart c4ed
sudo journalctl -fu c4ed -o cat
```

{% endcode %}
{% endtab %}

{% tab title="Non-Cosmovisor" %}

```sh
# Download and install binary
cd $HOME
rm -rf c4e-chain/
git clone https://github.com/chain4energy/c4e-chain.git
cd c4e-chain/
git checkout v1.2.1
make install


# Set Configuration for your node
c4ed config chain-id perun-1
c4ed config keyring-backend file


# Init your node
# You can change "MyNode" to anything you like
c4ed init MyNode --chain-in perun-1


# Add Genesis File and Addrbook
wget https://raw.githubusercontent.com/chain4energy/c4e-chains/main/perun-1/genesis.json -O $HOME/.c4e-chain/config/genesis.json


#Configure Seeds and Peers
SEEDS=""
PEERS="7c7c5158c5b67797f85a4e376db8b79da0dadbac@212.109.147.99:26656,6e07322479eb7e31c1b33513544e03245b6de561@185.252.235.83:26656,d81f51b4a1aae66792fb1717589fa28975f328b0@164.68.125.243:26656,bb9cbee9c391f5b0744d5da0ea1abc17ed0ca1b2@159.69.56.25:26656,d1c10bb6a139ddb29af596fc888bd57c143124b7@93.189.30.124:26656,0dd318e3945ff5c1821e844b68e26e8eac67c063@95.216.42.88:35656,8e002ff6811e18bc6686beb4e3f15038ef6a35d3@65.109.163.248:36656,66cccfd5af1180c5858baf331cf790d1bc4f70a6@65.109.92.240:17096,c68883e64bc211dbdd3cc2be72cc9fa09f7ddde4@65.109.133.87:26656,d09b54188bda615c13cdd92a18bef11bed8d4735@79.137.68.96:26656"

sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.c4e-chain/config/config.toml


# Set Pruning, Enable Prometheus, Gas Prices, and Indexer
PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.c4e-chain/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.c4e-chain/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025uc4e\"/" $HOME/.c4e-chain/config/app.toml


# Set Service file
sudo tee /etc/systemd/system/c4ed.service > /dev/null <<EOF
[Unit]
Description=c4ed node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which c4ed) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable c4ed


# Start the Node
sudo systemctl restart c4ed
sudo journalctl -fu c4ed -o cat
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.indonode.net/mainnet/c4e/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
