Skip to content

Commit

Permalink
chore: minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Sep 12, 2023
1 parent ce9cff2 commit 720f12c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
19 changes: 10 additions & 9 deletions docs/tools/KSYNC/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 3

# Examples

### 1. Sync Cosmos Hub (Mainnet) with AUTO-SYNC
### 1. Sync Cosmos Hub with AUTO-SYNC

Cosmos Hub requires a start with P2P sync due to the >100MB genesis file.

Check failure on line 9 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L9

[Google.Units] Put a nonbreaking space between the number and the unit in '100MB'.
Raw output
{"message": "[Google.Units] Put a nonbreaking space between the number and the unit in '100MB'.", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 9, "column": 55}}}, "severity": "ERROR"}
To simplify the syncing process, we can use AUTO-SYNC to let KSYNC manage both processes independently.
Expand Down Expand Up @@ -36,11 +36,11 @@ mv genesis.cosmoshub-4.json ~/.gaia/config/genesis.json
Don't include an addrbook.json and KSYNC will manage your config file itself.
It should only connect to our peer. The supervised KSYNC process can be started with

`````bash
```bash
ksync start --daemon-path /<daemon-path>/gaiad --home /Users/<user>/.gaia --pool-id 0 --chain-id=kyve-1
`````
```

### 2. Sync Osmosis (Kaon) with DB-SYNC
### 2. Sync Osmosis with DB-SYNC

To sync osmosis you have to download and set up the correct osmosis binary. To sync from genesis the version `v3.1.0` has
to be used. You can download them [here](https:/osmosis-labs/osmosis/releases/tag/v3.1.0) or build them from source: [https:/osmosis-labs/osmosis](https:/osmosis-labs/osmosis)
Expand Down Expand Up @@ -77,7 +77,7 @@ After you see that the node is waiting for incoming connections you can open a *
the sync.

```bash
ksync start --mode=db --home="/Users/<user>/.osmosisd" --pool-id=1 --chain-id=kaon-1
ksync start --mode=db --home="/Users/<user>/.osmosisd" --pool-id=1 --chain-id=kyve-1
```

You should see KSYNC connecting to Osmosis and applying the blocks against the app. You can exit anytime with CMD+C
Expand All @@ -86,7 +86,7 @@ if you wish to abort the syncing process.
When you want to continue to sync normally you can now add an addrbook or add peers in `persistent_peers`. When you start

Check failure on line 86 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L86

[Vale.Spelling] Did you really mean 'addrbook'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'addrbook'?", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 86, "column": 63}}}, "severity": "ERROR"}
the node again with the normal start command `./osmosisd start` the node should continue normally and tries to sync the remaining blocks.

### 3. Sync Cosmos Hub (Mainnet) with P2P-SYNC
### 3. Sync Cosmos Hub with P2P-SYNC

Since we want to sync Cosmos Hub from genesis and the genesis file is bigger than 100MB we have to use P2P sync.

Check failure on line 91 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L91

[Google.Units] Put a nonbreaking space between the number and the unit in '100MB'.
Raw output
{"message": "[Google.Units] Put a nonbreaking space between the number and the unit in '100MB'.", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 91, "column": 83}}}, "severity": "ERROR"}

Expand Down Expand Up @@ -125,15 +125,16 @@ allow_duplicate_ip = true
Important: Don't include an addrbook.json and make sure persistent_peers and etc. (e.g. unconditional_peer_ids, private_peer_ids

Check failure on line 125 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L125

[Vale.Spelling] Did you really mean 'persistent_peers'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'persistent_peers'?", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 125, "column": 57}}}, "severity": "ERROR"}

Check failure on line 125 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L125

[Google.Latin] Use 'for example' instead of 'e.g.'.
Raw output
{"message": "[Google.Latin] Use 'for example' instead of 'e.g.'.", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 125, "column": 84}}}, "severity": "ERROR"}

Check failure on line 125 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L125

