How to use State Sync
This is a step by step guide for using state sync when you're starting up a local or report light node.
Pre-requisites
Follow the Run a Layer Node section but do not start the node. We need to change some config files to turn on state sync.
Tip: If you have already started syncing and you want to start over with a state sync, you will need to delete all of the .db folders and the snapshots folder from ~/.layer/data folder:
Find a good trusted height: Note: The trusted height in production should be set to 21 days before current block to make sure all validators are honest. However, at the time of writing the chain is not yet 21 days old! We will instead use one hour.
Use the command:
This should output something like: 138807 0BCE40CD31D205453DA001780CBF765F3C64FCCB9DCB2F9825872D042780A288.
Copy this block and hash and keep it handy for the next step.
Edit config.toml:
Open your config file with your favorite text editor or nano:
Scroll or search the document and edit the variables as shown here:
Be sure to replace the trust_height and trust_hash with the block number and hash from step 1.
Exit nano with ctrl^x
then enter y
to save the changes.
Now head back to Run a Layer Node and start your node! If state sync is configured successfully it should sync very quickly so you can start testing.
Last updated