Skip to content
All services

Testnet

KiiChain

Chain ID
Version
Go

For Ubuntu 22.04 or later. The node listens on ports starting with your port prefix (e.g. 26657 becomes 19657), so several nodes can share a server.

  1. 01Install tools

    sudo apt update && sudo apt upgrade -y
    sudo apt install -y curl git wget jq make gcc build-essential lz4 zstd tmux htop unzip
  2. 02Install Go

    cd $HOME
    VER="<go-version>"
    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"
    [ ! -f $HOME/.bash_profile ] && touch $HOME/.bash_profile
    echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
    source $HOME/.bash_profile
    mkdir -p $HOME/go/bin
    go version
  3. 03Build the binary

    cd $HOME
    rm -rf kiichain
    git clone https://github.com/KiiChain/kiichain.git kiichain
    cd kiichain
    git checkout <version>
    make install
    kiichaind version --long | grep -E '^(version|commit):'
  4. 04Install Cosmovisor

    go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
    DAEMON_HOME=$HOME/.kiichain DAEMON_NAME=kiichaind cosmovisor init $HOME/go/bin/kiichaind
  5. 05Create the service

    sudo tee /etc/systemd/system/kiichaind.service > /dev/null << EOF
    [Unit]
    Description=KiiChain node
    After=network-online.target
    
    [Service]
    User=$USER
    ExecStart=$(which cosmovisor) run start
    WorkingDirectory=$HOME/.kiichain
    Restart=on-failure
    RestartSec=10
    LimitNOFILE=65535
    Environment="DAEMON_HOME=$HOME/.kiichain"
    Environment="DAEMON_NAME=kiichaind"
    Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
    Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
    Environment="UNSAFE_SKIP_BACKUP=true"
    Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.kiichain/cosmovisor/current/bin"
    
    [Install]
    WantedBy=multi-user.target
    EOF
    sudo systemctl daemon-reload
    sudo systemctl enable kiichaind
  6. 06Set variables

    echo 'export WALLET="wallet"' >> $HOME/.bash_profile
    echo 'export MONIKER="Your-Moniker"' >> $HOME/.bash_profile
    echo 'export KII_CHAIN_ID="<chain-id>"' >> $HOME/.bash_profile
    echo 'export KII_PORT="19"' >> $HOME/.bash_profile
    source $HOME/.bash_profile
  7. 07Initialize the node

    kiichaind init "$MONIKER" --chain-id $KII_CHAIN_ID --home $HOME/.kiichain
    kiichaind config set client chain-id $KII_CHAIN_ID
    kiichaind config set client keyring-backend os
    kiichaind config set client node tcp://localhost:$KII_PORT657
  8. 08Custom ports

    sed -i.bak -e "s%:1317%:$KII_PORT317%g;
    s%:8080%:$KII_PORT080%g;
    s%:9090%:$KII_PORT090%g;
    s%:9091%:$KII_PORT091%g;
    s%:8545%:$KII_PORT545%g;
    s%:8546%:$KII_PORT546%g" $HOME/.kiichain/config/app.toml
    sed -i.bak -e "s%:26658%:$KII_PORT658%g;
    s%:26657%:$KII_PORT657%g;
    s%:6060%:$KII_PORT060%g;
    s%:26656%:$KII_PORT656%g;
    s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):$KII_PORT656\"%;
    s%:26660%:$KII_PORT660%g" $HOME/.kiichain/config/config.toml
  9. 09Genesis and addrbook

    curl -Ls https://kii-testnet-services.luckystar.asia/kii/genesis.json > $HOME/.kiichain/config/genesis.json
  10. 10Minimum gas price

    sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"1000000000akii\"|" $HOME/.kiichain/config/app.toml
  11. 11Pruning

    sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.kiichain/config/app.toml
    sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.kiichain/config/app.toml
    sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.kiichain/config/app.toml
  12. 12Disable the indexer

    sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.kiichain/config/config.toml
  13. 13Download the snapshot

    curl -L https://kii-testnet-services.luckystar.asia/kii/oro_1336-1_latest.tar.lz4 | lz4 -dc | tar -xf - -C $HOME/.kiichain/data
    mkdir -p $HOME/.kiichain/wasm
    curl -L https://kii-testnet-services.luckystar.asia/kii/wasm_oro_1336-1_latest.tar.lz4 | lz4 -dc | tar -xf - -C $HOME/.kiichain/wasm
  14. 14Start the node

    sudo systemctl restart kiichaind && sudo journalctl -fu kiichaind -o cat
  15. 15Check sync

    curl -s localhost:$KII_PORT657/status | jq .result.sync_info
Original guide (GitBook)