-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
Feat/archway ssync
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# For KYVE Protocol Validators | ||
This section includes all commands used by KYVE Protocol Validators to participate in _state-sync_ data pools. | ||
|
||
## SERVE-SNAPSHOTS | ||
|
||
This command is essential for running as a protocol node in a _state-sync_ pool since this will serve the snapshots to the | ||
Check failure on line 10 in docs/tools/KSYNC/protocol_validators.md GitHub Actions / vale[vale] docs/tools/KSYNC/protocol_validators.md#L10
Raw output
|
||
protocol node. Basically, KSYNC will sync the blocks with _block-sync_ and waits for the ABCI app to create the snapshots, | ||
Check failure on line 11 in docs/tools/KSYNC/protocol_validators.md GitHub Actions / vale[vale] docs/tools/KSYNC/protocol_validators.md#L11
Raw output
|
||
once created they are exposed over a REST API server which the protocol node can then query. | ||
Check failure on line 12 in docs/tools/KSYNC/protocol_validators.md GitHub Actions / vale[vale] docs/tools/KSYNC/protocol_validators.md#L12
Raw output
|
||
|
||
To start with default settings serve the snapshots with: | ||
|
||
```bash | ||
ksync serve-snapshots --binary="/path/to/<binaryd>" --home="/path/to/.<home>" --snapshot-pool-id=<pool-id> --block-pool-id=<pool-id> | ||
``` | ||
|
||
Once you see that KSYNC is syncing blocks you can open `https://localhost:7878/list_snapshots`. In the beginning it should | ||
return an empty array, but after the first snapshot height is reached (check the interval in the data pool settings) you | ||
should see a first snapshot object in the response. | ||
|
||
### Changing snapshot api server port | ||
Check failure on line 24 in docs/tools/KSYNC/protocol_validators.md GitHub Actions / vale[vale] docs/tools/KSYNC/protocol_validators.md#L24
Raw output
|
||
|
||
You can change the snapshot api server port with the flag `--snapshot-port=<port>` | ||
Check failure on line 26 in docs/tools/KSYNC/protocol_validators.md GitHub Actions / vale[vale] docs/tools/KSYNC/protocol_validators.md#L26
Raw output
|
||
|
||
### Enabling metrics server and manage port | ||
|
||
You can enable a metrics server running by default on `http://localhost:8080/metrics` by add the flag `--metrics`. | ||
Furthermore, can you change the port of the metrics server by adding the flag `--metrics-port=<port>` | ||
|
||
### Manage pruning | ||
|
||
By default, pruning is enabled. That means that all blocks, states and snapshots prior to the snapshot pool height | ||
are automatically, deleted, saving a lot of disk space. If you want to disable it add the flag `--pruning=false` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Settings | ||
|
||
## Backups | ||
|
||
Even with the right setup and careful maintenance, it's possible to encounter app-hash errors or other unexpected problems that can lead to node collisions and resyncs from Genesis. Especially when you're dealing with syncing an archival node, it's a good idea to create periodic backups of the node's data. | ||
Check failure on line 9 in docs/tools/KSYNC/settings.md GitHub Actions / vale[vale] docs/tools/KSYNC/settings.md#L9
Raw output
|
||
|
||
KSYNC offers precisely this option for creating backups. There are two different methods to utilize this: | ||
|
||
### 1. BLOCK-SYNC-Backups | ||
|
||
With _block-sync_, nodes can be synced by KSYNC from any height up to the latest height available by the storage pool. | ||
Check failure on line 15 in docs/tools/KSYNC/settings.md GitHub Actions / vale[vale] docs/tools/KSYNC/settings.md#L15
Raw output
|
||
Backups can be created automatically at an interval, with the following parameters: | ||
|
||
```bash | ||
--home string 'home directory of the node (e.g. ~/.osmosisd)' | ||
--backup-interval int 'block interval to write backups of data directory (set 0 to disable backups)' | ||
--backup-keep-recent int 'number of latest backups to be keep (0 to keep all backups)' | ||
--backup-compression string 'compression type used for backups ("tar.gz","zip"), if not compression given the backup will be stored uncompressed' | ||
--backup-dest string 'path where backups should be stored [default = ~/.ksync/backups]' | ||
``` | ||
|
||
When the specified `backup-interval` is reached (`height % backup-interval = 0`), KSYNC temporarily pauses the sync process and creates a backup. | ||
These backups are duplicates of the node's data directory (e.g. `~/.osmosisd/data`). If compression is enabled (e.g. using `--backup-compression="tar.gz"`), the backup is compressed and the original uncompressed version is deleted after successful compression in a parallel process. | ||
Check failure on line 27 in docs/tools/KSYNC/settings.md GitHub Actions / vale[vale] docs/tools/KSYNC/settings.md#L27
Raw output
Check failure on line 27 in docs/tools/KSYNC/settings.md GitHub Actions / vale[vale] docs/tools/KSYNC/settings.md#L27
Raw output
|
||
|
||
#### Usage | ||
|
||
Because backups are disabled by default, it's only required to set ``backup-interval``, whereas the other flags are optional. | ||
Since the creation of a backup takes steadily longer as the data size grows, it is recommended to choose an interval of more than `20000` blocks. | ||
|
||
Example command to run _block-sync_ with compressed backups: | ||
```bash | ||
ksync block-sync --binary="/path/to/<binaryd>" --home="/path/to/.<home>" --block-pool-id=<pool-id> --target-height=<height> | ||
--backup-interval=50000 --backup-compression="tar.gz" | ||
``` | ||
|
||
### 2. Backup-Command | ||
|
||
The backup functionality can of course also be used with a standalone command. In this case everything runs in one process | ||
where the following flags can be used: | ||
|
||
```bash | ||
--home string 'home directory of the node (e.g. ~/.osmosisd)' | ||
--backup-keep-recent int 'number of latest backups to be keep (0 to keep all backups)' | ||
--backup-compression string 'compression type used for backups ("tar.gz","zip"), if not compression given the backup will be stored uncompressed' | ||
--backup-dest string 'path where backups should be stored [default = ~/.ksync/backups]' | ||
``` | ||
|
||
#### Usage | ||
|
||
```bash | ||
ksync backup --home="/Users/christopher/.osmosisd" --compression="tar.gz" | ||
``` | ||
|
||
## Overwrite default endpoints | ||
|
||
KSYNC retrieves data from different sources, including a KYVE chain and a storage provider endpoint. Depending on the specified `chain-id`, the default KYVE **chain endpoints** are: | ||
|
||
- **Mainnet (`kyve-1`)**: https://api-eu-1.kyve.network | ||
- **Testnet (`kaon-1`)**: https://api-eu-1.kaon.kyve.network | ||
- **Devnet (`korellia`)**: https://api.korellia.kyve.network | ||
|
||
Whereas the default **storage provider endpoints** are: | ||
- **Arweave (`1`)**: https://arweave.net | ||
- **Bundlr (`2`)**: https://arweave.net | ||
- **KYVE Storage Provider (`3`)**: https://storage.kyve.network _(shouldn't be overwritten)_ | ||
|
||
For several reasons, you can overwrite the default endpoints with your preferred ones. For this purpose, only add the following flags to all commands that are using the listed endpoints: | ||
|
||
```bash | ||
--chain-rest string overwrite KYVE chain rest endpoint | ||
--storage-rest string overwrite storage provider rest endpoint | ||
``` | ||
|
||
### Example | ||
|
||
Use the KYVE chain US endpoint to _block_sync_ your Osmosis node: | ||
Check failure on line 80 in docs/tools/KSYNC/settings.md GitHub Actions / vale[vale] docs/tools/KSYNC/settings.md#L80
Raw output
|
||
|
||
```bash | ||
ksync block-sync --chain-rest="https://api-us-1.kyve.network" --binary="/Users/alice/osmosisd" --home="/Users/alice/.osmosisd" --block-pool-id=1 --target-height=42000 | ||
``` | ||
|
||
## Metrics | ||
|
||
You can enable useful metrics through the `--metrics` flag for all syncing commands. By default, it's exposed on ``http://localhost:8080/metrics`` and you can specify a custom port with ``--metrics-port``. | ||
|
||
The exposed metrics include the following information: | ||
|
||
```json | ||
{ | ||
"latest_block_hash": "A6C59D5F7487B95B32B71EB97F8FE0EE7BE7B512044FC53B6C4A706594167AF9", | ||
"latest_app_hash": "6BF3787314EC5C1B8FF08334193A31EF562CFE6700C3E6B604C31FD053F7FAF4", | ||
"latest_block_height": "180", | ||
"latest_block_time": "2021-06-18T22:03:40.861352885Z", | ||
"earliest_block_hash": "C8DC787FAAE0941EF05C75C3AECCF04B85DFB1D4A8D054A463F323B0D9459719", | ||
"earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", | ||
"earliest_block_height": "1", | ||
"earliest_block_time": "2021-06-18T17:00:00Z", | ||
"catching_up": true | ||
} | ||
``` |
9a6af8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kyve-docs – ./
kyve-docs-git-main-kyve.vercel.app
kyve-docs-kyve.vercel.app
docs-phi-snowy.vercel.app
docs.kyve.network