npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@trrxitte/traaittcash-node-monitor

v0.0.8

Published

A traaittCASH public node monitor agent that monitors, polls, and logs public node availability and basic information to MySQL/MariaDB backend.

Downloads

6

Readme

NPM

Prerequisites

Install

Collection Service

npm install -g traaittcash-node-monitor
export MYSQL_HOST=<server ip>
export MYSQL_PORT=<server port>
export MYSQL_USERNAME=<server username>
export MYSQL_PASSWORD=<server password>
export MYSQL_DATABASE=<database>
traaittcash-node-monitor

Additional Options

export MYSQL_SOCKET=<server socket path (default: not set)>
export MYSQL_CONNECTION_LIMIT=<# of maximum server connections (default: 10)>
export HISTORY_DAYS=<# of days to keep history (default: 6 hours)>
export UPDATE_INTERVAL=<# of seconds between updating node list (default: 1 hour)>
export POLLING_INTERVAL=<# of seconds between checking nodes (default: 120s)>
export NODE_LIST_URL=<Full URL to node list (default: turtlecoin-nodes-json)>

As a Module for Pulling Stats

npm install --save traaittcash-node-monitor

Sample Code

const StatsDatabase = require('traaittcash-node-monitor')

const db = new StatsDatabase({
  host: 'localhost',
  port: 3306,
  username: 'root',
  password: 'password',
  database: 'traaittcash',
  connectionLimit: 10
})

db.getNodeStats().then((stats) => {
  console.log(stats)
})

Database Schema

CREATE TABLE IF NOT EXISTS `nodes` (
  `id` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL,
  `hostname` varchar(255) NOT NULL,
  `port` int(11) NOT NULL DEFAULT 14486,
  `ssl` int(11) NOT NULL DEFAULT 0,
  `cache` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `ssl` (`ssl`),
  KEY `cache` (`cache`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `node_polling` (
  `id` varchar(64) NOT NULL,
  `timestamp` bigint(1) unsigned NOT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `feeAddress` varchar(255) DEFAULT NULL,
  `feeAmount` bigint(20) NOT NULL DEFAULT 0,
  `height` bigint(20) NOT NULL DEFAULT 0,
  `version` varchar(20) NOT NULL DEFAULT '0.0.0',
  `connectionsIn` int(11) NOT NULL DEFAULT 0,
  `connectionsOut` int(11) NOT NULL DEFAULT 0,
  `difficulty` bigint(20) NOT NULL DEFAULT 0,
  `hashrate` bigint(20) NOT NULL DEFAULT 0,
  `txPoolSize` bigint(20) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`,`timestamp`),
  KEY `status` (`status`),
  KEY `feeAmount` (`feeAmount`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;

Author

TRRXITTE Int., incorporate

The TurtleCoin Developers

License

Copyright © 2022 TRRXITTE Int., incorporate

Copyright © 2019 The TurtleCoin Developers. This project is AGPL-3.0 licensed.