How to create a snapshot?


Next 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 this command to generate your own snapshots, but we recommend using official

Inery snapshots provided by Inery dev team. You can find our snapshots here: Snapshot

or you can use

How to replay your node using snapshots?


First of all, if your node is running, you need to stop nodine. You can do this with the following command:

pkill nodine

You may have to use this command a couple of times. To check if nodine is still running, you can use the following command:

pidof nodine

- If nothing happens when you run this command, it means nodine is not running = good thing.


The next step is to download the official Inery snapshots from Snapshot.

or you can use


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

Then, you need to remove a couple of folders:

• /master.node/blockchain/data/blockchain
• /master.node/blockchain/data/state

Next, go to your /master.node folder and create a new bash script using the following command:

nano snapshots.sh

Paste the next code in snapshots.sh script and insert your data :


#!/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"
                

Save that file! Next we need to give certain permissions to our script.


We are doing that like this:

• chmod +x snapshots.sh

And all that is left now is to run the script, by typing next command:

• ./snapshots.sh


After everything is done you can go to your /master.node/blockchain folder any type tail -f nodine.log, to check if everything is working propperly or you can type cline get info. You may have to wait a little before your node starts receiving blocks, but it will sync really fast.



- Inery Devs