Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Remi-IBS/bcna
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-IBS committed Oct 18, 2023
2 parents e792a4e + fe43328 commit 1855662
Show file tree
Hide file tree
Showing 15 changed files with 1,116 additions and 843 deletions.
14 changes: 7 additions & 7 deletions 1.install-compile.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install / Compile last BitCanna binary
**bcnad** is a blockchain application built using Cosmos SDK v.0.45.16 and Comet-BFT v.0.34.27 and IBC-go v4.4.0.
**bcnad** is a blockchain application built using Cosmos SDK v.0.46.13 and Comet-BFT v.0.34.28 and IBC-go v6.1.1.

In this guide you will find how to install the last binary or compile it by yourself.

Expand All @@ -18,18 +18,18 @@ If we don't raise this value, nodes will crash once the network grows large enou
```
## Option 1. Download and install the last binary
By downloading the binary we avoid compiling the source code.
1. Download the latest version (v1.7.0) from Github:
1. Download the latest version (v.2.0.2) from Github:
```
cd $HOME
wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.7.0/bcna_linux_amd64.tar.gz
wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v2.0.2/bcna_linux_amd64.tar.gz
```
2. Check the sha256sum for the downloaded file.
```
sha256sum bcna_linux_amd64.tar.gz
```
It must return: `3e4e4880f75139f903914d4045f5198826cd289f3f6634d9443aaff0df37ce68`
It must return: `e991b8ff7bc8dfce6f3d321a61debd60fbbd3a104220e599c075f4f21cc22754`

3. Verify that the version is `1.7.0`
3. Verify that the version is `2.0.2`
```
rm -f ./bcnad #delete old file if exist
tar zxvf bcna_linux_amd64.tar.gz
Expand Down Expand Up @@ -82,14 +82,14 @@ The official instructions can be found here: https://golang.org/doc/install
```
git clone https://github.com/BitCannaGlobal/bcna.git
cd bcna
git checkout v1.7.0
git checkout v2.0.2
make build #it build the binary in build/ folder
```
6. Verify the version:
```
build/bcnad version
```
The output must be `1.7.0`
The output must be `2.0.2`

7. You now have two options:
* Move the binary to the /usr/local/bin path with:
Expand Down
115 changes: 0 additions & 115 deletions 1.install-compile_v2.md

This file was deleted.

171 changes: 87 additions & 84 deletions 2.2.snapshot.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sync using a snapshot file
This is a fast way to sync a node with `bitcanna-1` chain.
A snapshot is nothing more than someone sharing a copy of his/her blockchain's data folder in a compressed file.
# Synchronize using a snapshot file
This guide will describe a fast way to synchronize a node on the `bitcanna-1` blockchain.
A snapshot is nothing more than someone sharing a copy of his or her blockchain's data folder in a compressed file.

Our current authorized providers are:

Expand All @@ -15,60 +15,63 @@ Our current authorized providers are:
- https://bitszn.com/snapshots.html
- https://nodiums.com/index.php/2022/11/20/bitcanna-snapshot-state-sync-and-api-rpc/
- https://stakepool.dev.br/snapshots.html
- https://docs.indonode.net/mainnet/bitcanna/snapshot

(make sure to include them in your delegations ;)!)

