Setup Cosmos Full Node In Azure
This gist contains two scripts
setup-cosmos-full-node-azure.bashwhich creates a vm in azure and then sets up a cosmos full node in that vm.
setup-cosmos-full-node.bashwhich sets up a cosmos full node locally on the machine it is running on.
How to use
The azure script expects to be run as follows, all arguments are required:
./setup-cosmos-full-node-azure.bash MONIKER_PREFIX SSH_PRIVATE_KEY_PATH PERSISTENT_PEER...
This will take the first argument
MONIKER_PREFIX and generate a random moniker of the form
Path to the private ssh key is required because the script will ssh into the machine to provision. The public key
is assumed to be at
$SSH_PRIVATE_KEY_PATH.pub. Also note that azure only supports RSA keys for SSH.
There must be at least one persistent peer of the form
Multiple peers may be passed in, see example below.
./setup-cosmos-full-node-azure.bash cosmos ~/.ssh/id_rsa "email@example.com:26656" "firstname.lastname@example.org:26656"
Running the script will:
- Create a resource group called
cosmosin your azure account
- Create a new virtual machine in that resource group call
cosmos-full-nodebased on the Debian image
- Copy the
./setup-cosmos-full-node.bashscript into that VM over ssh
- Run the
./setup-cosmos-full-node.bashscript to install cosmos-sdk and start
- Join the Cosmos mainnet
Once the script finishes it will print the IP of the newly created node, you can check status of the node by running:
To see the logs of the running node, ssh into the machine and run:
sudo journalctl -f -u gaiad.service
To have the script print out every command it runs invoke it with
TRACE=1 ./setup-cosmos-full-node-azure.bash cosmos ~/.ssh/id_rsa "email@example.com:26656" "firstname.lastname@example.org:26656"