Skip to content

Empeiria

Emperiria banner
# Hardware requirements

We recommend the following hardware specifications:

CharacteristicSpecification
Operating SystemUbuntu 18.04 or later LTS
Number of CPUs6
RAM32GB
SSD240GB
1. Update & install dependencies
Terminal window
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq htop tmux chrony liblz4-tool -y
2. Install Go
Terminal window
cd $HOME
VER="1.22.2"
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
go version
3. Set Vars
Terminal window
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export EMPE_CHAIN_ID="empe-testnet-2"" >> $HOME/.bash_profile
echo "export EMPE_PORT="43"" >> $HOME/.bash_profile
source $HOME/.bash_profile
4. Download Binary
Terminal window
cd $HOME
curl -LO https://github.com/empe-io/empe-chain-releases/raw/master/v0.2.2/emped_v0.2.2_linux_amd64.tar.gz
tar -xvf emped_v0.2.2_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
chmod +x emped
sudo mv emped ~/go/bin
source ~/.bash_profile
emped version
5. Config and Init app
Terminal window
emped config node tcp://localhost:${EMPE_PORT}657
emped config keyring-backend os
emped config chain-id $EMPE_CHAIN_ID
emped init $MONIKER --chain-id $EMPE_CHAIN_ID
6. Download Genesis file and Addrbook
Terminal window
wget -O $HOME/.empe-chain/config/genesis.json https://testnet-files.syanodes.my.id/empe-genesis.json
wget -O $HOME/.empe-chain/config/addrbook.json https://testnet-files.syanodes.my.id/empe-addrbook.json
7. Set custom port (Optional)
Terminal window
sed -i.bak -e "s%:1317%:${EMPE_PORT}317%g;
s%:8080%:${EMPE_PORT}080%g;
s%:9090%:${EMPE_PORT}090%g;
s%:9091%:${EMPE_PORT}091%g;
s%:8545%:${EMPE_PORT}545%g;
s%:8546%:${EMPE_PORT}546%g;
s%:6065%:${EMPE_PORT}065%g" $HOME/.empe-chain/config/app.toml
sed -i.bak -e "s%:26658%:${EMPE_PORT}658%g;
s%:26657%:${EMPE_PORT}657%g;
s%:6060%:${EMPE_PORT}060%g;
s%:26656%:${EMPE_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${EMPE_PORT}656\"%;
s%:26660%:${EMPE_PORT}660%g" $HOME/.empe-chain/config/config.toml
8. Config Seeds and Peers
Terminal window
SEEDS=""
PEERS="ce90310b1ff5f8d874b73953723906922c455152@65.109.62.115:20656,edfc10bbf28b5052658b3b8b901d7d0fc25812a0@193.70.45.145:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.empe-chain/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.001uempe\"/" $HOME/.empe-chain/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.empe-chain/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.empe-chain/config/config.toml
9. Config Pruning
Terminal window
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.empe-chain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.empe-chain/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.empe-chain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.empe-chain/config/app.toml
10. Create service file
Terminal window
sudo tee /etc/systemd/system/emped.service > /dev/null <<EOF
[Unit]
Description=empe-testnet
After=network-online.target
[Service]
User=$USER
ExecStart=$(which emped) start --home $HOME/.empe-chain
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Enable and start

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable emped
sudo systemctl start emped && sudo journalctl -fu emped -o cat
# Snapshot

Latest snapshot: Block 1009741

Terminal window
cd $HOME
rm -f empe_snapshot.lz4
cp $HOME/.empe-chain/data/priv_validator_state.json $HOME/.empe-chain/priv_validator_state.json.backup
emped tendermint unsafe-reset-all --home $HOME/.empe-chain --keep-addr-book
if curl -s --head https://vps4.josephtran.xyz/empe/empe_snapshot.lz4 | head -n 1 | grep "200" > /dev/null; then
echo "Snapshot found, downloading..."
aria2c -x5 -s4 https://vps4.josephtran.xyz/empe/empe_snapshot.lz4 -o empe_snapshot.lz4
if [ $? -eq 0 ]; then
echo "Download complete, extracting..."
lz4 -dc empe_snapshot.lz4 | tar -xf - -C $HOME/.empe-chain
if [ $? -eq 0 ]; then
echo "Snapshot downloaded and extracted successfully."
else
echo "Failed to extract snapshot."
fi
else
echo "Failed to download snapshot."
fi
else
echo "No snapshot found."
fi
mv $HOME/.empe-chain/priv_validator_state.json.backup $HOME/.empe-chain/data/priv_validator_state.json
# Check status
Terminal window
emped status | jq
Terminal window
emped status | jq '{ latest_block_height: .SyncInfo.latest_block_height, catching_up: .SyncInfo.catching_up }'
# Block sync left:
Terminal window
while true; do
local_height=$(emped status | jq -r '.SyncInfo.latest_block_height');
network_height=$(curl -s https://rpc.empe.josephtran.xyz/status | jq -r '.result.sync_info.latest_block_height')
blocks_left=$((network_height - local_height));
echo -e "\033[1;38mYour node height:\033[0m \033[1;34m$local_height\033[0m | \033[1;35mNetwork height:\033[0m \033[1;36m$network_height\033[0m | \033[1;29mBlocks left:\033[0m \033[1;31m$blocks_left\033[0m";
sleep 5;
done