LogoLogo
REStakeMeet the teamBlock ExplorerHire Us
  • 🤐WhisperNode Public Guides
  • ⚛️Nodes -- Mainnet
    • Archway
      • Full Node Build
      • Setup Cosmovisor
      • Archway Resources
    • Chihuahua
      • Full Node Build
      • Setup Cosmovisor
      • Chihuahua Resources
    • AssetMantle
      • Full Node Build
      • Setup Cosmovisor
      • CLI Cheatsheet
    • Aura Network
      • Full Node Build
      • Setup Cosmovisor
      • Aura Network Resources
    • Axelar
      • Full Node Build
      • Setup Cosmovisor
      • Axelar Resources
    • Cheqd
      • Full Node Build
      • Setup Cosmovisor
      • Cheqd Resources
    • Comdex
      • Full Node Build
      • Setup Cosmovisor
      • Comdex Resources
    • Composable Finance
      • Full node build
      • Setup Cosmovisor
      • Composable Resources
    • CosmosHub
      • ICS-Provider -- [CosmosHub]
        • Full Node Build
        • Cosmovisor
      • ICS-Consumers
        • Neutron - Build a Node
      • Cosmos Resources
    • Dymension
      • Full Node Build
      • Setup Cosmovisor
      • Dymension Resources
    • Saga
      • Full Node Build
      • Setup Cosmovisor
      • Saga Resources
    • Empower
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Empower Resources
    • Gitopia
      • Full Node Build
      • Setup Cosmovisor
      • Gitopia Resources
    • Injective
      • Injective Resources
    • Juno
      • Full Node Build
      • Setup Cosmovisor
      • Juno Resources
    • Kujira
      • Full Node Build
      • Setup Cosmovisor
      • Oracle Price Feeder
      • Kujira Resources
    • Celestia
      • Full Node Build
      • Setup Cosmovisor
      • Celestia Resources
    • Migaloo
      • Full Node Build
      • Setup Cosmovisor
      • Migaloo Resources
    • Osmosis
      • Full Node Build
      • Setup Cosmovisor
      • Osmosis Resources
    • Passage
      • Full Node Build
      • Setup Cosmovisor
      • Passage Resources
    • Quasar Fi
      • Full node build
      • Setup Cosmovisor
      • Quasar Resources
    • Secret Network
      • Full Node Build
      • Setup Cosmovisor
      • Secret: State Sync
      • Secret Network Resources
    • Stargaze
      • Full node build
      • Setup Cosmovisor
      • Stargaze Resources
    • Stratos
      • Full Node Build
      • Setup Cosmovisor
      • Stratos Resources
  • 🧪Nodes -- Testnet
    • Archway - Constantine-3
      • Full Node Build
      • Setup Cosmovisor
      • Archway Resources
    • Babylon
      • Full Node Build
      • Setup Cosmovisor
      • Babylon Resources
    • Composable Finance - Banksy2
      • Full node build
      • Setup Cosmovisor
      • Composable Banksy2 Resources
    • Composable Finance - Banksy3
      • Full node build
      • Setup Cosmovisor
      • Composable Banksy3 Resources
    • Cooperative Denom
      • Full node build
      • Setup Cosmovisor
      • Cooperative Denom Resources
    • Cosmos
      • Full Node Build
      • Setup Cosmovisor
      • Cosmos Testnet Resources
    • Duality
      • Full Node Build
      • Setup Cosmovisor
      • Duality Testnet Resources
    • Dymension - Froopyland
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Dymension Resources
    • Seda
      • Full node build
      • Setup Cosmovisor
      • Seda Resources
    • Union | Testnet
      • Full node build
      • CLI Cheatsheet
      • Union Resources
    • Mantra Chain
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Mantra Chain Resources
    • dYdX Testnet
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Dymension Resources
    • Empower
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Empower Resources
    • Namada
      • Full node build
      • CLI Cheatsheet
      • Namada Resources
      • Tenderduty Setup
      • TMKMS Setup
      • Horcrux Setup
    • Penumbra
      • Full node build
      • CLI Cheatsheet
      • Namada Resources
      • Tenderduty Setup
      • TMKMS Setup
      • Horcrux Setup
    • BeraChain
      • Full node build
      • Setup Cosmovisor
      • Berachain Resources
      • CLI Cheatsheet
      • TMKMS Setup
      • Horcrux Setup
    • Neutron
      • Full Node Build
      • Setup Cosmovisor
      • Neutron Testnet Resources
    • Stride
      • Full Node Build
      • Setup Cosmovisor
      • Stride Testnet Resources
  • Reference
    • Team Validator Info
    • Chain Port Prefixes
