Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions cosmovisor/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Cosmos Node Installer with Cosmovisor Support

A Bash script to automate the setup of Cosmos SDK-based nodes with optional Cosmovisor integration.

This tool simplifies the setup process by configuring environment variables, installing Cosmovisor, and creating a systemd service to manage your node binary.

---

## 🚀 Features

- Cosmos SDK node setup
- Cosmovisor installer (version selection)
- systemd service generator
- Automated environment variable setup
- Minimal manual config

---

## 📦 Prerequisites

- **Golang installed** (`>=1.17`)
- GitHub project details for the Cosmos-based chain you want to install
- `go` in your system `PATH`
- Superuser (`sudo`) access

---

## 📁 Script Arguments

| Flag | Description |
|------|-------------|
| `-p` | Path to your Cosmos binary (e.g., `/home/user/go/bin/desmos`) |
| `-b` | Binary name (e.g., `desmos`) |
| `-c` | Configuration folder name (e.g., `desmos`) |
| `-s` | Optional Cosmovisor version (e.g., `v1.6.0`) |

---

## ⚙️ Example Usage

```bash
bash install.sh -p /root/go/bin/desmos -b desmos -c desmos -s v1.6.0
```

## This will:

- Set required environment variables for `DAEMON_NAME` and `DAEMON_HOME`
- Install Cosmovisor (interactive version selection)
- Initialize Cosmovisor with your provided binary
- Create a systemd service for automatic node management
- Configure `.profile` for persistence across sessions

---

## 🛠 Cosmovisor Version Options
The script prompts you to choose one of:
- `v1.6.0 (Recommended)`
- `v1.3.0`
- `latest`

You can also predefine a version using `-s` flag to skip the prompt.

---

## 🔁 What It Does Under the Hood
- Runs [Cosmos SDK’s Cosmovisor](https://docs.cosmos.network/master/run-node/cosmovisor.html)
- Sets up `~/.profile` with all necessary `DAEMON_*` environment variables
- Validates `cosmovisor` binary presence or installs it via `go install`
- Automatically reloads `systemd` and enables the service

---

## 📄 Output Example
```
:: Cosmovisor installed...
:: Cosmosvisor initialised successfully.
:: Cosmovisor service installed.
```
---

## 🧰 Maintainers & Contributors
This tool is maintained by Staketab. Contributions to improve the automation and documentation are welcome.

If you're a technical writer or developer looking to improve this project’s usability, open a pull request or submit an issue.

---

## 🪪 License
MIT License – see `[LICENSE]` file for details.

---

## 🤝 Contributing
Feel free to open PRs to:
* Improve documentation
* Support more Cosmos SDK chains
* Add testing/validation steps
* Refactor functions for portability

---

## 📬 Feedback
Found a bug or want to suggest an improvement?
Open an issue [here](https://github.com/Staketab/node-tools/issues) or start a discussion.

---