From 00857b516b0994354484946f9a8bb2bb1bed5efc Mon Sep 17 00:00:00 2001 From: Nikola Marcetic Date: Wed, 20 Oct 2021 12:48:14 +0200 Subject: [PATCH 1/3] Add sync from scratch guide Signed-off-by: Nikola Marcetic --- guides/sync-node.md | 122 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/guides/sync-node.md b/guides/sync-node.md index fd4d2ef..0542645 100644 --- a/guides/sync-node.md +++ b/guides/sync-node.md @@ -6,5 +6,127 @@ Follow manual process [here.][sync-guide-link] Or use automation [sync script](../scripts/README.md) +**NOTE:** You always have the option to sync your sentry from scratch via public sentries out there for a better decentralization factor. + +# Sync From Scratch + + +Because of braking changes we made with release 10001 rc7, the sync process is done with +version 10001 rc6, until halt height block 2045750, then continuous with latest binary version 10001 rc7 to the latest block. + + +Here is a simple six steps guide on how to sync from scratch + + +### Step 1 + +Backup your configuration + +``` +mkdir $HOME/injectived-backup/ +cp -rf $HOME/.injectived/config $HOME/.injectived/keyring-file $HOME/injectived-backup/ +``` + +### Step 2 + Get previues release version `10001 rc6` + ``` + # Make sure that no running injectived processes + killall injectived &>/dev/null || true + + # Remove current binary that you use + rm -rf /usr/bin/injectived + + wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v1.0.1-1629427973/linux-amd64.zip + + unzip linux-amd64.zip + + mv -f injectived /usr/bin + + #check version + injectived version + + # Should output + #Version dev (48356b9) + ``` + +### Step 3 +Init chain +``` +# The argument is the custom username of your node. It should be human-readable. +export MONIKER= + +# the Injective Chain has a chain-id of "injective-1" +injectived init $MONIKER --chain-id injective-1 +``` + +### Step 4 +Sync to halt height block +``` +injectived start --halt-height 2045750 +``` + +When block heigh reachs 2045750, it will exit. + +**NOTE:** Sync process takes approximately two days until reaches halt height. If you want to run sync as a background process, follow the official guide [using systemd service][using-systemd-guide-link]. +**Make sure you update ExecStart commannd** bypassing `--halt-height 2045750` param. + Otherwise, you will overshoot halt height. + +`ExecStart=/bin/bash -c '/usr/bin/injectived --halt-height 2045750 --log-level=error start'` + + +### Step 5 +From this step, you reached halt height and injectived sync process exited. You can now switch binary to the latest version. + +``` +# Make sure that no running injectived processes +killall injectived &>/dev/null || true + +# If you use systemd service, stop it, otherwise skip this step +sudo systemctl stop injectived && sudo systemctl disable injectived + +# Remove old binary, you don't need it anymore +rm -rf /usr/bin/injectived + +# Get the latest one +wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v1.0.1-1630308393/linux-amd64.zip + +unzip linux-amd64.zip + +sudo mv injectived peggo injective-exchange /usr/bin +#check version +injectived version + +# Should output +#Version dev (b174465) +``` + +### Step 6 +Continue syncing to the latest block + +``` +injectived start +``` + +**NOTE:** If you want to continue sync as a background process, follow the official guide [using systemd service][using-systemd-guide-link]. +**Make sure you update back ExecStart commannd** by removing `--halt-height 2045750` param. + + +`ExecStart=/bin/bash -c '/usr/bin/injectived --log-level=error start'` + + +Start systemd service + +`sudo systemctl start injectived && sudo systemctl enable injectived` + + +Wait until sync finish, and the block heigh should reach the latest chain block. Follow via API + +``` +curl localhost:26657/status | grep height +``` + +When it reaches network block height, your node is fully synced, and you are running the latest version of the injective chain. + [sync-guide-link]: https://docs.injective.network/docs/staking/mainnet/validate-on-mainnet/sync-from-snapshot/ +[using-systemd-guide-link]: https://chain.injective.network/guides/mainnet/join-network.html \ No newline at end of file From b1cb0afc4b62b13ef079e2e2c5423b04d587cebf Mon Sep 17 00:00:00 2001 From: Nikola Marcetic Date: Wed, 20 Oct 2021 16:23:48 +0200 Subject: [PATCH 2/3] Add missing section Signed-off-by: Nikola Marcetic --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index def2432..ed60cac 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,15 @@ It also contains hassle-free guides and scripts for getting started and managing * [Create a new node and join the network](guides/new-node.md) * [Sync node from the snapshot](guides/sync-node.md) (quickest way to sync blocks). +* [Sync node from scratch via public sentries](guides/sync-node.md) (better decentralization factor). * [Upgrade Node to the latest version](guides/upgrade-node.md) - ## Requirments + The following requirements are required to run the node natively. -### Hardware: +### Hardware + The following table shows the recommended hardware requirements for the running node on the mainnet. | Validator Node | Sentry Node | @@ -23,15 +25,14 @@ The following table shows the recommended hardware requirements for the running | Storage: 1Tb | Storage: 1Tb | | Network: 5Gbps+ | Network: 5Gbps+| - -### Software: +### Software * [Go Installed][go-install-link] * [Git Installed][git-link] * [AWS CLI][aws-cli-install-link] (only for snapshot sync, aws account not required) - ## Sentry Seed Nodes + For the **testnet**, find a list of seed nodes in seed.txt in the matching release folder [here][injective-netconf-test] *Example, for testnet release [0.4.14](https://github.com/InjectiveLabs/injective-chain-releases/releases/tag/v0.4.14-1632990203) @@ -40,17 +41,19 @@ you will find the seed node list in `40014/seed.txt`* For the **mainnet**, find a list of seed nodes matching your release [here][injective-netconf-main] ## Helpful links + * [Official Documentation][injective-docs] * [Injective REST API Spec][injective-rest-api-link] # Get Involved + Injective Protocol is a community driven project; we welcome all contribution. + * Discuss with [Discord community][discord-community-link] * Join Injective on [Telegram][telegram-community-link] * [Github repositories][injective-github-repo] * Follows us on [Twitter][injective-twitter-link] - [sync-node-link]: [create-node-link]: [upgrade-node-link]: https://docs.injective.network/docs/staking/mainnet/validate-on-mainnet/upgrading-your-node From b480b2b822b9c9d18bcd170f5948ebf143fec309 Mon Sep 17 00:00:00 2001 From: Albert Chon Date: Wed, 20 Oct 2021 11:21:15 -0400 Subject: [PATCH 3/3] Update sync-node.md --- guides/sync-node.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/guides/sync-node.md b/guides/sync-node.md index 0542645..ec24786 100644 --- a/guides/sync-node.md +++ b/guides/sync-node.md @@ -6,16 +6,15 @@ Follow manual process [here.][sync-guide-link] Or use automation [sync script](../scripts/README.md) -**NOTE:** You always have the option to sync your sentry from scratch via public sentries out there for a better decentralization factor. +**NOTE:** You always have the option to sync your sentry from scratch via public sentries, which is a more decentralized approach. # Sync From Scratch -Because of braking changes we made with release 10001 rc7, the sync process is done with -version 10001 rc6, until halt height block 2045750, then continuous with latest binary version 10001 rc7 to the latest block. +Because of breaking changes we made with release 10001 rc7, the node should be synced with `injectived` +version 10001 rc6, until halt height block 2045750. Then the `injectived` binary should be updated to version 10001 rc7 to the latest block. - -Here is a simple six steps guide on how to sync from scratch +Here is a simple 6-step guide on how to sync from scratch. ### Step 1 @@ -28,7 +27,7 @@ cp -rf $HOME/.injectived/config $HOME/.injectived/keyring-file $HOME/injectived- ``` ### Step 2 - Get previues release version `10001 rc6` + Get the previous release version `10001 rc6` ``` # Make sure that no running injectived processes killall injectived &>/dev/null || true @@ -65,17 +64,17 @@ Sync to halt height block injectived start --halt-height 2045750 ``` -When block heigh reachs 2045750, it will exit. +The node will automatically exit upon reaching block height reachs 2045750. -**NOTE:** Sync process takes approximately two days until reaches halt height. If you want to run sync as a background process, follow the official guide [using systemd service][using-systemd-guide-link]. +**NOTE:** The sync process takes approximately two days until it reaches halt height. If you want to run sync as a background process, follow the official guide [using systemd service][using-systemd-guide-link]. **Make sure you update ExecStart commannd** bypassing `--halt-height 2045750` param. - Otherwise, you will overshoot halt height. + Otherwise, you will overshoot the halt height and will have to resync from scratch again. `ExecStart=/bin/bash -c '/usr/bin/injectived --halt-height 2045750 --log-level=error start'` ### Step 5 -From this step, you reached halt height and injectived sync process exited. You can now switch binary to the latest version. +From this step, given that you've now reached the halt height, you can now switch binary to the latest version. ``` # Make sure that no running injectived processes @@ -101,7 +100,7 @@ injectived version ``` ### Step 6 -Continue syncing to the latest block +Continue syncing to the latest block. ``` injectived start @@ -119,7 +118,7 @@ Start systemd service `sudo systemctl start injectived && sudo systemctl enable injectived` -Wait until sync finish, and the block heigh should reach the latest chain block. Follow via API +Wait until the sync finishes, and the block height should reach the latest chain block. Follow via API ``` curl localhost:26657/status | grep height @@ -129,4 +128,4 @@ When it reaches network block height, your node is fully synced, and you are run [sync-guide-link]: https://docs.injective.network/docs/staking/mainnet/validate-on-mainnet/sync-from-snapshot/ -[using-systemd-guide-link]: https://chain.injective.network/guides/mainnet/join-network.html \ No newline at end of file +[using-systemd-guide-link]: https://chain.injective.network/guides/mainnet/join-network.html