We released a new mainnet version v2.1.7 at https://github.com/nknorg/nkn/releases. This version introduces fast sync and light sync for faster block sync and smaller ledger size.
Experimental release of fast sync and light sync
In this version we are introducing two new sync mode: fast sync and light sync.
-
Fast sync: node will sync the same full block history as before, but much faster by syncing the state trie directly. Think of it as a decentralized replacement of the ChainDB snapshot that many people are using.
-
Light sync: node will only sync headers of old blocks without transactions. The local ledger size will be much smaller than before (ChainDB size is about 4GB at the time of the release), but node will not be able to respond to
getblock
andgettransaction
RPC requests for old blocks/transactions. We recommend using light sync only when node disk space is not enough.
Currently fast sync and light sync mode are still in experimental stage, and not enabled by default.
How to enable fast sync and light sync
Please note that fast sync and light sync can only be enabled when node has NO local ChainDB directory (i.e. a fresh sync). You need to remove the ChainDB
directory and let node do a fresh sync if you want to enable them.
There are two ways to enable fast sync and light sync:
-
Add
--sync fast
argument when starting nknd to enable fast sync, or add--sync light
argument when starting nknd to enable light sync. -
Add
"SyncMode": "fast"
toconfig.json
to enable fast sync, or add"SyncMode": "light"
toconfig.json
to enable light sync.
You should only choose one sync mode, not both.
How to Upgrade
- If you are using nkn-commercial (including one-click on DO/AWS/Google Cloud) or nknx fast deploy, you don’t need to do anything.
- If you downloaded the release version, you just need to download it again at https://github.com/nknorg/nkn/releases , replace files and start nknd again
- If you build from scratch, you just need to do the build again.
- If you are using some scripts or tutorials that has auto-updater, then it should be automatic if the auto-updater is working properly.
We don’t recommend anyone to download the ChainDB snapshot manually, but if you really want or need, you can use https://nkn.org/ChainDB_pruned_latest.zip or https://nkn.org/ChainDB_pruned_latest.tar.gz for pruned ChainDB.