Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

kadena-io/nodemon

Repository files navigation

Chainweb Node Monitor

Example config/backend/settings.json:

{
  "ipWhitelist": [],
  "db": {
    "host": "localhost",
    "port": 5432,
    "user": "postgres",
    "password": "",
    "db": "nodemon"
  },
  "autoscan" : {
    "networks": ["testnet04"],
    "spiderInterval": 86400,
    "cutsInterval": 300
  },
  "networks": {
    "mainnet01": [
      "us-e1.chainweb.com:443",
      "us-e2.chainweb.com:443",
      "us-w1.chainweb.com:443",
      "us-w2.chainweb.com:443",
      "fr1.chainweb.com:443",
      "fr2.chainweb.com:443",
      "jp1.chainweb.com:443",
      "jp2.chainweb.com:443"
    ],
    "testnet04": [
      "us1.testnet.chainweb.com:443",
      "us2.testnet.chainweb.com:443",
      "eu1.testnet.chainweb.com:443",
      "eu2.testnet.chainweb.com:443",
      "ap1.testnet.chainweb.com:443",
      "ap2.testnet.chainweb.com:443"
    ]
  }
}

ob run workflow

Use default configuration in config/backend/settings.json with "db": { "gargoyle": "db" }

db init:
ob repl
:l backend/src-bin/main.hs
:set args migrate
main
server startup:
ob run

Exposed API Endpoints

The following endpoints are available to trigger Nodemon scans, get node counts, and network summaries:

  • GET "/api/spider-nodes/[network]" - triggers spider scan for a given network. This will discover all known nodes of a given network. This scan is triggered automatically by jobs running in the backend every 12 hours.

  • GET "/api/cut-scans/[network]" - triggers cut scan on known nodes for a given network. This scan is triggered automatically by jobs running in the backend every minute.

  • GET "/api/total-nodes/[network]" - returns number of known nodes for a given network.

  • GET "/api/total-success-nodes/[network]" - returns number of known nodes for a given network that have responded with a 200 status code during the latest cut scan.

  • POST "/api/modify-node-watchlist-status" - allows user to specify which nodes should be on a watch list, primarily for display/sorting purposes at the moment. Example Request JSON: { "nodeId": 1, "nodeHost": "fr1.chainweb.com", "nodePort": 443, "network":"testnet04", "changeTo": true} Example Responses: Success: "OK" Error: {"error":"some error message"}

  • GET "/api/get-network-summary/[network]" - returns network summary JSON object that provides summaries for each node on a network.

    Data Type(s):

      data NetworkSummary = NetworkSummary
        { _ns_scanMap :: Map NodeId (Maybe NodeStats)
        }
    
      data NodeStats = NodeStats
        { _nodeStats_lastCutHeight :: Word64
        , _nodeStats_lastCutHash :: Text
        , _nodeStats_lastSeen :: UTCTime
        , _nodeStats_nodeVersion :: Text
        , _nodeStats_prevInfo :: Maybe (Word64, UTCTime)
        -- ^ Previous cut height different from current one and time we first received that cut height
        , _nodeStats_firstSeen :: UTCTime
        }
    
    

    Example response:

    {"_ns_scanMap":[[14,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.828617563Z","2.17.2",null,"2023-01-20T14:01:56.828617563Z"]],[15,[58419210,"JCHrrBoBsLuR0qvHN8WKCG6uXb17v4uz3-iMxwhlpm0","2023-01-20T14:01:56.828967358Z","2.17.2",null,"2023-01-20T14:01:56.828967358Z"]],[16,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.829170339Z","2.17.2",null,"2023-01-20T14:01:56.829170339Z"]],[17,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.829376859Z","2.17.2",null,"2023-01-20T14:01:56.829376859Z"]],[18,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.82959982Z","2.17.2",null,"2023-01-20T14:01:56.82959982Z"]],[22,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.829785096Z","2.17.2",null,"2023-01-20T14:01:56.829785096Z"]],[23,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.830261512Z","2.17",null,"2023-01-20T14:01:56.830261512Z"]],[24,[58419210,"JCHrrBoBsLuR0qvHN8WKCG6uXb17v4uz3-iMxwhlpm0","2023-01-20T14:01:56.830429983Z","2.17.2",null,"2023-01-20T14:01:56.830429983Z"]],[25,[58419210,"JCHrrBoBsLuR0qvHN8WKCG6uXb17v4uz3-iMxwhlpm0","2023-01-20T14:01:56.830786043Z","2.17.2",null,"2023-01-20T14:01:56.830786043Z"]],[27,[58419210,"JCHrrBoBsLuR0qvHN8WKCG6uXb17v4uz3-iMxwhlpm0","2023-01-20T14:01:56.835493753Z","2.17.2",null,"2023-01-20T14:01:56.835493753Z"]],[28,[58419210,"JCHrrBoBsLuR0qvHN8WKCG6uXb17v4uz3-iMxwhlpm0","2023-01-20T14:01:56.835623121Z","2.17.2",null,"2023-01-20T14:01:56.835623121Z"]],[29,[58419210,"JCHrrBoBsLuR0qvHN8WKCG6uXb17v4uz3-iMxwhlpm0","2023-01-20T14:01:56.835789458Z","2.17.2",null,"2023-01-20T14:01:56.835789458Z"]],[31,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.835946256Z","2.17.2",null,"2023-01-20T14:01:56.835946256Z"]],[32,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.836259529Z","2.17.2",null,"2023-01-20T14:01:56.836259529Z"]],[4033,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.836470377Z","2.17.2",null,"2023-01-20T14:01:56.836470377Z"]],[4034,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.836759028Z","2.17.2",null,"2023-01-20T14:01:56.836759028Z"]],[4036,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.837427618Z","2.17.2",null,"2023-01-20T14:01:56.837427618Z"]],[4037,[58419209,"myyoAwuoCRMwRQfmwNfyRAUzoz0u6fNe1e24M6qnYzg","2023-01-20T14:01:56.837537234Z","2.17.2",null,"2023-01-20T14:01:56.837537234Z"]]]}
    

About

NoDemon: The Kadena network exorcism tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages