The first step in using the Inery system is to communicate with an active Inery Node. The Inery Node is an Ubuntu server with a static IP address that hosts the Inery blockchain protocol. For this tutorial, we will use the official Inery Testnet as our Inery Database Network. All transactions on the Inery Testnet are publicly accessible and visible on the Inery Explorer website. To interact with the Inery database, you need to make RPC API calls using the HTTPS URL of that node. Making API calls can be done using various programming languages that have libraries for RPC. Some languages, like JavaScript, Python, PHP, and C#, already have well-developed libraries for easy integration with the database model of your application.
You can setup your personal Inery Node or you can use existing nodes that provide Inery blockchain API services.
Snapshoot replay
Snapshot replay is a technique that significantly speeds up the process of replaying the blockchain by collecting an archived portion of the blockchain and replaying it from that snapshot.Snapshot replay is a technique that significantly speeds up the process of replaying the blockchain by collecting an archived portion of the blockchain and replaying it from that snapshot.
The Testnet dashboard serves as our platform for registering on the Inery testnet. By registering there, users can obtain a blockchain account with free faucet (INR) tokens as the native blockchain coin. With the faucet reward, users can purchase bytes in the blockchain database and allocate them according to the number of bytes they possess.
After registering on the Testnet dashboard, you can use the same account for blockchain account registration in the GUI. The reason for using the same account is to enable the account to claim faucet (INR) tokens on the Testnet dashboard and then exchange the INR for blockchain database storage units (bytes).
However, if desired, you can create a new blockchain account through GUI registration by providing a unique name that is not currently used by another account.
During the registration process, you will need to provide your Inery Node URL, which will be used as the API endpoint.
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 wget {{snapshot_url}} {{snapshot_out}}
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 wget {{snapshot_url}} {{snapshot_out}}
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 \ --enable-stale-production \ --p2p-max-nodes-per-host 100 \ --connection-cleanup-period 10 \ --master-name {master_name} \ --http-server-address 0.0.0.0:8888 \ --p2p-listen-endpoint {server_address}:9010 \ --signature-provider {public_key}=KEY:{private_key} \ --p2p-peer-address tas.blockchain-servers.world:9010 \ --p2p-peer-address master1.blockchain-servers.world:9012 \ --p2p-peer-address master2.blockchain-servers.world:9012 \ --p2p-peer-address master3.blockchain-servers.world:9012 \ --p2p-peer-address master4.blockchain-servers.world:9012 \ >> $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 and type tail -f nodine.log , to check if everything is working properly 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.