Setup a node (mainnet / public testnet)
Welcome
Thank you for your interest in joining our validator community! Your participation is important to the security of LikeCoin chain.
This guide covers steps to host a validator node with Cosmovisor via Linux Systemd or Docker Compose.
We recommend all operators to adopt the Systemd method. The Docker Compose method is deprecated and will not be maintained in the future.
To Existing Operators
Why the change?
Since the v1.2.0 release, LikeCoin chain binary supports Cosmovisor, a process manager that manages chain binaries and monitors for upgrade proposals.
Cosmovisor allows future chain upgrades to utilize upgrade proposals and in-place store migrations, which vastly reduces the coordination effort and chain downtime required compared to the past manual upgrades.
Under this new workflow, once an upgrade proposal is approved by the community and the chain reaches the defined upgrade block height, validators will automatically swap to the new binary version and run state migration scripts. Operators will only be required to place the next binary into the upgrades
folder of cosmovisor before upgrade time.
Optionally, operators can opt into using the auto-download feature, which automatically downloads the new binary from url defined in the upgrade proposal before upgrade.
For usage and folder layout of Cosmovisor, please refer to Cosmovisor quick start guide
Before we continue
Existing operators migrating their node should ensure that there is only one instance running concurrently at all times to avoid double signing.
Be aware of blocks like this for migration specific notes
System Requirements
Note that system requirements, especially memory, may increase drastically when performing chain upgrade or state sync.
Hardware
Recommended
2 CPU Cores
16GB RAM
500GB+ SSD
Minimum
2 CPU Cores
4GB RAM
250GB+ SSD
Current snapshot size is 120GB with 70GB growth each year.
We expect the growth rate to increase after our NFT module and new dApps are rolled out.
OS
Ubuntu 20.04 LTS
YMMV on other Linux distros
Debian-based ones will likely work fine with this guide
Using non-Linux host is not recommended
The Docker Compose method works on other OS, but it will be discontinued in the future.
Network Ports
Required
TCP 26656 for P2P
Optional, if you use the node as RPC endpoint
TCP 9090 for gRPC
TCP 1317 for REST
TCP 26657 for Tendermint RPC
Outline
Below are major steps to create a validator node:
Secure the host
Initialize the node
Synchronize the node to the latest block
Create operator account
Create validator
Secure the host
Refer to Node Security page.
Systemd Route (Recommended)
We will run a setup script to download the latest binary release, write config files and start up the service.
Again, this method is supported on Linux only. We prepared this guide with Ubuntu 20.04 LTS. YMMV on other distros.
When you see
<Placeholder>
in code blocks below, please replace them with correct values.
Obtain dependencies
We will first clone the likecoin-chain repo to obtain required scripts
For validator migration, we recommend cloning a new copy to avoid confusion, since the previous guide stored data within the repo folder.
If your existing repo folder is already at
~
, appending the clone command with a new folder name, and adopt this guide by changing thecd ~/likecoin-chain
commands.
Then, install required tools:
Run the setup-node script
This script will download cosmovisor, chain binary, and the genesis file. Then, it will run liked init
and prepare a systemd service file.
By default, binaries will be downloaded to the user's home directory ~/
, and the liked data directory will be ~/.liked
For advanced configuration, such as changing folder locations or specifying binary versions, refer to the developer facing guide
If you are migrating an existing node on the same host, please ensure that your existing
.liked
folder is not at your home directory, otherwise this might overwrite your files!
For latest genesis url and seed node, we host the latest info on Github: Mainnet. Following is the command for running the setup-node script for mainnet. Please confirm the LIKED_VERSION
to be used in the above Mainnet Github repository.
Testnet Info of can find here: Public Testnet, current active testnet is likecoin-public-testnet-5
. Following is the command for running the setup-node script for testnet. Please confirm the latest testnet and parameters to be used in the testnet Github repository.
If you decided not to using state sync as describe below, you may need to change the LIKED_VERSION=4.2.0
. 4.2.0 is the version we start adpoting cosmovisor, it should upgrade itself to newer version during sync. There is still some manual upgrade need due to patch or bugs, please refer to Syncing from genesis.
Import existing validator files
For existing validators hosted with the Docker Compose guide only. New operators should skip this section.
Steps below generally applies to custom setups but paths to your old
.liked
folder and the command to stop the node will be different.
First, rename the .liked
folder generated by the script as .liked.template
:
Then, stop your existing node:
Move the old .liked
folder to ~/.liked
:
Add the new cosmovisor
sub-folder created by the script to ~/.liked
:
Check that there are 4 folders within ~/.liked
:
For some setups, the keyring files may be on the root of .liked
directly instead of inside keyring-file
folder, please move the following files to ~/.liked/keyring-file
folder so the liked flag --keyring-backend=file
works:
State Sync
Skip this section for migrating operators
Syncing a node from genesis often requires hours if not days. To save time, we can start the new node from a known block.
Note that state sync requires at least 16GB (32GB recommended) of memory to complete successfully. After state sync is done, you can lower the amount of memory for daily operations.
Firstly, obtain two trusted rpc endpoints. These info can often be found on the same repos hosting genesis files. We have included the addresses of mainnet public nodes below.
Then, we will need to obtain the latest block height and hash from one of the rpc endpoints:
For testnet, it should be curl -s https://node.testnet.like.co/rpc/block
The height is result.block.header.height
, while the hash is result.block_id.hash
Next, we will edit ~/.liked/config/config.toml
. Locate the [statesync]
section and update it to the following values:
Userpc_servers = "
https://node.testnet.like.co:443/rpc/,https://node.testnet.like.co:443/rpc/
"
if you are setting up testnet.
Then, the node will use state sync to synchronize with the network instead of replaying from genesis at launch.
If you have already started the service once, i.e. there is an ongoing sync, you will have to reset the state back to genesis, otherwise state sync will not start:
Change node configuration
You are recommended to review ~/.liked/config/config.toml
and ~/.liked/config/app.toml
, then change the defaults as desired.
In particular, please set a minimum gas price for your node and enable state sync in app.toml
:
The unit for testnet is nanoekil
This avoids spams on the network and help new nodes sync to the latest state quickly.
For more details, please refer to Node Configuration docs.
Activate the service
Now we will call the setup script again to activate the systemd config and start the node.
The service is configured to start the node via Cosmovisor. It will auto-start whenever the machine is booted.
The service file will be placed at /etc/systemd/system/liked.service
.
For migrating validators, please ensure the old instance is turned off before you proceed!
New nodes will now synchronize with the network. We can continue below steps to create a validator afterwards.
You can check the sync status by:
The synced height is result.sync_info.latest_block_height
, while result.sync_info.catching_up
reflects if the node has finished sync up.
For migrating validators, this is the final step. The validator node should resume operation immediately.
View status and logs
Check the status of the service by:
Follow logs by journalctl
:
Managing the service
The service can be managed via systemctl
:
Create operator account
We will generate a new operator account. The key will be stored in password-protected files in ~/.liked/keyring-file
. This account is required to manage the validator and cast votes on proposals.
The mnemonic phrase will then be displayed. Write this phrase down physically and keep it in secure storage. Do not type the phrase on a computer.
To display the operator key address:
Becoming a validator node
Please ensure your account owns more than the initial self-delegate amount.
Note that commission-max-rate
and commission-max-change-rate
cannot be changed afterwards.
Below values are examples and can be customized.
You can obtain the validator address by:
At this stage, you should back up ~/.liked/config
and ~/.liked/keyring-file
which contains your node key, consensus key and operator key. For security, please consider encrypting your backup with tools like GPG before transferring off the host.
Confirm the validator is running
You can also check via chain explorers: dao.like.co, Mintscan
Common operations for validator
Edit Validator
You may edit validator details anytime:
Vote
An important job of being an operator is to participate in DAO governance. To vote on a proposal:
where 123
is the proposal number and yes
is the vote
Unjail
A validator may be jailed after some downtime. To resume receiving rewards, submit an unjail
transaction:
Docker Compose Route (Deprecated)
This route is transitional for existing operators who followed our old setup guide to quickly adopt cosmovisor in time for the next chain upgrade.
In newer docker image releases, cosmovisor is bundled in the image. When an upgrade is announced and approved, operators should prepare and place the next version liked
binary within .liked/cosmovisor/upgrades
folder before the upgrade time. Please refer to related chain upgrade guides for exact steps.
Adopt Cosmovisor for existing validators on Docker
First, shut down the existing stack:
Check out the new release tag to obtain the new version of docker-compose template:
Back up the existing docker-compose.yml
and replace it with the new version:
Edit .env
to target new docker image tag:
Create cosmovisor folders structure:
We can now start the stack again:
Last updated