Install dependencies
Update system and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.10.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Download and build binary
Clone project repository
mkdir injective-library
cd injective-library
wget -O linux-amd64.zip https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v1.12.1-1705909076/linux-amd64.zip
unzip -o linux-amd64.zip
chmod +x injectived
chmod +x peggo
chmod +x libwasmvm.x86_64.so
cp -f injectived $HOME/go/bin
cp -f peggo $HOME/go/bin
cp -f libwasmvm.x86_64.so /usr/lib
injectived version
peggo version
Initialize the node
Set node configuration
injectived config chain-id injective-1
Initialize the node
injectived init you-node-name --chain-id injective-1
Download genesis and addrbook
curl -Ls https://snapshots.tienthuattoan.com/mainnet/injective/genesis.json > $HOME/.injectived/config/genesis.json
curl -Ls https://snapshots.tienthuattoan.com/mainnet/injective/addrbook.json > $HOME/.injectived/config/addrbook.json
Add seed
sed -i -e "s|^seeds *=.*|seeds = \"fbb8e91410d01bae18aa7b39e16007349a777e6d@injective-rpc.tienthuattoan.com:26656\"|" $HOME/.injectived/config/config.toml
Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"160000000inj\"|" $HOME/.injectived/config/app.toml
Update pruning and disable indexer to save disk space
sed -i 's/pruning = "default"/pruning = "custom"/g' \
$HOME/.injectived/config/app.toml
sed -i 's/pruning-keep-recent = "0"/pruning-keep-recent = "100"/g' \
$HOME/.injectived/config/app.toml
sed -i 's/pruning-interval = "0"/pruning-interval = "10"/g' \
$HOME/.injectived/config/app.toml
sed -i 's/indexer = "kv"/indexer = "null"/g' \
$HOME/.injectived/config/config.toml
Make the changes below in config.toml
Additionally, please increase timeout_commit from 300ms to 500ms.
We want to maintain block times in the 700-800ms range for now to ensure
we have full stability on the chain and off-chain dependencies before we start decreasing.
Iām also sharing all the performance improvements for the new validators in the set.
Please, make sure you all apply these changes.
Set pruning to "nothing" in app.toml
Set log_level to "*:error" in config.toml
Set max_num_inbound_peers & max_num_outbound_peers in config.toml to 40/40 or 80/80 depending on your hardware.
I recommend 40/40 but you can try both to see what works better.
Set `flush_throttle_timeout` & `peer_gossip_sleep_duration` to "10ms" in config.toml
Set size to 200
Set the timeouts to these values:
timeout_propose = "3s"
timeout_propose_delta = "500ms"
timeout_prevote = "1s"
timeout_prevote_delta = "500ms"
timeout_precommit = "s"
timeout_precommit_delta = "500ms"
timeout_commit = "500ms'
Download Snapshot
wget -O injective_latest.tar.lz4 https://snapshots.tienthuattoan.com/mainnet/injective/injective_latest.tar.lz4 && lz4 -c -d injective_latest.tar.lz4 | tar -x -C $HOME/.injectived
Create service
sudo tee </dev/null /etc/systemd/system/injectived.service
[Unit]
Description=Injective node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which injectived) start
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Start the service and check the logs
sudo systemctl daemon-reload
sudo systemctl enable injectived
sudo systemctl restart injectived
sudo journalctl -u injectived -f