Installation Guide/
testnet/
injective

Rpc status: Active

Install Dependencies

sudo apt update
sudo apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev lz4 -y

Install Go

cd $HOME && \
ver="1.22.6" && \
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

Set Variables

echo "export WALLET='wallet'" >> $HOME/.bash_profile
echo "export MONIKER='validator'" >> $HOME/.bash_profile
echo "export PORT_INJECTIVE='26'" >> $HOME/.bash_profile
source $HOME/.bash_profile

Download Binary

cd $HOME
VERSION="v1.13.4"
RELEASES_URL="https://api.github.com/repos/InjectiveLabs/testnet/releases"
RELEASE=$(curl -s $RELEASES_URL | jq -r --arg version "$VERSION" '.[] | select(.tag_name | startswith($version))')
ASSET_URL=$(echo "$RELEASE" | jq -r '.assets[] | select(.name | endswith("linux-amd64.zip")).browser_download_url')

curl -L -o linux-amd64.zip "$ASSET_URL"
mkdir -p $HOME/go/bin
unzip linux-amd64.zip -d $HOME/go/bin
rm -rf linux-amd64.zip

mv $HOME/go/bin/libwasmvm.x86_64.so $LD_LIBRARY_PATH

injectived version

Config and Initialize Node

injectived init "validator" --chain-id injective-888
injectived config set client chain-id injective-888
injectived config set client keyring-backend os
injectived config set client node tcp://localhost:${PORT_INJECTIVE}657

Download Genesis and Addrbook

wget -O $HOME/.injectived/config/genesis.json https://download.dteam.tech/injective/testnet/genesis
wget -O $HOME/.injectived/config/addrbook.json https://download.dteam.tech/injective/testnet/addrbook

Set Seeds and Peers

SEEDS="62cdf29e88867e003390a01e3e631107350c3cb4@seed.injective.testnet.dteam.tech:25656"
PEERS="af6947963e3869d745cbff986d981067ad58273a@peer.injective.testnet.dteam.tech:33656,[email protected]:33656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:14356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:32607,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:14356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.injectived/config/config.toml

Set Custom Ports / Optional

sed -i.bak -e "s%:1317%:${PORT_INJECTIVE}317%g;
s%:8080%:${PORT_INJECTIVE}080%g;
s%:9090%:${PORT_INJECTIVE}090%g;
s%:9091%:${PORT_INJECTIVE}091%g;
s%:8545%:${PORT_INJECTIVE}545%g;
s%:8546%:${PORT_INJECTIVE}546%g;
s%:6065%:${PORT_INJECTIVE}065%g" $HOME/.injectived/config/app.toml

sed -i.bak -e "s%:26658%:${PORT_INJECTIVE}658%g;
s%:26657%:${PORT_INJECTIVE}657%g;
s%:6060%:${PORT_INJECTIVE}060%g;
s%:26656%:${PORT_INJECTIVE}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${PORT_INJECTIVE}656\"%;
s%:26660%:${PORT_INJECTIVE}660%g" $HOME/.injectived/config/config.toml

Config Pruning / Optional

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.injectived/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.injectived/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"20\"/" $HOME/.injectived/config/app.toml

Set Minimum Gas Price / Optional

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "160000000inj"|g' $HOME/.injectived/config/app.toml

Disable Indexing / Optional

INDEXER="null"
sed -i -e "s/^indexer *=.*/indexer = \"$INDEXER\"/" $HOME/.injectived/config/config.toml

Disable Snapshots / Optional

SNAPSHOT_INTERVAL=0
sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$SNAPSHOT_INTERVAL\"/" ~/.injectived/config/app.toml

Create Service File

sudo tee /etc/systemd/system/injectived.service > /dev/null <<EOF
[Unit]
Description=injective testnet node
After=network-online.target

[Service]
User=$USER
WorkingDirectory=$HOME/.injectived
ExecStart=$(which injectived) start
Restart=on-failure
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Download Snapshot / Optional

injectived tendermint unsafe-reset-all --home $HOME/.injectived
curl https://download.dteam.tech/injective/testnet/pruned/latest-snapshot | lz4 -dc - | tar -xf - -C $HOME/.injectived

Enable and Start Service

sudo systemctl daemon-reload
sudo systemctl enable injectived
sudo systemctl restart injectived
sudo journalctl -u injectived -f -o cat