-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate KYVE into sync from genesis section (#428)
chore: added kyve block-sync docs
- Loading branch information
1 parent
7271a2f
commit 2f4a442
Showing
1 changed file
with
142 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ description: Start your node by syncing it from the genesis block. | |
# Sync from genesis | ||
|
||
This is the slowest (and most secure) way to sync your node, as your node goes through every block since the genesis block. | ||
There are two ways for syncing your node from genesis: | ||
|
||
1. Through an archival node RPC. | ||
2. Through the validated and archived blocks by KYVE. | ||
|
||
|
||
::alert{variant="info"} | ||
|
@@ -79,7 +83,7 @@ wget https://github.com/archway-network/networks/blob/main/constantine-3/genesis | |
|
||
|
||
|
||
## Start the node | ||
## 1. How to sync through RPC | ||
|
||
### Start archwayd (default) | ||
|
||
|
@@ -365,7 +369,144 @@ sudo systemctl status archwayd | |
:: | ||
|
||
|
||
## 2. How to sync through KYVE | ||
|
||
KYVE is a blockchain that validates and archives chain data like Archway blocks and state-sync snapshots. | ||
The tool KSYNC provides the possibility to use the validated data in order to sync an Archway node | ||
to any height. | ||
|
||
::alert{variant="info"} | ||
More information about KSYNC can be found in the [KYVE Docs](https://docs.kyve.network/ksync). | ||
#title | ||
Info | ||
:: | ||
|
||
### KSYNC Installation | ||
|
||
#### Install with Go (recommended) | ||
|
||
Install the latest version: | ||
|
||
```bash | ||
go install github.com/KYVENetwork/ksync/cmd/ksync@latest | ||
``` | ||
|
||
Run `ksync version` to verify the installation. | ||
|
||
#### Install from source | ||
|
||
You can also install from source by pulling the ksync repository and switching to the correct version and building | ||
as follows: | ||
|
||
```bash | ||
git clone [email protected]:KYVENetwork/ksync.git | ||
cd ksync | ||
git checkout tags/vx.x.x -b vx.x.x | ||
make ksync | ||
``` | ||
|
||
This will build ksync in `/build` directory. Afterwards, you may want to put it into your machine's PATH like | ||
as follows: | ||
|
||
```bash | ||
cp build/ksync ~/go/bin/ksync | ||
``` | ||
|
||
### Starting KSYNC (default) | ||
|
||
You can _block-sync_ from genesis up to live height with the blocks | ||
validated and archived by KYVE with the following command: | ||
|
||
```bash | ||
ksync block-sync --binary="/path/to/archwayd" --source="archway" | ||
``` | ||
|
||
You can also continue the _block-sync_ from your current height to any | ||
target height you specify with `--target-height`. | ||
|
||
```bash | ||
ksync block-sync --binary="/path/to/archwayd" --source="archway" --target-height=<height> | ||
``` | ||
|
||
### Starting KSYNC as a service | ||
|
||
Since syncing from genesis can take a while a service file can be used to | ||
allow the automatic restart of the service. | ||
|
||
You can create a service file with: | ||
|
||
::highlight-card | ||
|
||
```bash | ||
nano /etc/systemd/system/archwayd.service | ||
|
||
``` | ||
|
||
:: | ||
|
||
And add the following content to the file: | ||
|
||
::highlight-card | ||
|
||
```service | ||
[Unit] | ||
Description=KSYNC Archway Node | ||
After=network-online.target | ||
[Service] | ||
User=$USER | ||
ExecStart=/home/$USER/go/bin/ksync block-sync --binary="/path/to/archwayd" --source="archway" | ||
Restart=always | ||
RestartSec=3 | ||
LimitNOFILE=4096 | ||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
:: | ||
|
||
You can then reload the systemctl daemon: | ||
::highlight-card | ||
|
||
```bash | ||
|
||
sudo systemctl daemon-reload | ||
``` | ||
|
||
:: | ||
|
||
Enable the service: | ||
|
||
::highlight-card | ||
|
||
```bash | ||
|
||
sudo -S systemctl enable archwayd | ||
``` | ||
|
||
:: | ||
|
||
And then start **archwayd** as a service: | ||
|
||
::highlight-card | ||
|
||
```bash | ||
|
||
sudo systemctl start archwayd | ||
``` | ||
|
||
:: | ||
|
||
|
||
You can then check that the service is properly running with: | ||
::highlight-card | ||
|
||
```bash | ||
|
||
sudo systemctl status archwayd | ||
``` | ||
|
||
:: | ||
|
||
## Cleaning up (optional) | ||
|
||
|