Build a Node
Alerting and monitoring is desirable as well - you are encouraged to explore solutions and find one that works for your setup. Prometheus is available out-of-the box, and there are a variety of open-source tools. Recommended reading:
The current best practice for running mainnet nodes is a Sentry Node Architecture. There are various approaches, as detailed here. Some validators advocate co-locating all three nodes in virtual partitions on a single box, using Docker or other virtualisation tools. However, if in doubt, just run each node on a different server.
If you are using a cloud services provider, you may want to mount
$HOMEon an externally mountable storage volume, as you may need to shuffle the data onto a larger storage device later. You can specify the home directory in most commands, or just use symlinks.
Disk space is likely to fill up, so having a plan for managing storage is key.
If you are running sentry nodes:
- 1TB storage for the full node will give you a lot of runway
- 200GB each for the sentries with pruning should be sufficient
Managing backups is outside the scope of this documentation, but several validators keep public snapshots and backups.
It is anticipated that state-sync will soon work for wasm chains, although it does not currettly.
General instructions to join the UnUniFi mainnet after network genesis.
For this guide, we will be using shell variables. This will enable the use of the client commands verbatim. It is important to remember that shell commands are only valid for the current shell session, and if the shell session is closed, the shell variables will need to be re-defined.
If you want variables to persist for multiple sessions, then set them explicitly in your shell
.bash_profile, as you did for the Go environment variables.
To clear a variable binding, use
unset $VARIABLE_NAME. Shell variables should be named with ALL CAPS.
The current UnUniFi Network
ununifi-beta-v1. Set the
moniker, it is just a name for your node. Set the
These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator.
ununifid init "$MONIKER" --chain-id $CHAIN_ID
This will generate the following files in
curl -L https://raw.githubusercontent.com/UnUniFi/network/main/launch/ununifi-beta-v1/genesis.json -o ~/.ununifi/config/genesis.json
curl -L https://raw.githubusercontent.com/UnUniFi/network/main/launch/ununifi-test-v1/genesis.json -o ~/.ununifi/config/genesis.json
This will replace the genesis file
Persistent peers will be required to tell your node where to connect to other nodes and join the network. To retrieve the peers for the chosen
# Set the base repo URL for mainnet & retrieve peers
echo "export PEERS=\"[email protected]:26656,[email protected]:26656,1357ac5cd92b215b05253b25d78cf485dd899d55@[2600:1f1c:534:8f02:7bf:6b31:3702:2265]:26656,25006d6b85daeac2234bcb94dafaa73861b43ee3@[2600:1f1c:534:8f02:a407:b1c6:e8f5:94b]:26656,caf792ed396dd7e737574a030ae8eabe19ecdf5c@[2600:1f1c:534:8f02:b0a4:dbf6:e50b:d64e]:26656,796c62bb2af411c140cf24ddc409dff76d9d61cf@[2600:1f1c:534:8f02:ca0e:14e9:8e60:989e]:26656,cea8d05b6e01188cf6481c55b7d1bc2f31de0eed@[2600:1f1c:534:8f02:ba43:1f69:e23a:df6b]:26656\"" >> ~/.bash_profile
# Set the base repo URL for mainnet & retrieve peers
echo "export PEERS=\"email@example.com:26656,firstname.lastname@example.org:26656,email@example.com:26656,59361cdca33b[email protected]:26656\"" >> ~/.bash_profile
Using the peers variable above, we can set the persistent_peers in
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" ~/.ununifi/config/config.toml
For RPC nodes and Validator nodes we recommend setting the following minimum-gas-prices. As we are a permissionless wasm chain, this setting will help protect against contract spam and potential wasm contract attack vectors.
$HOME/.ununifi/config/app.toml, set minimum gas prices:
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025uguu\"/" $HOME/.ununifi/config/app.toml
If you necessary, Edit config files
- Enable defines if the API server should be enabled.
enable = true
- EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
enabled-unsafe-cors = true
Either create a new key pair, or restore an existing wallet for your validator:
# Create new keypair
ununifid keys add <your-key>
# Restore existing ununifi wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
ununifid keys add <your-key> --recover
# Query the keystore for your public address
ununifid keys show <your-key> -a
<your-key>with a key name of your choosing.
You will require some UnUniFi tokens to bond to your validator. To be in the active set you will need to have enough tokens.
Follow instructions to setup cosmovisor and start the node.
Using cosmovisor is completely optional. If you choose not to use cosmovisor, you will need to be sure to attend network upgrades to ensure your validator does not have downtime and get jailed.
If you are not using Cosmovisor you can start node:
After starting the
ununifiddaemon, the chain will begin to sync to the network. The time to sync to the network will vary depending on your setup and the current size of the blockchain, but could take a very long time. To query the status of your node:
# Query via the RPC (default port: 26657)
curl http://localhost:26657/status | jq .result.sync_info.catching_up
This command returning
truemeans that your node is still catching up. Otherwise your node has caught up to the network current block and you are safe to proceed to upgrade to a validator node.
If you want to shorten the time to catch up to the latest block, consider to use snapshots from other nodes.