Improved by project: https://github.com/Phala-Network/mining-data-server
A node.js server for stake pool monitor.
- node.js
- yarn
git clone https://github.com/ty01528/phaMonitor.git
user = "***@***.com" # Your SMTP account
pass = "***" # Your SMTP password
host = "smtp.***.com" # Your SMTP host
port = 465 # Usually no changes are required
cd phaMonitor
yarn install
yarn build
yarn start
-
POST /register Content-Type: application/json {"pid": XXXX,"email": "XXXX@XXX.com"}
example:
curl -H "Content-Type: application/json" -X POST -d '{"pid": XXXX,"email": "XXXX@XXX.com"}' http://localhost:3001/register
-
GET /pid-list
example:
curl http://localhost:3001/pid-list
npm install -g pm2
cd phaMonitor
pm2 start dist/index.js --name="phaMonitor"