The playbook configures a server to be a Commercio Network full node and installs a script that detects whether the node is losing blocks. If the node loses blocks, a message will be forwarded to a slack channel of your choice.
The prerequisites to use this playbook are:
- Have a server on which to install the node
- Have python3 installed (version >= 3.5)
- To check the version:
python3 -V
- To check the version:
- Have ansible installed (version >= core 2.9)
- To check the version:
ansible --version
- To check the version:
To use the playbook you need to proceed as follows:
-
Create and add the
hosts.inifile to the root directory of this repository and configure it with your target hosts where you want to install your full node. See the Example hosts file. -
Based on the variables listed in the file
alllocated inmain/group_varspath, you can change the behavior of the playbook.Default values are set for certain variables, if you want to assign different values for these variables, you can Copy the variable list
all.templateto the filealland customize your variables.Below is the table of all the variables and their meaning:
Variable name Usage chain_idBlockchain chain-id (e.g: chain-id for mainnet: commercio-3, chain-id for testnet:commercio-testnet11k)comm_userName of the user that will be created and used by the node service. monikerName of the node sync_typeDetermines how database synchronization occurs. Options: • pull: Synchronization occurs by doing an rsync from the new node to the node from which it synchronizes.• push: Synchronization occurs by doing an rsync from the node from which you synchronize to the new node.• dump: Synchronization occurs by dumping the dump to disk and unpacking it.• statesync: Synchronization occurs via statesync.• none: Synchronization occurs normally.sync_nodeNode IP to sync from in case of sync_type=pushorpullsync_node_home_folderNode home folder to sync from in case of sync_type=pushorpullcustom_bin_versionVersion of the Commercionetworkd binary to use. custom_genesisGenesis file URL custom_comm_repoPath and name of where the Commercio.network binary repository is downloaded custom_home_folderHome where the .commercionetworkfolder is installedcustom_go_pathPath of installed go custom_cosmovisor_versionVersion of Cosmovisor to install custom_trust_rpc1First RPC to sync from in case of sync_type = statesync sync_type=statesync.custom_trust_rpc2Second RPC to sync from in case of sync_type = statesync sync_type=statesync.external_driveOptional parameter to specify the path if the node database should be installed on an external disk slack_hookWebhook where to send reports about a node losing blocks. No script will be installed if a webhook isn't set ANSIBLE_HOST_KEY_CHECKINGSet the variable to Falseto disbale ssh prompt for host key checks (skip the fingerprint)
-
If you want to use a specific cosmovisor version , you can run the following command to list all the cosmovisor versions:
git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/cosmos/cosmos-sdk.git | grep "cosmovisor" | fgrep -v '{}'
- Run the playbook from the root folder of this repo.:
ansible-playbook -i hosts.ini main/commercio.yml
If you don't choose to install the test height script via the playbook you can install it manually, here's how:
- Copy the script from
main/post_install/tasks/test_height.shon the server - Replace the
{{ slack_hook }}variable in the file with your own slack webhook - Add the script to a crontab using the
crontab -ecommand. We suggest running the script every 5 minutes
There may be errors when launching the playbook. These are the most common:
-
During the
install_binary : Run 'make' on targetstep there may be a possible failure in compiling the binary due to theTestProcessTestSuitetest not passing. The playbook will ignore the error and continue execution. The binary still compiles and will work fine. -
During the
setup_configuration : Download genesis filestep, a possible failure in the genesis download may occur. This error is caused by Github not responding to the request correctly. In this case the playbook will stop. This error rarely occurs and it will be enough to restart the playbook to complete the configuration.