Snapshots

Create Snapshot

This command will create a snapshot in your master.node/blockchain/data/snapshots folder.

curl -X POST http://127.0.0.1:8888/v1/producer/create_snapshot

The name of your snapshot will look something like this:

snapshot-0073be5fd13211fb639c941f97aa9017afb446c4689b0c30e3ea396f.bin

You can use command above to generate your own snapshots, but we recommend using official snapshots.

Official snapshots are available here: https://snapshot.inery.io/ or Run Pen command below:

please note that every snapshot links are expired every 10 minutes.

Using Snapshots

Before using snapshots, you need to close existing inery app (nodine)

pkill nodine

check again using this command and make sure pid are not found (it mean has been killed)

pidof nodine

Go to inery.setup folder

cd inery-node/inery.setup

Click on Run Pen below to get snapshots from officials, or you may use your own snapshots.

Once you have downloaded the snapshots, copy them into the /master.node/blockchain/data/snapshots folder.

//move the file
mv snapshot-XXX......................XX.bin master.node/blockchain/data/snapshots/snapshot-XXX......................XX.bin

change the snapshot-XXX......................XX.bin into your downloaded file name / your own snapshots file name.

Remove blockchain data/state folder

rm -rf master.node/blockchain/data/blockchain
rm -rf master.node/blockchain/data/state

Create a snapshot bash script

nano master.node/snapshots.sh

copy all command below and save the file

#!/bin/bash
DATADIR="./blockchain"
if [ ! -d $DATADIR ]; then
    mkdir -p $DATADIR;
fi

nodine --snapshot $DATADIR"/data/snapshots/snapshots_file_name" \
--plugin inery::producer_plugin \
--plugin inery::producer_api_plugin \
--plugin inery::chain_plugin \
--plugin inery::chain_api_plugin \
--plugin inery::http_plugin \
--plugin inery::history_api_plugin \
--plugin inery::history_plugin \
--plugin inery::net_plugin \
--plugin inery::net_api_plugin \
--data-dir $DATADIR"/data" \
--blocks-dir $DATADIR"/blocks" \
--config-dir $DATADIR"/config" \
--access-control-allow-origin=* \
--contracts-console \
--http-validate-host=false \
--verbose-http-errors \
--p2p-max-nodes-per-host 100 \
--connection-cleanup-period 10 \
--master-name your_account_name \
--http-server-address 0.0.0.0:8888 \
--p2p-listen-endpoint your_DNS_here:9010 \
--p2p-peer-address tas.blockchain-servers.world:9010 \
--signature-provider your_public_key=KEY:your_private_key \
--p2p-peer-address sys.blockchain-servers.world:9010 \
--p2p-peer-address master1.blockchain-servers.world:9010 \
--p2p-peer-address master2.blockchain-servers.world:9010 \
--p2p-peer-address master3.blockchain-servers.world:9010 \
>> $DATADIR"/nodine.log" 2>&1 & \
echo $! > $DATADIR"/ined.pid"

change the snapshots_file_name to the same name as your snapshot-XXX......................XX.bin as one step before.

giving bash script permission to run

chmod +x master.node/snapshots.sh

run node with snapshots

master.node/./snapshots.sh

To see logs, use command below

tail -f master.node/blockchain/nodine.log

You may have to wait a little before your node starts receiving blocks, but it will sync faster than starting all from scratch.

Last updated