- node >= 12
- One of the following DBMS
- MariaDB/MySQL with InnoDB support
- Postgres or a Postgres compatible SQL interface
- SQLite (built-in)
Full library documentation is available at https://node-monitor.turtlecoin.dev
npm install -g yarn
git clone https://github.com/turtlecoin/turtlecoin-node-monitor
cd turtlecoin-node-monitor
yarn && yarn build
- Set your environment variables and start the service up
export USE_MYSQL=true
export DB_HOST=localhost
export DB_PORT=3306
export DB_USER=yourdbusername
export DB_PASS=yourdbpassword
export DB_NAME=turtlecoin
yarn start
- Set your environment variables and start the service up
export USE_POSTGRES=true
export DB_HOST=localhost
export DB_PORT=3306
export DB_USER=yourdbusername
export DB_PASS=yourdbpassword
export DB_NAME=turtlecoin
yarn start
- Set your environment variables and start the service up
export USE_SQLITE=true
export SQLITE_PATH=node-monitor.sqlite3
yarn start
Note: SQLite is not the best solution if you are running this as part of a web service.
export NODE_HISTORY_DAYS=<# of days to keep history (default: 6 hours)>
export NODE_UPDATE_INTERVAL=<# of seconds between updating node list (default: 1 hour)>
export NODE_POLLING_INTERVAL=<# of seconds between checking nodes (default: 120s)>
export NODE_LIST_URL=<Full URL to node list (default: turtlecoin-nodes-json)>
yarn add @turtlecoin/node-monitor
import { NodeMonitorDB, getDatabase } from '@turtlecoin/node-monitor';
(async() => {
const database = await getDatabase();
const StatsDatabase = new NodeMonitorDB(database);
const stats = await StatsDatabase.stats();
})();
The TurtleCoin Developers
- Twitter: @turtlecoin
- Github: @turtlecoin
Copyright © 2019-2020 The TurtleCoin Developers.
This project is AGPL-3.0 licensed.