# update the local package list and install any available upgrades
sudo apt-get update && sudo apt upgrade -y
# install toolchain and ensure accurate time synchronization
sudo apt-get install make build-essential gcc git jq chrony -y
# find location of existing GO (if any)
which go
go version
# remove old GO if existing
sudo rm -rf /usr/local/go
# install updated GO
wget https://golang.org/dl/go1.20.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz
rm -rf go1.20.3.linux-amd64.tar.gz
Unless you want to configure in a non standard way, then set these in the .zshrc in the user's home (i.e. ~/) folder.
nano ~/.zshrc
Add the "export Pathing" rules at the bottom, and then save the file:
After updating your ~/.zshrc you will need to source it:
source ~/.zshrc
Build Daemon from source
# run these commands
git clone https://github.com/Team-Kujira/core $HOME/kujira-core
cd $HOME/kujira-core
git checkout v0.8.7
To confirm that the installation has succeeded, you can run:
kujirad version --long
Configure the Node
Initialize Node
The command below will initialize the node, and generate a random 32-bit string for the node moniker. This provides increased privacy from tools like Observatory.
This will generate the following files in ~/.kujirad/config/
genesis.json
node_key.json
priv_validator_key.json
Set Seeds
We can add these seeds to our config.toml:
sed -i 's/seeds = ""/seeds = "c28827cb96c14c905b127b92065a3fb4cd77d7f6@seeds.whispernode.com:11856,3ba7bf08f00e228026177e9cdc027f6ef6eb2b39@35.232.234.58:26656"/' ~/.kujira/config/config.toml
Update Node configs
We can use sed to update various node configuration values without having to manually edit each file - which can be a pain.
Replace the values below with your own. These commands will update the following:
minimum_gas_prices
pruning configs
snapshot configs
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.00119ukuji,0.00150factory\/kujira1qk00h5atutpsv900x202pxx42npjr9thg58dnqpa72f2p7m2luase444a7\/uusk,0.00150ibc\/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F,0.000125ibc\/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2,0.00126ibc\/47BD209179859CDE4A2806763D7189B6E6FE13A17880FE2B42DE1E6C1E329E23,0.00652ibc\/3607EB5B5E64DD1C0E12E07F077FF470D5BC4706AFCBC98FE1BA960E5AE4CE07,617283951ibc\/F3AA7EF362EC5E791FE78A0F4CCC69FEE1F9A7485EB1A8CAB3F6601C00522F10,0.000288ibc\/EFF323CC632EC4F747C61BCE238A758EFDB7699C3226565F7C20DA06509D59A5,0.000125ibc\/DA59C009A0B3B95E0549E6BF7B075C8239285989FF457A8EDDBB56F10B2A6986,0.00137ibc\/A358D7F19237777AF6D8AD0E0F53268F8B18AE8A53ED318095C14D6D7F3B2DB5,0.0488ibc\/4F393C3FCA4190C0A6756CE7F6D897D5D1BE57D6CCB80D0BC87393566A7B6602,78492936ibc\/004EBF085BBED1029326D56BE8A2E67C08CECE670A94AC1947DF413EF5130EB2,964351ibc\/1B38805B1C75352B28169284F96DF56BDEBD9E8FAC005BDCC8CF0378C82AA8E7\"/;" $HOME/.kujira/config/app.toml
sed -i -e "s|^pruning *=.*|pruning = \"custom\"|" $HOME/.kujira/config/app.toml
sed -i -e "s|^pruning-keep-recent *=.*|pruning-keep-recent = \"113\"|" $HOME/.kujira/config/app.toml
sed -i -e "s|^pruning-keep-every *=.*|pruning-keep-every = \"0\"|" $HOME/.kujira/config/app.toml
sed -i -e "s|^pruning-interval *=.*|pruning-interval = \"17\"|" $HOME/.kujira/config/app.toml
sed -i -e "s|^snapshot-interval *=.*|snapshot-interval = \"0\"|" $HOME/.kujira/config/app.toml
sed -i -e "s|^snapshot-keep-recent *=.*|snapshot-keep-recent = \"2\"|" $HOME/.kujira/config/app.toml
Update the commit times in $HOME/.kujira/config/config.toml
sed -i "s/^timeout_commit *=.*/timeout_commit = \"1500ms\"/;" $HOME/.kujira/config/config.toml
Updating node ports
We'll use a powerful tool called sed for this process. sed is a stream editor that can perform operations, like substitutions, on a text file.
We will specifically focus on updating the ports to use a standardized prefix for your chain. This ensures consistency and improves overall system organization. It will also allow you to run multiple chains on a single server.
Let's start by understanding what we're updating:
proxy_app: This is the address used for inter-process communication between the ABCI application and the consensus engine.
laddr: This is the address that your node listens on for incoming connections.
pprof_laddr: This is the address for the profiling server to listen on.
prometheus_listen_addr: This is the address for the Prometheus metrics server to listen on.
address: These are various addresses that your node may use to listen for different types of connections.
Set Your Chain and Port Prefix
Your chain in this case is Kujira. For Kujira, we want to set the port prefix as 118. The port prefix will be used to replace the first 2 or 3 digits of the original ports.
# Set the prefix
export PREFIX=118
Update config.toml
Next, we will update the config.toml file. For 5-digit ports, the first 3 digits will be replaced. Here is how to calculate the new port values and update the config.toml file:
Either create a new key pair or restore an existing wallet for your validator:
# Create new keypair
kujirad keys add YOURKEY
# Restore existing juno wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
kujirad keys add YOURKEY --recover
# Query the keystore for your public address
kujirad keys show YOURKEY -a
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.
Setup cosmovisor
Follow the Setup Cosmovisor instructions to setup cosmovisor and start the node.
Get snapshot
Stop Node and reset chain
#Stop Node
sudo systemctl stop cosmovisor
# remove wasm cache
rm -r ~/.kujira/wasm
# On some tendermint chains
kujirad unsafe-reset-all
# On other tendermint chains
kujirad tendermint unsafe-reset-all --home $HOME/.kujira --keep-addr-book
The above transaction is just an example. There are many more flags that can be set to customize your validator, such as your validator website, or keybase.io id, etc. To see a full list:
kujirad tx staking create-validator --help
Backup critical files
There are certain files that you need to back up to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.kujira/config/:
priv_validator_key.json
node_key.json
It is recommended that you encrypt and backup of these files.