[Vale.Spelling] Did you really mean 'unconditional_peer_ids'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'unconditional_peer_ids'?", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 125, "column": 89}}}, "severity": "ERROR"}

Check failure on line 125 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L125

[Vale.Spelling] Did you really mean 'private_peer_ids'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'private_peer_ids'?", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 125, "column": 113}}}, "severity": "ERROR"}
and seeds) are empty for now or else the node will connect to other peers. It should only connect to our peer.

When the config is done the node can be started.
When the config is done the node can be started.

:::info
:::info
This can take a while (~5mins) since the genesis file is

Check failure on line 131 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L131

[Google.Units] Put a nonbreaking space between the number and the unit in '5min'.
Raw output
{"message": "[Google.Units] Put a nonbreaking space between the number and the unit in '5min'.", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 131, "column": 25}}}, "severity": "ERROR"}
quite big. You can skip invariants checks to boot even faster, but it still takes a long time until the gaia node starts.

Check failure on line 132 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L132

[Vale.Spelling] Did you really mean 'gaia'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'gaia'?", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 132, "column": 105}}}, "severity": "ERROR"}

```bash
./gaiad start --x-crisis-skip-assert-invariants
```

:::

After you see that the node is searching for peers you can start the tool. For testing KYVE has archived the first
Expand All @@ -147,4 +148,4 @@ You should see the peer connecting and sending over blocks to the gaia node. Aft
the tool shows _Done_ and you can safely exit the process with CMD+C.

When you want to continue to sync normally you can now add an addrbook or add peers in `persistent_peers`.

Check failure on line 150 in docs/tools/KSYNC/examples.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/examples.md#L150

[Vale.Spelling] Did you really mean 'addrbook'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'addrbook'?", "location": {"path": "docs/tools/KSYNC/examples.md", "range": {"start": {"line": 150, "column": 63}}}, "severity": "ERROR"}
When you start the node again the node should continue normally and tries to sync the remaining blocks.
When you start the node again the node should continue normally and tries to sync the remaining blocks.
9 changes: 8 additions & 1 deletion docs/tools/KSYNC/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ sidebar_position: 0
---

# Overview

## What is KSYNC?

Since KYVE is validating and archiving blocks from several blockchains permanently this data can be used to bootstrap nodes. This is especially helpful since most nodes today are pruning nodes and therefore finding peers which have the requested blocks becomes harder each day. With KSYNC nodes can retrieve the data from KYVE and directly feed the blocks into every Tendermint based Blockchain Application in order to sync blocks and join the network.

Check failure on line 9 in docs/tools/KSYNC/overview.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/tools/KSYNC/overview.md#L9

[Vale.Terms] Use 'blockchain' instead of 'Blockchain'.
Raw output
{"message": "[Vale.Terms] Use 'blockchain' instead of 'Blockchain'.", "location": {"path": "docs/tools/KSYNC/overview.md", "range": {"start": {"line": 9, "column": 385}}}, "severity": "ERROR"}

:::info
You can find the source code and additional docs in the GitHub repository [here](https:/KYVENetwork/ksync).
:::

## How does it work?

KSYNC comes with three sync modes which can be applied depending on the type of application. There is DB-SYNC which syncs blocks by directly communicating with the app and writing the data directly to the database and then there P2P-SYNC where KSYNC mocks a peer in the network which has all the required blocks, streaming them over the dedicated block channels over to the node.

After a node has been successfully synced with KSYNC the node simply can fetch remaining blocks and switch to live mode like it would have if synced normally. This makes operating nodes way cheaper and even may make archival nodes obsolete since blocks archived by KYVE can then be safely dropped in the nodes and synced again once needed with this tool.
After a node has been successfully synced with KSYNC the node simply can fetch remaining blocks and switch to live mode like it would have if synced normally. This makes operating nodes way cheaper and even may make archival nodes obsolete since blocks archived by KYVE can then be safely dropped in the nodes and synced again once needed with this tool.

0 comments on commit 720f12c

Please sign in to comment.