# remove old go version
sudo rm -rvf /usr/local/go/
# download recent go version
wget https://golang.org/dl/go1.21.8.linux-amd64.tar.gz
# install go
sudo tar -C /usr/local -xzf go1.21.8.linux-amd64.tar.gz
# remove unneeded installer
rm go1.21.8.linux-amd64.tar.gz
# source go
cat <<EOF >> ~/.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 ~/.profile
go version
Now we build!
Download the project code and checkout to testnet branch
git clone https://github.com/Team-Kujira/core $HOME/kujira-core
cd $HOME/kujira-core
git checkout v1.1.0
Build and install kujirad (using the kuji user created above)
make install
Verify your binary is working
kujirad version
Running the node
If the build succeeds, you should now have the kujirad cli in your path (of the kuji user).
Try invoking with kujirad and you should see output like
Stargate CosmosHub App
Usage:
kujirad [command]
Available Commands:
add-genesis-account Add a genesis account to genesis.json
collect-gentxs Collect genesis txs and output a genesis.json file
config Create or query an application CLI configuration file
debug Tool for helping with debugging your application
export Export state to JSON
gentx Generate a genesis tx carrying a self delegation
help Help about any command
....
Join the network
Now we can initialize the node and join the network.
Initialize node's configuration files
export CHAIN_ID=kaiyo-1 # for mainnet
export CHAIN_ID=harpoon-4 # for testnet
export MONIKER_NAME="<moniker name>"
And update the commit times in $HOME/.kujira/config/config.toml
sed -i "s/^timeout_commit *=.*/timeout_commit = \"1500ms\"/;" $HOME/.kujira/config/config.toml
Now start the node
$ kujirad start
kuji@fsn1-kuji-testnet-01:~$ kujirad start
12:22PM INF starting node with ABCI Tendermint in-process
12:22PM INF Starting multiAppConn service impl=multiAppConn module=proxy
12:22PM INF Starting localClient service connection=query impl=localClient module=abci-client
12:22PM INF Starting localClient service connection=snapshot impl=localClient module=abci-client
12:22PM INF Starting localClient service connection=mempool impl=localClient module=abci-client
12:22PM INF Starting localClient service connection=consensus impl=localClient module=abci-client
And then watch a whole bunch of log messages while your node is catching up. After making sure that it works, it's time to install it as a system level service so it always starts with the machine.
Register the node as a service
Drop out of the kuji user if you're still in that terminal session. Write exit or type ctrl+d on your keyboard.
Create a service definition file in /etc/systemd/system/kujirad.service. Example file that fits with our kuijrad install and kuji runtime user
Please remember to also back up $HOME/.kujira/config/priv_validator_key.json. If you lose this, you are toast.
Tips
Disk utilization
To help manage the disk size you can prune the blocks being kept. for this I use prime numbers pick your own in app.toml
pruning = "custom"
# These are applied if and only if the pruning strategy is custom.
pruning-keep-recent = "809"
pruning-keep-every = "0"
pruning-interval = "43"
You should also check what you are indexing
index-events = ["tx.hash", "tx.height"]
Adding more peers
You should modify /etc/security/limits.conf and add
* soft nofile 65535
* hard nofile 65535
You can then modify the config.toml to increase connections. This may cost you more in ingress/egress charges.