Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc for v1.5.3 upgrade #110

Merged
merged 4 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
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
135 changes: 80 additions & 55 deletions 2.3.cosmovisor.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,58 @@
# Cosmovisor setup guide for bitcanna-1

# Cosmovisor setup for `bitcanna-1`
`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, it stops the current binary, switch from the old binary to the new one, and finally restarts the node with the new binary.

This guide will explain how to install Cosmovisor and prepare for a future chain update. A full guide about Cosmovisor can be found [here](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor).
> NOTE: This doc is updated to run with last version v1.4.5. Specific Upgrade Guide for v1.4.5 from v.1.3.1 is [here](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md)
This guide will explain how to install Cosmovisor and prepare for a future chain update. A full guide about Cosmovisor can be found [here](https://github.com/cosmos/cosmos-sdk/tree/main/tools/cosmovisor).

## Step 1. Download Cosmovisor
You can build Cosmovisor from the source or download it from our GitHub repository. Detailed instruction to understand how it works [here](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor#cosmosvisor).

### A) Download Cosmovisor
## Step 1. Install/update Cosmovisor
You can build Cosmovisor from the source or download it from the official GitHub repository.

To download Cosmovisor without having to compile it yourself, run the following command:
```
cd ~
wget https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.1.0/cosmovisor-v1.1.0-linux-amd64.tar.gz
```
Check sha256 sum
```
sha256sum cosmovisor-v1.1.0-linux-amd64.tar.gz
```
It must return: `9a6eb658404f28a3607a3d531821ca4a6501749aa483698847155f362e66859d`
The easy way is install with Go:

Unzip the file, give it the correct permissions and move it to your machine's PATH
```
tar -xf cosmovisor-v1.1.0-linux-amd64.tar.gz
rm cosmovisor-v1.1.0-linux-amd64.tar.gz
chmod +x cosmovisor
sudo mv cosmovisor /usr/local/bin
```
### B) Build from source
`go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.4.0`

To compile Cosmovisor from the source, you need to have `go` installed on your system. A full guide to install `go` can be found [here](https://golangdocs.com/install-go-linux).

Try this to install Cosmovisor from the source by pulling the cosmos-sdk repository, switch to the correct version and build it:
```
git clone https://github.com/cosmos/cosmos-sdk.git
cd cosmos-sdk
git checkout cosmovisor/v1.1.0
make cosmovisor
```
The previous action builds Cosmovisor in the `/cosmovisor` directory, now let's move it to the system's PATH:
## Step 2. Setup Cosmovisor
> Version v1.2 and higher includes a new command that will create the required folder structure for you, so it will avoid you some extra steps

1) Download & init the folders with the old genesis version BitCanna `v1.2` binary.
```
sudo mv cosmovisor/cosmovisor /usr/local/bin
cd ~
rm -f bcnad #delete the binary if exist to avoid version mixings
wget https://github.com/BitCannaGlobal/bcna/releases/download/v1.2/bcnad
chmod +x ./bcnad
#Set the necessaries VARs to start Cosmovisor (later you can add to .profile)
export DAEMON_NAME=bcnad
export DAEMON_RESTART_AFTER_UPGRADE=true
export DAEMON_HOME=${HOME}/.bcna
export DAEMON_RESTART_DELAY=30s
export UNSAFE_SKIP_BACKUP=true
export DAEMON_LOG_BUFFER_SIZE=512

#add this to continue to use bcnad for commands, this is optional
PATH="${HOME}/.bcna/cosmovisor/current/bin:$PATH"

