# Empeiria's Testnet

<figure><img src="https://1882782965-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJKcLF887TYMWzFb2yWrk%2Fuploads%2FbAiPJ7omsPNoBH6XeVEp%2Fimage.png?alt=media&#x26;token=a438de58-ce0a-47fc-a35b-e9e6ed9da485" alt="" width="360"><figcaption></figcaption></figure>

#### Testnet <a href="#testnet" id="testnet"></a>

We recommend the following hardware specifications:

| Characteristic   | Specification             |
| ---------------- | ------------------------- |
| Operating System | Ubuntu 18.04 or later LTS |
| Number of CPUs   | 6                         |
| RAM              | 32GB                      |
| SSD              | 240GB                     |

### Update :&#x20;

```
sudo apt update && sudo apt upgrade -y
```

```
sudo apt install -y git gcc make unzip jq
```

#### GO :

```
cd $HOME
VER="1.22.3"
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"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
```

#### Add Go to the path:

```
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
echo 'export PATH=$PATH:/home/$USER/go/bin' >> ~/.profile

source ~/.profile
```

### Install binary from source code :  <a href="#id-23bc" id="id-23bc"></a>

If you want acsess file mail : <validators@empe.io>

```
git clone --depth 1 --branch  release/v0.1.0  https://github.com/empe-io/empe-chain
```

```
cd empe-chain/
make install
```

#### Check binary version should be equal :&#x20;

```
emped version
```

Result : output: v0.1.0

### Configure a node <a href="#id-74fc" id="id-74fc"></a>

Change "Your Moniker"

```
export CHAINID=empe-testnet-2
export MONIKER=your moniker 
```

#### Init chain and delete generated genesis:

```
emped init $MONIKER --chain-id $CHAINID
rm -rf ~/.empe-chain/config/genesis.json
```

#### Clone repository with chains:

```
git clone https://github.com/empe-io/empe-chains.git   
```

```
cd empe-chains/testnet-2/
```

#### Copy genesis file from repo :

```
cp genesis.json ~/.empe-chain/config/
```

#### Change the persistent peers inside `config.toml` file:

```
sed -e "s|persistent_peers = \".*\"|persistent_peers = \"$(cat .data | grep -oP 'Persistent peers\s+\K\S+')\"|g" ~/.empe-chain/config/config.toml > ~/.empe-chain/config/config.toml.tmp
mv ~/.empe-chain/config/config.toml.tmp  ~/.empe-chain/config/config.toml 
```

#### Set minimum gas price in app.toml file :

```
sed -e "s|minimum-gas-prices = \".*\"|minimum-gas-prices = \"$(cat .data | grep -oP 'Minimum Gas Price\s+\K\S+')\"|g" ~/.empe-chain/config/app.toml > ~/.empe-chain/config/app.toml.tmp
mv ~/.empe-chain/config/app.toml.tmp  ~/.empe-chain/config/app.toml
```

#### Change `external_address` value to contact your node using the public IP of your node:

```
PUB_IP=`curl –s –4 icanhazip.com`
sed -e "s|external_address = \".*\"|external_address = \"$PUB_IP:26656\"|g" ~/.empe-chain/config/config.toml > ~/.empe-chain/config/config.toml.tmp
mv ~/.empe-chain/config/config.toml.tmp  ~/.empe-chain/config/config.toml
```

### Cosmovisor setup <a href="#a94c" id="a94c"></a>

```
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.6.0
```

#### Create dir structure for cosmovisor :

```
export DAEMON_NAME=emped
export DAEMON_HOME=$HOME/.empe-chain/
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades
```

#### Copy emped binary to cosmovisor genesis bin :&#x20;

```
cp ~/go/bin/emped $DAEMON_HOME/cosmovisor/genesis/bin
$DAEMON_HOME/cosmovisor/genesis/bin/emped version
```

#### Setup systemd :

```
sudo tee /etc/systemd/system/cosmovisor.service> /dev/null <<EOF
[Unit]
Description=cosmovisor
After=network-online.target

[Service]
User=$USER
ExecStart=/home/$USER/go/bin/cosmovisor start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=emped"
Environment="DAEMON_HOME=/home/$USER/.empe-chain"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
[Install]
WantedBy=multi-user.target

EOF
```

#### Run a node:

```
sudo systemctl enable cosmovisor  
```

```
sudo systemctl start cosmovisor
```

#### Check status :

```
sudo systemctl status cosmovisor
```

#### Logs from cosmovisor :

```
sudo journalctl -f -u cosmovisor
```

#### Full state sync from archive snapshot

```
curl -O https://archive-testnet.empe.io/$ARCHIVE
tar -xvf $ARCHIVE -C ~/.empe-chain/data
rm $ARCHIVE
```

```
sudo systemctl daemon-reload
```

```
sudo systemctl restart
```

### Run a Validator <a href="#c774" id="c774"></a>

#### Requirements :  <a href="#id-4f1b" id="id-4f1b"></a>

```
emped status | jq .SyncInfo.catching_up
```

Result : false

**Add wallet key ( change wallet ( wallet : walletname) )**

```
emped keys add wallet
```

#### Example - Looks like a :&#x20;

```
emped keys add validator
Enter keyring passphrase:
Re-enter keyring passphrase:

- name: validator
  type: local
  address: empe1atqq8lmeptgn2jlx2q8r42p572yhh6lzle7vng
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A8D47crCW+YkFGduj6brpuzectp3D61xRIx/qbEGGTif"}'
  mnemonic: ""
```

**Create Your Validator :**&#x20;

```
emped tendermint show-validator
```

#### Change - Keyname - validator name  :&#x20;

```
emped tx staking create-validator \
  --amount=10000000uempe \
  --pubkey=$(emped tendermint show-validator) \
  --moniker=<YOUR_MONIKER> \
  --chain-id=empe-testnet-2\
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --gas="auto" \
  --min-self-delegation="1000000" \
  --fees=20uempe \
  --from=<KEY_NAME>
```

#### Check Your Validator :&#x20;

```
emped query tendermint-validator-set | grep "$(emped tendermint show-validator | jq .key  | tr -d \")"
```

SAVE THIS FILE !!!!!!!!!!!!!!!!!! SAVE !

\~/.emped-chain/config/priv\_validator\_key.json
