Skip to content

Commit

Permalink
GitBook: [crypto-org-chain#17] Quickstart with state-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
lezzokafka authored and gitbook-bot committed Aug 29, 2022
1 parent ade5b1e commit 10e589b
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 8 deletions.
Binary file removed .gitbook/assets/defiwallet1-2 (1) (1).png
Binary file not shown.
Binary file removed .gitbook/assets/defiwallet1-2 (1) (2).png
Binary file not shown.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* [Running nodes](for-node-hosts/running-nodes/README.md)
* [Cronos Mainnet Beta](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)
* [The "Huygen" upgrade guide (v0.6.\* to v0.7.\*) :](for-node-hosts/running-nodes/cronos-mainnet/huygen.md)
* [Cronos Testnet](for-node-hosts/running-nodes/cronos-testnet.md)
* [Devnet](for-node-hosts/running-nodes/local-devnet.md)
Expand Down
8 changes: 4 additions & 4 deletions for-node-hosts/running-nodes/cronos-mainnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ We officially support macOS, Windows, and Linux only. Other platforms may work b
### Prepare your machine

* To run Cronos Mainnet Beta nodes, you will need a machine with the following minimum requirements:
* 4-core, x86\_64/ARM architecture processor;
* 16 GB RAM;
* 1 TB of storage space.
* 4-core, x86\_64/ARM architecture processor
* 16 GB RAM
* 1 TB of storage space

{% tabs %}
{% tab title="Mainnet Beta" %}
* [Seeds for Fullnode](https://github.com/crypto-org-chain/cronos-mainnet#seed-nodes)
* [Genesis files](https://raw.githubusercontent.com/crypto-org-chain/cronos-mainnet/master/cronosmainnet\_25-1/genesis.json)
* Binaries for [Linux](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Linux\_x86\_64.tar.gz), **Mac** ([Intel x86](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Darwin\_x86\_64.tar.gz) / [M1](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Darwin\_arm64.tar.gz)) and [Windows](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Windows\_x86\_64.zip)
* Binaries for [Linux](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Linux\_x86\_64.tar.gz), Mac ([Intel x86](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Darwin\_x86\_64.tar.gz) / [M1](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Darwin\_arm64.tar.gz)) and [Windows](https://github.com/crypto-org-chain/cronos/releases/download/v0.6.5/cronos\_0.6.5\_Windows\_x86\_64.zip)
{% endtab %}
{% endtabs %}

Expand Down
119 changes: 119 additions & 0 deletions for-node-hosts/running-nodes/cronos-mainnet/state-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# State-sync

## Pre-requisites

### Supported OS

Linux x86\_64 is confirmed to work. Other platforms may work but there is no guarantee. We will extend our support to other operating systems after we have stabilised our current architecture.

### Prepare your machine

To run Cronos Mainnet Beta nodes, you will need a machine with the following minimum requirements:

* 4-core, x86\_64 / ARM architecture processor
* 16 GB RAM
* 1 TB of storage space.

## Introduction

The fastest way to get a node synced to the latest block-height, is by using [State-sync](https://docs.tendermint.com/master/tendermint-core/state-sync.html). With state-sync your node downloads a data snapshot near the head of the chain and verifies this data. This leads to drastically shorter times to join the network.

Keep in mind that the blocks before state-sync trust height will not be queryable. \
So, in order to run a full node, it is better not to use state-sync, but use [Quicksync](quicksync.md)'s archive snapshot instead. 

{% hint style="info" %}
IMPORTANT

State-sync depends on the ability to pull a snapshot from its persistent-peers, so there is some amount of timing and luck involved with this method. Although it is the fastest way, it is not always going to work, in case state-sync is not syncing, we recommend to use [quicksync](quicksync.md), although it takes longer time to download the snapshot, this method is more guaranteed to work.
{% endhint %}

## Step 1. Get the latest cronosd binary

{% hint style="info" %}
The latest Cronosd [version](https://github.com/crypto-org-chain/cronos/releases) release is `cronosd v0.8.0`
{% endhint %}

* Install the **Cronos Mainnet Beta** binaries from github:

<pre class="language-bash"><code class="lang-bash"><strong>curl -LOJ https://github.com/crypto-org-chain/cronos/releases/download/v0.8.0/cronos_0.8.0_Linux_x86_64.tar.gz
</strong>tar -zxvf cronos_0.8.0_Linux_x86_64.tar.gz</code></pre>

* Check that **`cronosd`** is effectively installed:

```bash
./bin/cronosd version
0.8.0
```



## Step 2. Configure cronosd

* Initialize **cronosd.** Replace the **\[moniker]** with an ID for your node. ****&#x20;

```bash
./bin/cronosd init [moniker] --chain-id cronosmainnet_25-1
```

* Download and replace the Cronos Mainnet Beta `genesis.json` by:

```bash
curl https://raw.githubusercontent.com/crypto-org-chain/cronos-mainnet/master/cronosmainnet_25-1/genesis.json > ~/.cronos/config/genesis.json
```

* Verify the sha256sum checksum of the`genesis.json`. You should see `OK!` if the sha256sum checksum matches.

```bash
if [[ $(sha256sum ~/.cronos/config/genesis.json | awk '{print $1}') = "58f17545056267f57a2d95f4c9c00ac1d689a580e220c5d4de96570fbbc832e1" ]]; then echo "OK"; else echo "MISMATCHED"; fi;
OK!
```

* Replace the following parameters in the `~/.cronos/config/config.toml` file, by executing:

```bash
LATEST_HEIGHT=$(curl -s https://rpc.cronos.org:443/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "https://rpc.cronos.org:443/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"https://rpc.cronos.org:443,https://rpc.cronos.org:443\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(persistent_peers[[:space:]]+=[[:space:]]+).*$|\1\"0d5cf1394a1cfde28dc8f023567222abc0f47534@cronos-seed-0.crypto.org:26656,3032073adc06d710dd512240281637c1bd0c8a7b@cronos-seed-1.crypto.org:26656,04f43116b4c6c70054d9c2b7485383df5b1ed1da@cronos-seed-2.crypto.org:26656,337377dcda43d79c537d2c4d93ad3b698ce9452e@bd-cronos-mainnet-seed-node-01.bdnodes.net:26656\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" ~/.cronos/config/config.toml
```

## Step 3. Run everything

* Now that `cronosd` has been configured, we are ready to start the node:

```bash
./bin/cronosd start

1:40AM INF Unlocking keyring
1:40AM INF starting ABCI with Tendermint
1:40AM INF service start impl=multiAppConn module=proxy msg={} server=node
1:40AM INF service start connection=query impl=localClient module=abci-client msg={} server=node
1:40AM INF service start connection=snapshot impl=localClient module=abci-client msg={} server=node
1:40AM INF service start connection=mempool impl=localClient module=abci-client msg={} server=node
1:40AM INF service start connection=consensus impl=localClient module=abci-client msg={} server=node
1:40AM INF service start impl=EventBus module=events msg={} server=node
1:40AM INF service start impl=PubSub module=pubsub msg={} server=node
1:40AM INF service start impl=IndexerService module=txindex msg={} server=node
1:40AM INF Version info block=11 p2p=8 server=node tendermint_version=0.34.20
1:40AM INF This node is not a validator addr=DB03363D854BA491F280177BE33DE527F7542094 module=consensus pubKey=/L3Qe1oaNfrDael3QAmILSz5bLre9NAmKd48wd4eW8w= server=node
1:40AM INF P2P Node ID ID=d799c596250f27b5435775fdabb86d469dc5a784 file=/home/ubuntu/.cronos/config/node_key.json module=p2p server=node
1:40AM INF Adding persistent peers
```

This will take a couple of minutes, if your node manages to state-sync, you should see that snapshot chunks are being downloaded, and your node starts signing blocks.

To check the current node syncing status:

```bash
./bin/cronosd status 2>&1 | jq '.SyncInfo.catching_up'
```



That's it! You are now running a synced node on **Cronos Mainnet Beta** !
4 changes: 2 additions & 2 deletions for-users/bridge/app_n_ex/cdcex.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

**Step 3**: Select “**Add Withdrawal Address**

![centered image](<../assets/cdcex3 (1) (1) (1) (1) (1) (1).png>)
![centered image](<../assets/cdcex3 (1) (1) (1) (1) (2).png>)

**Step 4**: Select the Cronos Network, add your Cronos wallet address, and save it

![centered image](../assets/cdcex4.png)

**Step 5**: Select the Cronos wallet address that you have whitelisted and input the withdrawal amount

![centered image](<../assets/cdcex3 (1) (1) (1) (1) (1).png>)
![centered image](<../assets/cdcex3 (1) (1) (1) (1) (1) (1).png>)

**Step 6**: Review your withdrawal information and click “**Review Withdrawal”**. You will then be taken to another page for you to confirm your withdrawal information and type in your 2FA code to finalise your withdrawal. Your assets will appear in your Cronos wallet within a few minutes of withdrawal confirmation.
4 changes: 2 additions & 2 deletions for-users/bridge/other_chain/defiwallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ You can access Cronos Bridge either in DeFi Wallet's homepage or when viewing yo

![centered image](../assets/defiwallet1-1.png)

![](<../../../.gitbook/assets/defiwallet1-2 (1) (1).png>)
![](<../../../.gitbook/assets/defiwallet1-2 (1).png>)

**Step 2**: Select “**From**” Crypto.org Chain as the origin chain and “**To**” Cronos as the destination chain.

Only the `Crypto.org Chain <=> Cronos bridge` will be available on Day 1. The `Ethereum <=> Cronos bridge` will not be available until the Cronos Gravity Bridge goes live. As a Crypto.com DeFi Wallet user, you will automatically have a Crypto.org Chain wallet address and Cronos wallet address created for you. These wallet addresses will automatically be detected by the Cronos Bridge.

![](<../../../.gitbook/assets/defiwallet1-2 (1).png>)
![](<../../../.gitbook/assets/defiwallet2-1 (1).png>)

![centered image](../assets/defiwallet2-2.png)

Expand Down

0 comments on commit 10e589b

Please sign in to comment.