#start the initial configuration
cosmovisor init ./bcnad
```
You can delete the `cosmos-sdk` folder
It should show something like:
```
cd .. && rm -rf cosmos-sdk/
11:46AM INF checking on the genesis/bin directory module=cosmovisor
11:46AM INF creating directory (and any parents): "/Users/test/.bcna/cosmovisor/genesis/bin" module=cosmovisor
11:46AM INF checking on the genesis/bin executable module=cosmovisor
11:46AM INF copying executable into place: "/Users/test/.bcna/cosmovisor/genesis/bin/bcnad" module=cosmovisor
11:46AM INF making sure "/Users/test/.bcna/cosmovisor/genesis/bin/bcnad" is executable module=cosmovisor
11:46AM INF checking on the current symlink and creating it if needed module=cosmovisor
11:46AM INF the current symlink points to: "/Users/t/.bcna/cosmovisor/genesis/bin/bcnad" module=cosmovisor
```
## Step 2. Setup Cosmovisor
> Version v1.2 includes a new command that will create the required folder structure for you, check [here](https://github.com/cosmos/cosmos-sdk/blob/main/cosmovisor/README.md#initialization), we will create them manually:

1) Create new directories
2) Create directories for next upgrades
```
mkdir -p ${HOME}/.bcna/cosmovisor/genesis/bin
mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/ruderalis/bin
mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads/bin/
mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/trichomemonster-ica/bin/
```
2) Download & copy the old genesis version BitCanna `v1.2` binary to Cosmovisor's genesis folder.
```
cd ~
rm -f bcnad #delete the binary if exist to avoid version mixings
wget https://github.com/BitCannaGlobal/bcna/releases/download/v1.2/bcnad
cp ./bcnad ${HOME}/.bcna/cosmovisor/genesis/bin/
```

3a) Download & copy the next version `v.1.3.1` to the upgrades folder.
This guide shows how to download the binary. If you want to build the binary from the source, detailed instructions can be found in the [README](https://github.com/BitCannaGlobal/bcna/blob/main/README.md) of our GitHub.

Expand Down Expand Up @@ -92,7 +83,7 @@ This guide shows how to download the binary. If you want to build the binary fro

```
cd ~
bcna_linux_amd64.tar.gz #delete old file if exist
rm bcna_linux_amd64.tar.gz #delete old file if exist
wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.4.5/bcna_linux_amd64.tar.gz
```
Check the sha256sum.
Expand All @@ -111,20 +102,48 @@ chmod +x bcnad
```
Move the newly built binary to the upgrades directory.
```
mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads/bin/
mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads/bin/
```

3c) **Download & copy the last version `v.1.5.3` to the upgrades folder**.
This guide shows how to download the binary. If you want to build the binary from the source, detailed instructions can be found in the [README](https://github.com/BitCannaGlobal/bcna/blob/main/README.md) of our GitHub.

```
cd ~
rm bcna_linux_amd64.tar.gz #delete old file if exist
wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.5.3/bcna_linux_amd64.tar.gz
```
Check the sha256sum.
```
sha256sum bcna_linux_amd64.tar.gz
```
It must return: `--------------------tda--------------------`

Extract and verify that the version is:`1.5.3`
```
rm -f ./bcnad #delete old file if exist
tar zxvf bcna_linux_amd64.tar.gz
rm bcna_linux_amd64.tar.gz
chmod +x bcnad
./bcnad version
```
Move the newly built binary to the upgrades directory.
```
mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/trichomemonster-ica/bin/
```


> If you build the binary from the code source move it to the same folder

4) Setup the current version link for Cosmovisor.
> Very important decision now. Depending on your choice you should sync the chain using a snapshot file/service or sync from the scratch (very slow process but the only to get the whole original chain by yourself)
* If you want to sync from the scratch (from block 1) you should do:
```
ln -s -T ${HOME}/.bcna/cosmovisor/genesis ${HOME}/.bcna/cosmovisor/current
ln -sfn -T ${HOME}/.bcna/cosmovisor/genesis ${HOME}/.bcna/cosmovisor/current
```
* If you are going to sync using **(advanced users)** a snapshot file, StateSync or other you should point to the last version (v1.4.5)
```
ln -s -T ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads ${HOME}/.bcna/cosmovisor/current
ln -sfn ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads ${HOME}/.bcna/cosmovisor/current
```
5) To check if everything is OK, run:
```
Expand All @@ -133,7 +152,7 @@ ls .bcna/cosmovisor/ -lh
The output should look like this:
```
total 8.0K
lrwxrwxrwx 1 user user 35 Jan 14 20:16 current -> /home/user/.bcna/cosmovisor/genesis
lrwxrwxrwx 1 user user 35 Jan 14 20:16 current -> /home/user/.bcna/cosmovisor/upgrades/strangebuddheads
drwxrwxr-x 3 user user 4.0K Jan 14 20:09 genesis
drwxrwxr-x 4 user user 4.0K Jan 14 20:15 upgrades
```
Expand Down Expand Up @@ -201,7 +220,7 @@ sudo systemctl enable cosmovisor.service && sudo systemctl start cosmovisor.serv

13) Check the logs to see if everything is OK. (ctrl + C to stop).
```
sudo journalctl -uf cosmovisor
sudo journalctl -u cosmovisor -f -o cat
```
> You can speed up the syncing using a StateSync Server or a snapshot file.

Expand All @@ -220,6 +239,7 @@ export DAEMON_RESTART_AFTER_UPGRADE=true
export DAEMON_HOME=${HOME}/.bcna
export UNSAFE_SKIP_BACKUP=true #if you want to skip automatic backup
export DAEMON_LOG_BUFFER_SIZE=512
export DAEMON_RESTART_DELAY=30s

#add this to continue to use bcnad for commands, this is optional
PATH="${HOME}/.bcna/cosmovisor/current/bin:$PATH"
Expand All @@ -231,7 +251,7 @@ source .profile
```
3) Now let's try Cosmovisor.

