forked from BitCannaGlobal/bcna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Remi-IBS/bcna
- Loading branch information
Showing
15 changed files
with
1,116 additions
and
843 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
||
|
@@ -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): | ||
|
||
|
@@ -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 | ||
|
@@ -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` |
Oops, something went wrong.