This project will help you to restart automatically your Jormungandr node a few minutes before it is supposed to validate a block. This ensures your pool is in sync with the tip of the blockchain.
-
Just go on official Node.js website and download the installer. Also, be sure to have
git
available in your PATH,npm
might need it (You can find git here). -
You can install nodejs and npm easily with apt install, just run the following commands.
$ sudo apt install nodejs $ sudo apt install npm
-
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following command.
$ node --version
v8.11.3
$ npm --version
6.1.0
If you need to update npm
, you can make it using npm
! Cool right? After running the following command, just open again the command line and be happy.
$ npm install npm -g
$ git clone https://github.com/thibautrey/JromungandrRestartAndStats
$ cd JromungandrRestartAndStats
$ npm install
Open index.js
then edit it with your settings. You will need to change the first 4 lines :
const node_config_path = "~/files/node-config.yaml";
const node_secret_path = "~/files/node_secret.yaml";
const genesis_path = "8e4d2a343f3dcf9330ad9035b3e8d168e6728904262f2c434a4f8f934ec7b676";
Set the amount of minutes before a block validation you want to restart your node. 5 minutes works fine for me.
const minutesBeforeBlock = 5;
$ nohup node index.js > output.log &
$ node index.js
$ cat output.log
$ node justLogs.js