> The fastest way to sync a peer is using State Sync and is described [here as an alternative](https://github.com/BitCannaGlobal/bcna/blob/main/2.1.statesync.md).

For this step, its necesary that you have followed [this manual](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md) previously in order to install the `bcnad` binary.

1. Ensure your installed binary is the lastest release:
```
bcnad version
```
Output should be: `v1.7.0`

If you are using Cosmovisor,
```
cosmovisor run version
```
Output should be:
```
cosmovisor run version
11:11AM INF running app args=["version"] module=cosmovisor path=/home/user/.bcna/cosmovisor/upgrades/vigorous-grow-huckleberry/bin/bcnad
--> v1.7.0
```
2. If you are a new user, you should **Initialize the folders:** change **_Moniker_** by your validator name (use quotes for two or more separated words *"Royal Queen Seeds"*)
```
bcnad init Moniker --chain-id bitcanna-1 --overwrite
```
This will create a `$HOME/.bcna` folder
3. **Download the Genesis** `genesis.json` file
```
cd $HOME
curl -s https://raw.githubusercontent.com/BitCannaGlobal/bcna/main/genesis.json > ~/.bcna/config/genesis.json
```
Ensure you have the correct file. Run the SHA256SUM test:
```
sha256sum $HOME/.bcna/config/genesis.json
<output> cd7449a199e71c400778f894abb00874badda572ac5443b7ec48bb0aad052f29
```
4. **Add to _config.toml_ file: server SEEDs:**

```
sed -E -i 's/seeds = \".*\"/seeds = \"[email protected]:26656,[email protected]:26656\"/' $HOME/.bcna/config/config.toml
```
5. You can **set the minimum gas prices** for transactions to be accepted into your node’s mempool. This sets a lower bound on gas prices, preventing spam.
```
sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.001ubcna\"/' $HOME/.bcna/config/app.toml
```

6. **Open the P2P port (26656 by default)**
```
sudo ufw allow 26656
```
7. **Download the file** with block-data from one of our current authorized service providers:
Make sure to include them in your delegations ;)!

