Cosmovisor Integration - Binaries

cosmovisor is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, cosmovisor can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary.

1. Setup Cosmovisor

Installing cosmovisor:
go install[email protected]
Set up the Cosmovisor environment variables. We recommend setting these in your .profile so it is automatically set in every session.
echo "# Setup Cosmovisor" >> ~/.profile
echo "export DAEMON_NAME=fxcored" >> ~/.profile
echo "export DAEMON_HOME=$HOME/.fxcore" >> ~/.profile
source ~/.profile
After this, you must make the necessary folders for cosmosvisor in your DAEMON_HOME directory (~/.fxcore) and copy over the current binary.
mkdir -p ~/.fxcore/cosmovisor
mkdir -p ~/.fxcore/cosmovisor/genesis/bin
mkdir -p ~/.fxcore/cosmovisor/upgrades/fxv3

2. Download the fxcore release

Releases can be found here
Manually download the binary and extract it to folder:
Build from source
git clone
git checkout release/v2.4.x
make build
cp ./build/bin/fxcored ~/.fxcore/cosmovisor/genesis/bin/
git checkout release/v3.1.x
make build
cp ./build/bin/fxcored ~/.fxcore/cosmovisor/upgrades/fxv3/bin/
wget && tar -xvf fx-core_2.4.2_Linux_x86_64.tar.gz -C ~/.fxcore/cosmovisor/genesis/
wget && tar -xvf fx-core_3.1.0_Linux_x86_64.tar.gz -C ~/.fxcore/cosmovisor/upgrades/fxv3/
wget && tar -xvf fx-core_2.4.2_Darwin_x86_64.tar.gz -C ~/.fxcore/cosmovisor/genesis/
wget && tar -xvf fx-core_3.1.0_Darwin_x86_64.tar.gz -C ~/.fxcore/cosmovisor/upgrades/fxv3/
wget && tar -xvf -C ~/.fxcore/cosmovisor/genesis/
wget && tar -xvf -C ~/.fxcore/cosmovisor/upgrades/fxv3/
Copying the json upgrade info, you do not need to perform this step if there is no upgrade-info.json file in the ~/.fxcore/data/ folder
cp ~/.fxcore/data/upgrade-info.json ~/.fxcore/cosmovisor/genesis/
To check that you did this correctly, ensure your versions of cosmovisor are the same:
cosmovisor version
cosmovisor version: devel-4846b9b49cbaac9da2c5df74391b9d30bfc4242e
app version: HEAD-cbba9a3bd29cfff6b9b1a7b8154922e8bc9027e8
The directory structure after correctly configuring cosmovisor should be like this
/root/.fxcore:$ tree cosmovisor
├── current -> /root/.fxcore/cosmovisor/genesis
├── genesis
│   ├── bin
│   │   └── fxcored
│   └── upgrade-info.json
└── upgrades
└── fxv3
└── bin
└── fxcored
6 directories, 3 files

3. Start your node

To keep the process always running. If you're on linux, you can do this by creating a service.
sudo tee /etc/systemd/system/fxcored.service > /dev/null <<EOF
Description=Fxcore Daemon
ExecStart=/root/go/bin/cosmovisor run start --home=/root/.fxcore
Reload, enable and restart the node with daemon service file
sudo -S systemctl daemon-reload
sudo -S systemctl enable fxcored
sudo -S systemctl restart fxcored
Accessing logs
Entire Log
journalctl -u fxcored