Build a Node
Chain upgrades
For streamline chain upgrades and minimizing downtime, you may want to set up cosmovisor to manage your node.
Backups
If you are using a recent version of Cosmovisor, then the default configuration is that a state backup will be created before upgrades are applied. This can be turned off using environment flags.
Alerting and monitoring
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:
Avoiding DDOS attacks
If you are comfortable with server ops, you might want to build out a Sentry Node Architecture validator to protect against DDOS attacks.
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.
Bear in mind that Sentries can have pruning turned on, as outlined here. It is desirable, but not essential, to have pruning disabled on the validator node itself.
Managing storage
If you are using a cloud services provider, you may want to mount
$HOME
on 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.
Joining network
General instructions to join the UnUniFi mainnet after network genesis.
Configuration of Shell Variables
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.
Choose the required mainnet chain-id
The current UnUniFi Network chain-id
is ununifi-beta-v1
. Set the CHAIN_ID
:
For mainnet:
For testnet:
Set your server name
Choose your moniker
, it is just a name for your node. Set the MONIKER
:
Setting up the Node
These instructions will direct you on how to initialize your node, synchronize to the network and upgrade your node to a validator.
Initialize the chain
This will generate the following files in ~/.ununifi/config/
genesis.json
node_key.json
priv_validator_key.json
Download the genesis file
For mainnet:
For testnet:
This will replace the genesis file genesis.json
created by ununifid init
command.
Set persistent peers
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 chain-id
:
For mainnet:
For testnet:
Using the peers variable above, we can set the persistent_peers in ~/.ununifi/config/config.toml
:
Set minimum gas prices
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.
In $HOME/.ununifi/config/app.toml
, set minimum gas prices:
Additional settings
If you necessary, Edit config files ~/.ununifi/config/app.toml
pruning
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
Create (or restore) a local key pair
Either create a new key pair, or restore an existing wallet for your validator:
Replace <your-key>
with a key name of your choosing.
Get some UnUniFi tokens
You will require some UnUniFi tokens to bond to your validator. To be in the active set you will need to have enough tokens.
Setup cosmovisor and start the node
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: ununifid start
Syncing the node
After starting the ununifid
daemon, 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:
This command returning true
means 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.
If you want to catch up from 0 height, you have to upgrade ununifid
at each upgrade heights. See mainnet-upgrades.
Last updated