> The most easy and fastest way to sync a node is by using State Sync and is described [here as an alternative](https://github.com/BitCannaGlobal/bcna/blob/main/2.1.statesync.md).

For this step, its necesary that you have followed [this manual](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile_v2.md) previously, in order to install the `bcnad` binary.

### 1. Ensure your installed version of the `bcnad` binary is the lastest release:
```
bcnad version
```
The output must be: `v2.0.3`

If you are using Cosmovisor,
```
cosmovisor run version
```
The output must be:
```
cosmovisor run version
11:11AM INF running app args=["version"] module=cosmovisor path=/home/user/.bcna/cosmovisor/upgrades/wakeandbake/bin/bcnad
2.0.2
```
### 2. Initialize the folders
If you are a new user, you must initialize the folders:

**Replace **_Moniker_** with your own validator name and use quotes for two or more separated words *"Royal Queen Seeds"*.**
```
bcnad init Moniker --chain-id bitcanna-1 --overwrite
```
This will create a `.bcna` folder in your $HOME directory.
### 3. **Download** the `genesis.json` file
```
cd $HOME
curl -s https://raw.githubusercontent.com/BitCannaGlobal/bcna/main/genesis.json > ~/.bcna/config/genesis.json
```
Ensure that you have the correct file. Run the SHA256SUM test:
```
sha256sum $HOME/.bcna/config/genesis.json
<output> cd7449a199e71c400778f894abb00874badda572ac5443b7ec48bb0aad052f29
```
### 4. **Add server SEED's to the _config.toml_ file:**
```
sed -E -i 's/seeds = \".*\"/seeds = \"[email protected]:26656,[email protected]:26656\"/' $HOME/.bcna/config/config.toml
```
### 5. You can **set the minimum gas prices** for transactions to be accepted into your node’s mempool. This sets a lower bound on gas prices, preventing spam.
```
sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.001ubcna\"/' $HOME/.bcna/config/app.toml
```

### 6. **Open the P2P port (26656 by default)**
```
sudo ufw allow 26656
```
### 7. **Download the file** with block-data from one of our current authorized service providers:

Our current authorized providers are (in alphabetical order):

Expand Down Expand Up @@ -99,23 +102,23 @@ This is the folder's tree (without Cosmosvisor installation). You should decompr
```


8. If you have downloaded and decompressed the data-block you can **run a first time** to see if `bcnad` continues to sync:
### 8. If you have downloaded and decompressed the data-block you can **run a first time** to see if `bcnad` continues to sync:

`bcnad start --log_level info`
```
3:31PM INF Committed state appHash=77D16BED3F109A4A05A971C92602029569E049DFC1DC128CFF5CCAE3158F4B1B height=3886 module=state txs=0
3:31PM INF Indexed block height=3886 module=txindex
3:31PM INF minted coins from module account amount=1034628bcna from=mint module=x/bank
3:31PM INF Executed block height=3887 invalidTxs=0 module=state validTxs=0
3:31PM INF commit synced commit=436F6D6D697449447B5B38332031333820373720313731203135362032333220313431203435203137332037372031352031363020373120393720393520352031393020313836203733203131342034322031313620313230203536203338203230203337203437203231392032353220343920385D3A4632467D
3:31PM INF Committed state appHash=538A4DAB9CE88D2DAD4D0FA047615F05BEBA49722A7478382614252FDBFC3108 height=3887 module=state txs=0
```
`bcnad start --log_level info`
```
3:31PM INF Committed state appHash=77D16BED3F109A4A05A971C92602029569E049DFC1DC128CFF5CCAE3158F4B1B height=3886 module=state txs=0
3:31PM INF Indexed block height=3886 module=txindex
3:31PM INF minted coins from module account amount=1034628bcna from=mint module=x/bank
3:31PM INF Executed block height=3887 invalidTxs=0 module=state validTxs=0
3:31PM INF commit synced commit=436F6D6D697449447B5B38332031333820373720313731203135362032333220313431203435203137332037372031352031363020373120393720393520352031393020313836203733203131342034322031313620313230203536203338203230203337203437203231392032353220343920385D3A4632467D
3:31PM INF Committed state appHash=538A4DAB9CE88D2DAD4D0FA047615F05BEBA49722A7478382614252FDBFC3108 height=3887 module=state txs=0
```

9. **Service creation**
**Ensure that you've stopped** the previous test with CTRL+C.
With all configurations ready, you can start your blockchain node with a single command (`bcnad start`). In this tutorial, however, you will find a simple way to set up `systemd` to run the node daemon with auto-restart.
### 9. **Service creation**
**Ensure that you have stopped** the previous test with CTRL+C.
With all configurations ready, you can start your blockchain node with a single command (`bcnad start`). In this tutorial however, you will find a simple way to set up `systemd` to run the node daemon with auto-restart.

At this point you can create a simple BCNA service file, or you can configure Cosmovisor, Cosmovisor works like an upgrade "supervisor" that checks and applies the correct version of the software. As a result you can setup Cosmovisor as a replacement of the bcnad daemon/command line utility and let Cosmovisor handle future upgrades.
At this point you can create a simple BCNA service file, or you can configure Cosmovisor. Cosmovisor works like an upgrade "supervisor" that checks and applies the correct version of the software. As a result you can setup Cosmovisor as a replacement of the bcnad daemon/command line utility and let Cosmovisor handle future upgrades.

So the next step is **(one of the following)**
* Skip Cosmovisor and continue with simple system service creation
Expand All @@ -142,25 +145,25 @@ Setup `bcnad` systemd service (copy and paste all to create the file service):
Enable and activate the BCNAD service.

```
sudo mv bcnad.service /lib/systemd/system/
sudo systemctl enable bcnad.service && sudo systemctl start bcnad.service
sudo mv bcnad.service /lib/systemd/system/
sudo systemctl enable bcnad.service && sudo systemctl start bcnad.service
```
Check the logs to see if it is working:
```
sudo journalctl -u bcnad -f
```
```
sudo journalctl -fu bcnad -o cat
```

10. **Check the synchronisation:** If `catching_up = true` the node is syncing. Also you can compare your current block with the last synced block of another node, or at our [Explorer](https://explorer.bitcanna.io):
```
curl -s localhost:26657/status | jq .result.sync_info.catching_up
#true output is syncing - false is synced
### 10. **Check the synchronisation:** If `catching_up = true` the node is syncing. Also you can compare your current block with the last synced block of another node, or at our [Explorer](https://explorer.bitcanna.io):
```
curl -s localhost:26657/status | jq .result.sync_info.catching_up
#true output is syncing - false is synced
curl -s localhost:26657/status | jq .result.sync_info.latest_block_height
#this output is your last block synced
curl -s localhost:26657/status | jq .result.sync_info.latest_block_height
#this output is your last block synced
curl -s "http://seed1.bitcanna.io:26657/status?" | jq .result.sync_info.latest_block_height
#this output the public node last block synced
```
curl -s "http://seed1.bitcanna.io:26657/status?" | jq .result.sync_info.latest_block_height
#this output the public node last block synced
```


###### tags: `doc` `github`
Loading

0 comments on commit 1855662

Please sign in to comment.