> For the complete documentation index, see [llms.txt](https://docs.tellor.io/tellor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tellor.io/tellor/running-tellor/node-setup/cosmovisor-sync.md).

# Cosmovisor Sync

## Prerequisites:

A Tellor node machine configured like [this](broken://pages/OzHKVqI8SaLRc9qfBb3m) is not required, but different setups may require different commands from the ones shown below.

## Build and configure Cosmovisor

1. **Clone the** cosmos repo somewhere on your node machine and change directory to `cosmos-sdk`

```sh
git clone https://github.com/cosmos/cosmos-sdk && cd cosmos-sdk/tools/cosmovisor
```

2. Build cosmovisor:

```sh
go build ./cmd/cosmovisor
```

3. Add the following to the end of your `~/.bashrc` or `~/.zshrc` file:

```
# cosmovisor
export DAEMON_NAME=layerd
export DAEMON_HOME=$HOME/.layer
export DAEMON_RESTART_AFTER_UPGRADE=true
export DAEMON_ALLOW_DOWNLOAD_BINARIES=false
export DAEMON_POLL_INTERVAL=300ms
export UNSAFE_SKIP_BACKUP=true
export DAEMON_PREUPGRADE_MAX_RETRIES=0
```

Use `source ~/.bashrc` or `source ~/.zshrc` to load the variables.

4. Initialize cosmovisor and add all the of the upgrades that you downloaded during [node setup](broken://pages/OzHKVqI8SaLRc9qfBb3m). Change the file paths in the command to match the correct folder path to each binary:

```shell
# set up cosmovisor. Each command is done seperatly.
./cosmovisor init ~/layer/binaries/v4.0.3/layerd
./cosmovisor add-upgrade v5.0.0 ~/layer/binaries/v5.0.0/layerd
./cosmovisor add-upgrade v5.1.0 ~/layer/binaries/v5.1.0/layerd
./cosmovisor add-upgrade v5.1.1 ~/layer/binaries/v5.1.1/layerd
./cosmovisor add-upgrade v5.1.2 ~/layer/binaries/v5.1.2/layerd
./cosmovisor add-upgrade v6.0.0 ~/layer/binaries/v6.0.0/layerd
./cosmovisor add-upgrade v6.1.0 ~/layer/binaries/v6.1.0-fix/layerd
./cosmovisor add-upgrade v6.1.1 ~/layer/binaries/v6.1.1/layerd
```

6. To start your node with cosmovisor managing upgrades:

{% code overflow="wrap" %}

```sh
./cosmovisor run start --home ~/.layer --keyring-backend test --key-name YOUR_ACCOUNT_NAME --api.enable --api.swagger
```

{% endcode %}

Make sure to do `add-upgrade` in advance of future Tellor upgrades to make use of cosmovisor's upgrade automation!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.tellor.io/tellor/running-tellor/node-setup/cosmovisor-sync.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