* Show Cosmovisor version: `cosmovisor run version` Will be `v.1.3.1` before the upgrade and `v1.4.5` after the upgrade
* Show Cosmovisor version: `cosmovisor run version` Will be `v.1.4.5` before the upgrade and `v1.5.3` after the upgrade
```
cosmovisor run version
```
Expand All @@ -253,3 +273,8 @@ For example:
* Stop the service: `sudo service cosmovisor stop`
* Restart the service: `sudo service cosmovisor restart`
* Check the logs: `sudo journalctl -u cosmovisor -f`




###### tags: `cosmovisor`, `bitcanna`
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

BitCanna provides a decentralized payment network, supply chain and trust network for the legal cannabis industry by utilizing the BCNA coin.

> Current version is v1.4.5 - strangeBuddheads - [update instructions from v1.4.2](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.4.5)
> Current version (v1.4.5 strangeBuddheads) of our development uses Cosmos SDK v0.45.10 & Tendermint v0.34.22 & IBC-go v3.3.1

> Last version (v1.4.5 strangeBuddheads) of our development uses Cosmos SDK v0.45.10 & Tendermint v0.34.22 & IBC-go v3.3.1
> Next version: [Update scheduled for November 7th](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md)

These docs at Github are chain related. For more information about our coin, partners and roadmap visit:
* Our website: https://www.bitcanna.io
Expand Down
14 changes: 12 additions & 2 deletions last_upgrade.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# MAINNET `bitcanna-1` Upgrade
# MAINNET `bitcanna-1` Upgrades

## v1.5.3 codename `TrichomeMonster-ica` from v1.4.5
> (Update scheduled for 7 November 2022 ~ 14.00h UTC)
* Source code refactored to deprecate `CosmosCMD` package from Ignite/CLI.
* InterChain Accounts module intregration.
* Last security and stability updates.

> Note: this is a planned upgrade, chain **will halts** at block **5787420**
### For detailed instructions check the release doc:
* https://github.com/BitCannaGlobal/bcna/releases/tag/v1.5.3

## v1.4.5 from v1.4.2 (from Oct. 31th 2022)
We've developed a new version with some updates (regarding SDK, Tendermint & IBC/go) to improve the security (Dragonberry) and stability (forks in IAVL) in our chain.
* Cosmos SDK v0.45.10
* Tendermint v0.34.22
* IAVL v0.19.4
* IBC/go v3.3.1
* Ledger-go v0.9.3 (now support Ledger Nano Plus)
* Source code refactored to deprecate `CosmosCMD` package from Ignite/CLI

> Note: this is not a planned upgrade, chain won't be halted

Expand Down