Installation

Current Version
Port Prefix

v1.0.0

220

Minimum hardware Requirements #

CPU : 4x CPUs
Ram : 8GB RAM 
Storage: 100GB of storage (SSD or NVME)

Setting Variables

echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export elys_CHAIN_ID="elysicstestnet-1"" >> $HOME/.bash_profile
echo "export elys_PORT="220"" >> $HOME/.bash_profile
echo "export DAEMON_NAME="elysd"" >> $HOME/.bash_profile
echo "export DAEMON_HOME=$HOME/.elys"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Install dependencies

sudo apt update && sudo apt upgrade -y && sudo apt-get install make build-essential gcc git jq chrony lz4 tmux unzip bc -y && sudo apt install -y curl git jq lz4 build-essential unzip

INSTALL GO

ver="1.20.5" && \
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

# Adding Go's location to profile
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF

source $HOME/.profile
go version

Download and build binary

# Clone project repository
cd $HOME
rm -rf elys
git clone https://github.com/elys-network/elys.git
cd elys
git checkout v1.0.0

# Build binaries
make install

# Prepare binaries for Cosmovisor
mkdir -p $HOME/.elys/cosmovisor/genesis/bin
cp $HOME/go/bin/elysd $HOME/.elys/cosmovisor/genesis/bin/


# Create application symlinks
sudo ln -s $HOME/.elys/cosmovisor/genesis $HOME/.elys/cosmovisor/current -f
sudo ln -s $HOME/.elys/cosmovisor/current/bin/elysd /usr/local/bin/elysd -f

Installing Cosmovisor

# Download and install Cosmovisor
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest

# Create service
sudo tee /etc/systemd/system/elys.service > /dev/null << EOF
[Unit]
Description=elys 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/.elys"
Environment="DAEMON_NAME=elysd"
Environment="UNSAFE_SKIP_BACKUP=true"


[Install]
WantedBy=multi-user.target
EOF

# Reload Daemon
sudo systemctl daemon-reload
sudo systemctl enable elys.service

Initialize Node & Configuring Node Port

# Set node configuration
elysd init $MONIKER --chain-id elysicstestnet-1
elysd config node tcp://localhost:22057
elysd config keyring-backend file

# Set custom ports in client.toml
sed -i.bak -e "s%:26457%:${elys_PORT}57%g"  $HOME/.elys/config/client.toml

# Set custom ports in app.toml
sed -i.bak -e "s%:1317%:${elys_PORT}17%g;
s%:8080%:${elys_PORT}80%g;
s%:9090%:${elys_PORT}90%g;
s%:9091%:${elys_PORT}91%g;
s%:8545%:${elys_PORT}45%g;
s%:8546%:${elys_PORT}46%g;
s%:6065%:${elys_PORT}65%g" $HOME/.elys/config/app.toml

# Set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${elys_PORT}58%g;
s%:26657%:${elys_PORT}57%g;
s%:6060%:${elys_PORT}60%g;
s%:26656%:${elys_PORT}56%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${elys_PORT}56\"%;
s%:26660%:${elys_PORT}60%g" $HOME/.elys/config/config.toml

# Download genesis and addrbook
wget -O $HOME/.elys/config/genesis.json https://files.nodeshub.online/testnet/elys/genesis.json
wget -O $HOME/.elys/config/addrbook.json https://files.nodeshub.online/testnet/elys/addrbook.json

# Add Seeds and Peers
SEEDS="6f6a3a908634b79b6fe7c4988efec2553f188234@elys.test.seed.nodeshub.online:22056"
PEERS="$(curl -s https://files.nodeshub.online/mainnet/elys/peers.txt)"
sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|; s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.elys/config/config.toml

# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0003uelys,0.001ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349,0.001ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9\"|" $HOME/.elys/config/app.toml

# Set pruning and indexer to Null
sed -i -e "s/^pruning =./pruning = "custom"/" $HOME/.elys/config/app.toml sed -i -e "s/^pruning-keep-recent =./pruning-keep-recent = "100"/"
$HOME/.elys/config/app.toml sed -i -e "s/^pruning-interval =./pruning-interval = "50"/" $HOME/.elys/config/app.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.elys/config/config.toml
  
  

Download Snapshot

sudo systemctl stop elys
# Back up priv_validator_state.json if needed
cp ~/.elys/data/priv_validator_state.json  ~/.elys/priv_validator_state.json.backup

# On some tendermint chains
elysd unsafe-reset-all --home $HOME/.elys --keep-addr-book

# On other tendermint chains
elysd tendermint unsafe-reset-all --home $HOME/.elys --keep-addr-book

SNAP_URL=$(curl -s https://files.nodeshub.online/testnet/elys/snapshot/snap-info.txt | grep "Snapshot_URL" | cut -d ' ' -f 2)
curl ${SNAP_URL} | lz4 -dc - | tar -xf - -C $HOME/.elys

cp $HOME/.elys/priv_validator_state.json.backup $HOME/.elys/data/priv_validator_state.json
sudo systemctl restart elys && sudo journalctl -u elys -f -o cat

Start service and check the logs

sudo systemctl start elys.service && sudo journalctl -u elys -f -o cat

Last updated