Powered by GitBook
LogoLogo

Made with ❤️ by WhisperNode // © 2024.

On this page
  • Install
  • Add environment variables to your shell
  • Set up the folder structure
  • Set up genesis binary
  • Set up service
  • Start Cosmovisor

Was this helpful?

Edit on GitHub
Export as PDF
  1. Nodes -- Mainnet
  2. Secret Network

Setup Cosmovisor

For mainnet, it's recommended to use Cosmovisor to run your node. If you've not used it before, then run it during a testnet to check you can get it set up correctly.

Setting up Cosmovisor is relatively straightforward. However, it does expect certain environment variables and folder structures to be set.

Cosmovisor allows you to download binaries ahead of time for chain upgrades, meaning that you can do zero (or close to zero) downtime chain upgrades. It's also useful if your local timezone means that a chain upgrade will fall at a bad time.

Rather than having to do stressful ops tasks late at night, it's always better if you can automate them away, and that's what Cosmovisor tries to do.


Install

First, go and get cosmovisor (recommended approach):

go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0

Your installation can be confirmed with:

which cosmovisor

This will return something like:

/home/<your-user>/go/bin/cosmovisor

Add environment variables to your shell

In the .zshrc file, usually located at ~/.zshrc, add:

# cosmovisor - Cheqd
export DAEMON_NAME=secretd
export DAEMON_HOME=$HOME/.secretd

Then source your profile to have access to these variables:

source ~/.zshrc

You can confirm success like so:

echo $DAEMON_NAME

It should return secretd.


Set up the folder structure

Cosmovisor expects a certain folder structure:

.
├── current -> genesis or upgrades/<name>
├── genesis
│   └── bin
│       └── $DAEMON_NAME
└── upgrades
    └── <name>
        └── bin
            └── $DAEMON_NAME

Don't worry about current - that is simply a symlink used by Cosmovisor. The other folders will need setting up, but this is easy:

mkdir -p ~/.secretd/cosmovisor/genesis/bin 
mkdir -p ~/.secretd/cosmovisor/upgrades

# Change Ownership of newly created folders
sudo chown -R whispernode:whispernode ~/.secretd/cosmovisor

Set up genesis binary

Cosmovisor needs to know which binary to use at genesis. We put this in $DAEMON_HOME/cosmovisor/genesis/bin.

First, find the location of the binary you want to use:

which secretd

Then use the path returned to copy it to the directory Cosmovisor expects. Let's assume the previous command returned /home/your-user/go/bin/osmosisd:

cp $GOPATH/bin/secretd ~/.secretd/cosmovisor/genesis/bin

Once you're done, check the folder structure looks correct using a tool like tree.


Set up service

Commands sent to Cosmovisor are sent to the underlying binary. For example, cosmovisor version is the same as typing secretd version.

Nevertheless, just as we would manage secretd using a process manager, we would like to make sure Cosmovisor is automatically restarted if something happens, for example, an error or reboot.

First, create the service file:

sudo nano /etc/systemd/system/cosmovisor.service

Change the contents of the below to match your setup - cosmovisor is likely at ~/go/bin/cosmovisor regardless of which installation path you took above, but it's worth checking.

[Unit]
Description=cosmovisor
After=network-online.target
[Service]
User=user
ExecStart=/home/user/go/bin/cosmovisor start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=secretd"
Environment="DAEMON_HOME=/home/user/.secretd"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target

In addition, the same issue can be fixed by reducing the log via env variable. If you are unsure, ask on Discord.


Start Cosmovisor

Finally, enable the service and start it.

sudo -S systemctl daemon-reload
sudo -S systemctl enable cosmovisor 
sudo systemctl start cosmovisor

Check it is running using:

sudo systemctl status cosmovisor

If you need to monitor the service after launch, you can view the logs using:

journalctl -fu cosmovisor
PreviousFull Node BuildNextSecret: State Sync

Last updated 1 year ago

Was this helpful?

Note also that we set buffer size explicitly because of a before version v1.0.0. If you are using v1.0.0, you may omit that line.

⚛️
live bug in Cosmovisor