Testnet

Installation Dependencies

# Install dependencies for building from source
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
sudo apt update
sudo apt install -y curl git jq lz4 build-essential
			
# Install Go
sudo rm -rf /usr/local/go
curl -L https://go.dev/dl/go1.21.6.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
source .bash_profile

Environment Variable Configuration


Download Binary

cd $HOME
rm -rf prysm
git clone https://github.com/kleomedes/prysm prysm
cd prysm
git checkout v0.1.0-devnet
make install

Config And Init

prysmd init $MONIKER
sed -i -e "s|^node *=.*|node = "tcp://localhost:${PRYSM}657"|" $HOME/.prysm/config/client.toml

Genesis And Addrbook

wget -O $HOME/.prysm/config/genesis.json https://snapshot.sipalingtestnet.com/prysm/genesis.json
wget -O $HOME/.prysm/config/addrbook.json https://snapshot.sipalingtestnet.com/prysm/addrbook.json

Seeds And Peers

SEEDS="0bec7d2970be72fd1e8352141a46da3a0398c498@2a01:4f9:6b:2099::2:12656"
PEERS="https://rpc.prysm.sipalingtestnet.com/net_info?"
sed -i -e "/^[p2p]/,/^[/{s/^[[:space:]]*seeds *=.*/seeds = "$SEEDS"/}" -e "/^[p2p]/,/^[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = "$PEERS"/}" $HOME/.prysm/config/config.toml

Costum Port

# set custom ports in app.toml
sed -i.bak -e "s%:1317%:${PRYSM}317%g;
s%:8080%:${PRYSM}080%g;
s%:9090%:${PRYSM}090%g;
s%:9091%:${PRYSM}091%g;
s%:8545%:${PRYSM}545%g;
s%:8546%:${PRYSM}546%g;
s%:6065%:${PRYSM}065%g" $HOME/.prysm/config/app.toml

# set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${PRYSM}658%g;
s%:26657%:${PRYSM}657%g;
s%:6060%:${PRYSM}060%g;
s%:26656%:${PRYSM}656%g;
s%^external_address = ""%external_address = "$(wget -qO- eth0.me):${PRYSM}656"%;
s%:26660%:${PRYSM}660%g" $HOME/.prysm/config/config.toml

Pruning And Set Gas

# config pruning
sed -i -e "s/^pruning *=.*/pruning = "custom"/" $HOME/.prysm/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = "100"/" $HOME/.prysm/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = "50"/" $HOME/.prysm/config/app.toml

# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.0025uprysm"|g' $HOME/.prysm/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.prysm/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = "null"/" $HOME/.prysm/config/config.toml

Service File

sudo tee /etc/systemd/system/prysmd.service > /dev/null <<EOF
[Unit]
Description=Prysm node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.prysm
ExecStart=$(which prysmd) start --home $HOME/.prysm
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Download Snapshot

Name Height Size Block Time

# reset and download snapshot
prysmd tendermint unsafe-reset-all --home $HOME/.prysm
if curl -s --head curl https://snapshot.sipalingtestnet.com/prysm/prysm.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
  curl https://snapshot.sipalingtestnet.com/prysm/prysm.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.prysm
    else
  echo "no snapshot founded"
fi

Start service

sudo systemctl daemon-reload
sudo systemctl enable prysmd
sudo systemctl restart prysmd && sudo journalctl -u prysmd -f

Create Validator


Send Transaction

prysmd tx staking create-validator $HOME/.prysm/validator.json --from= --chain-id=prysm-devnet-1 --fees 250000000000000uprysm -y  --gas auto --gas-adjustment 1.6