Skip to content

Node.js script which checks NEAR validation node and follow pool state to notify node owner

Notifications You must be signed in to change notification settings

edibavus/near-node-tg-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This script was created to Notify Near Validators about state changes in their nodes

Created by Timur Ruziev (participant of stakewars-iii)

You can see my challenge report here: https://github.com/ruziev-dev/near-stakewars-iii

Installation:

Clone repository & install dependencies

git clone https://github.com/ruziev-dev/near-node-tg-bot.git

cd near-node-tg-bot

npm i

Make your config.env file by example .env

cp .env config.env

Set your settings to config.env

nano config.env

# set your values
TG_API_KEY=""
TG_CHAT_ID=""
NODE_RPC="127.0.0.1:3030"
POOL_ID="xxx.factory.shardnet.near"

Run

node index.js

To automate running script find path to Node.js

which node

# use this path to in crontask
> /usr/bin/node

Add chron task every minute

crontab -e

Add this row with setting path to Node.js and script

# set your path
*/1 * * * * cd /home/<USERNAME>/near-node-tg-bot/ && /usr/bin/node index.js > /dev/null 2>&1

Reload cron service to start execute script

sudo service cron reload

About

Node.js script which checks NEAR validation node and follow pool state to notify node owner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.7%
  • Shell 1.3%