# Cosmovisor setup

### Install cosmovisor <a href="#install-cosmovisor" id="install-cosmovisor"></a>

Run go install to download cosmovisor:

```
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
```

Create dir structure for cosmovisor:

```
export DAEMON_NAME=emped
export DAEMON_HOME=$HOME/.empe-chain/
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades

```

Copy emped binary to cosmovisor genesis bin:

```
cp ~/go/bin/emped $DAEMON_HOME/cosmovisor/genesis/bin
$DAEMON_HOME/cosmovisor/genesis/bin/emped version

```

Setup systemd:

```
sudo tee /etc/systemd/system/cosmovisor.service> /dev/null <<EOF
[Unit]
Description=cosmovisor
After=network-online.target

[Service]
User=$USER
ExecStart=/home/$USER/go/bin/cosmovisor run start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=emped"
Environment="DAEMON_HOME=/home/$USER/.empe-chain"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
[Install]
WantedBy=multi-user.target

EOF

```

Run a node:

<pre><code>sudo systemctl enable cosmovisor  
<strong>sudo systemctl start cosmovisor
</strong>
</code></pre>

Check status

```
sudo systemctl status cosmovisor
```

Logs from cosmovisor

<pre><code><strong>sudo journalctl -f -u cosmovisor
</strong></code></pre>

Remember to install wasmvm library as described in the [install wasmvm](/empe-blockchain/overview/install-wasmvm-library.md) to avoid issues with wasm smart contracts.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.empe.io/empe-blockchain/overview/cosmovisor-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
