sudo apt update
sudo apt-get install git curl build-essential make jq gcc snapd chrony lz4 tmux unzip bc -y
2. Install Go
rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.22.4.linux-amd64.tar.gz | sudo tar -C /usr/local -zxvf -
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
3. Install Node
cd $HOME
rm -rf elys
git clone https://github.com/elys-network/elys.git
cd elys
git fetch --all
git checkout v2.3.0
make install
elysd version
4. Initialize Node
Replace NodeName
with your own moniker.
elysd init ApeironNodes --chain-id=elys-1
5. Download Genesis
wget -O genesis.json https://snapshots.polkachu.com/genesis/elys/genesis.json --inet4-only
6. Copy Genesis File
cp genesis.json ~/.elys/config/
7. Paste Peers to Config
sudo nano ~/.elys/config/config.toml
Add the peers:
PEERS=a92edecab7ec0f8778145e1035ef124155b8832a@116.202.140.75:27656,c4065c8b101d452bab5da8d91bd285ec38243d6b@37.27.137.156:26656,3a14a853b5c32ccf19cafd850d21659a80abb177@91.223.3.148:46656,28f2adcefe6c5d482944e4621d5a3d7e21496564@95.217.105.34:26656,2d35b0b85efef95018422b5f3b6ab8babdadbfe6@5.9.147.138:32656
8. Change External Address
PUB_IP=`curl -s -4 icanhazip.com`
sed -e "s|external_address = \".*\"|external_address = \"$PUB_IP:26656\"|g" ~/.elys/config/config.toml > ~/.elys/config/config.toml.tmp
mv ~/.elys/config/config.toml.tmp ~/.elys/config/config.toml
9. Create Service
sudo tee /etc/systemd/system/elysd.service > /dev/null <<EOF
[Unit]
Description=elysd Daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$(which elysd) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
10. Reload Daemon and Enable Service
bashCopyEditsudo systemctl daemon-reload
sudo systemctl enable elysd
11. Sync with Statesync
sudo systemctl stop elysd
elysd tendermint unsafe-reset-all --home ~/elys/ --keep-addr-book
Now set up statesync:
SNAP_RPC="https://elys-rpc.polkachu.com:443"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
Edit the config.toml
to use the statesync parameters:
-i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" ~/.elys/config/config.toml
12. Verify Config Changes
~/.elys/config/config.toml | grep 'rpc_servers'
more ~/.elys/config/config.toml | grep 'trust_height'
more ~/.elys/config/config.toml | grep 'trust_hash'
13. Launch Node
systemctl restart elysd
journalctl -u elysd -f