Skip to content

Commit

Permalink
GITBOOK-268: Adding Public Node Snapshot for Cronos
Browse files Browse the repository at this point in the history
  • Loading branch information
aw126 authored and gitbook-bot committed Aug 30, 2024
1 parent acac477 commit cb0ced4
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
* [Cronos Mainnet](for-node-hosts/running-nodes/cronos-mainnet/README.md)
* [Quicksync](for-node-hosts/running-nodes/cronos-mainnet/quicksync.md)
* [State-sync](for-node-hosts/running-nodes/cronos-mainnet/state-sync.md)
* [Public Node Sync](for-node-hosts/running-nodes/cronos-mainnet/public-node-sync.md)
* [KSYNC](for-node-hosts/running-nodes/cronos-mainnet/ksync.md)
* [The "Huygen" upgrade guide (v0.6.\* to v0.7.\*)](for-node-hosts/running-nodes/cronos-mainnet/huygen.md)
* [The "v0.7.0-hotfix" upgrade guide (v0.7.\* to v0.8.\*)](for-node-hosts/running-nodes/cronos-mainnet/huygen-1.md)
Expand All @@ -78,7 +79,6 @@
* [Local State Sync](for-node-hosts/running-nodes/local-state-sync.md)
* [Cronosd](for-node-hosts/cli.md)


## CRONOS PLAY

* [🎮 Introduction](cronos-play/cronos-play.md)
Expand Down
66 changes: 66 additions & 0 deletions for-node-hosts/running-nodes/cronos-mainnet/public-node-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Public Node Sync

## Introduction

{% hint style="info" %}
Note

As of `v0.9.0`, we have merged the binary to support both levelDB and rocksDB. Therefore, make sure to select the right[`app-db-backend`](https://github.com/crypto-org-chain/cronos/releases/tag/v1.0.2)in your`app.toml`. 
{% endhint %}

This guide provides step-by-step instructions to perform a faster sync for Cronosd using Public Node Sync snapshots. Please note that the type of snapshot provided is pruned. If you require more complete data or run a full node, consider using [Quicksync](https://docs.cronos.org/for-node-hosts/running-nodes/cronos-mainnet/quicksync).

## Step 1: Download Public Node Snapshot

Users can visit [Public Node Page](https://www.publicnode.com/snapshots#cronos) and download the snapshots for Cronos. Make sure to select “Cronos” and download the `lz4` file. 

## Step 2: Extract Public Node Snapshot

To start with Public Node Sync, run `brew install lz4` in a new terminal. 

## Step 3: Cronosd Setup

Download the latest version of Cronosd from [Cronos Chain Github](https://github.com/crypto-org-chain/cronos/releases/latest) based on your preferred operating system. 

Extract the downloaded file (`Cronos_1.3.0_Darwin_arm64.tar.gz` is used as an example). After you download and unzip the `cronosd` to the location you desire. In terminal, change directory to the `bin` folder, where `cronosd` is located. 

Follow the step from [Step 2-1 Initialize and Step 2-2 Configure cronosd](https://docs.cronos.org/for-node-hosts/running-nodes/cronos-mainnet#step-2-1-initialize-cronosd) to initialize and setup `cronosd`. 

Make sure you also implement the changes from [Step 0 : Notes on Network Upgrade](https://docs.cronos.org/for-node-hosts/running-nodes/cronos-mainnet#step-0-notes-on-network-upgrade), and add these config items from [`v0.7.0`](https://github.com/crypto-org-chain/cronos/releases/tag/v0.7.0) into `app.toml` before upgrade:

<pre class="language-bash"><code class="lang-bash">### JSON RPC Configuration ###
<strong>[json-rpc]
</strong>feehistory-cap = 100
logs-cap = 10000
block-range-cap = 10000
http-timeout="30s"
http-idle-timeout="120s"

### EVM Configuration ###
[evm]
max-tx-gas-wanted=500000
</code></pre>

&#x20;Perform [Run Everything](https://docs.cronos.org/for-node-hosts/running-nodes/cronos-mainnet#step-3.-run-everything), `Cronosd` should be able to sync.&#x20;

## Step 4: Extract Data from the Public Node Sync Snapshot

After you successfully start `cronosd`, you should find a new folder named `.cronos` under `/Users/<username>.` Move the `.lz4` snapshot file (e.g., `Cronos-pruned-15250257-15250267.tar.lz4`) into the `.cronos` directory. \
\
Decompress with `lz4` and `tar` by:

```bash
lz4 -d Users/<username>/.cronos/Cronos-pruned-15250257-15250267.tar.lz4 | tar -xv
```

{% hint style="info" %}
Note

All of the above files should be extracted to `/Users/<username>/.cronos/data`
{% endhint %}

## Step 5: Run Cronosd&#x20;

Now your `cronosd` is updated to the latest height as the Public Node Sync file, you can run the node now with `cronosd start`.&#x20;

That's it! You are now running a synced node on Cronos mainnet.&#x20;

0 comments on commit cb0ced4

Please sign in to comment.