1. Home
  2. Delegate
  3. Linux
  4. Setting Up A Backup Node

Setting Up A Backup Node

Prerequisites

To complete this tutorial, you will need:

Configuration

First of all, we will need to edit the config.json in the shift folder of both nodes. There we will need to always whitelist the other one, so it can access it, meaning: In your master node (main node) you have the whitelist your slave node (backup), while you have the whitelist the master node on your slave node. Besides that, you will also need to remove your secret from both config.json.

nano config.json
    "forging": {
        "force": false,
        "secret": [],
        "access": {
            "whiteList": [
                "127.0.0.1","1.2.3.4",
            ]
        }
    },

Note that “1.2.3.4”, is the extra IP.

Now we will need to edit the consensus settings of shift-checker in your config.php: There we will enable the consensus checker, set the master/slave and the IPs. Here is an example of the config for a master node:

nano config.php

// Consensus settings
 $consensusEnable= true; // Enable consensus check? Be sure to check $nodes first..
 $master = true; // Is this your master node? True/False
 $masternode = "http://127.0.0.1"; // Master node
 $masterport = 9305; // Master port
 $slavenode = "http://1.2.3.4"; // Slave node IP
 $slaveport = 9305; // Slave port
 $threshold = 50; // Percentage of consensus threshold
 $apiHost = "https://wallet.shiftnrg.org"; // Used to calculate $publicKey by $secret.
 $secret = array("shift shift shift shift shift shift shift shift shift shift shift shift"); // Add your secrets here. If you want to forge multiple, add extra to the array.

In case you have setup SSL with this guide on both nodes, the config of your slave could look like this:

// Consensus settings 
$consensusEnable= true; // Enable consensus check? Be sure to check $nodes first.. 
$master = false; // Is this your master node? True/False 
$masternode = "https://server.domain.tk"; // Master node 
$masterport = 9306; // SSL Port 
$slavenode = "http://127.0.0.1"; // Slave node IP 
$slaveport = 9305; // Slave port 
$threshold = 50; // Percentage of consensus threshold 
$apiHost = "https://wallet.shiftnrg.org"; // Used to calculate $publicKey by $secret. 
$secret = array("shift shift shift shift shift shift shift shift shift shift shift shift"); // Add your secrets here. If you want to forge multiple, add extra to the array.
Was this article helpful to you? Yes No

How can we help?