LogoLogo
  • Welcome
  • Explorers
    • Aptos Explorer
    • Cosmos Explorer
  • Blockchains
    • Aptos
      • Run a Validator and VFN
        • Operator
        • Node Requirements
        • Deploy Nodes
          • Using Source Code
        • Connect Nodes
          • Connect to a Network
          • Staking Pool Operations
          • Delegation Pool Operations
          • Staking Pool Voter
        • Verify Nodes
          • Node Health
          • Validator Leaderboard
        • Modify Nodes
          • Upgrade Nodes
          • Shutdown Nodes
      • Run a Public Fullnode
        • PFN Requirements
        • Deploy a PFN
          • Deploy a PFN using Source Code
        • Verify a PFN
        • Modify a PFN
          • Customize PFN Networks
          • Generate a PFN Identity
          • Upgrade your PFN
          • Run a PFN from Source Code
      • Bootstrap a Node with historical data
        • Bootstrap from a Backup
        • Bootstrap from a Snapshot
      • Configure a Node
        • State Synchronization
        • Data Pruning
        • Telemetry
        • Locating Node Files
          • Files For Mainnet
          • Files For Testnet
          • Files For Devnet
      • Monitor your Nodes
        • Important Node Metrics
        • Node Health Checker
        • Node Health Checker FAQ
        • Node Inspection Service
      • Building Aptos From Source
      • Aptos Networks
    • Berachain V2
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • gRPC Endpoint
      • Live Peers
      • Forest Staking Peer
      • Performance Optimizer Script
      • Discord & TG Alert System
      • RPC Load Balancer Setup
    • Casper
      • Explorer
    • Haqq
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Mantra
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Ika
    • Story Protocol
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • EVM Endpoint
      • Websocket
      • WSS
      • Discord & TG Alert System
      • RPC Load Balancer
      • Performance Optimizer Script
      • Live Peers
      • Forest Staking Peer
    • Supra
      • Explorer
      • Oracle data
    • Showdown
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Soarchain
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Zenrock
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Zetachain
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Airchains
      • Node Snapshot
      • Explorer
  • Gunzilla - Off The Grid
    • Vision and Foundation
    • Gunzilla Hacker Dashboard
      • Key Features of the Hackers Dashboard
        • Wallet Integration and Testnet Access
        • License System with Rarity Tiers
        • Decoding Stats and Hash Power Tracking
        • Marketplace for Trading Licenses and Assets
        • Scanner Tool for Blockchain Transparency
        • Social Media Integration and Community Engagement
      • Mastering the Hackers Dashboard
      • Benefits of the Hackers Dashboard
    • Gunzilla Token Page
  • Forest Esports Team
    • Forest Hexers
  • Crypto Tools & Analytics
    • Top 10 Crypto Exchanges
      • Binance
      • Coinbase
      • Kraken
      • Bybit
      • OKX
      • KuCoin
      • Bitfinex
      • Gemini
      • Crypto.com
      • Bitstamp
    • Top 10 Wallets
      • Ledger Nano X
      • Trezor Model T
      • Exodus
      • Coinbase Wallet
      • Trust Wallet
      • MetaMask
      • Crypto.com DeFi Wallet
      • ZenGo
      • Atomic Wallet
      • SafePal
  • Top 10 Crypto Data Platforms
    • CoinMarketCap
    • CoinGecko
    • CryptoCompare
    • CoinCodex
    • Live Coin Watch
    • CoinCheckup
    • Messari
    • CoinPaprika
    • Arkham Intelligence
  • DeFi Analytics and Tracking
    • DefiLlama
    • Dune Analytics
    • DeBank
    • Zapper
    • Token Terminal
    • DeepDAO
    • Revert Finance
    • L2BEAT
  • API's
    • What are APIs?
    • How APIs Work
    • Types of APIs
    • Real-World API Use Cases
    • Benefits of Using API's
    • Challenges and Considerations of using API's
  • Node Security
    • Physical Security
    • Network Security
    • System and Software Security
    • Access Control
    • Data Security
    • Monitoring and Logging
    • Backup and Disaster Recovery
    • Best Practices for Validator Nodes
    • Cloud Security
    • Incident Response and Recovery
  • Linux Bash
    • Bash 101
      • Getting Started with Bash
      • Navigating the File System
      • File Management Basics
      • Viewing and Editing Files
      • Managing Permissions
      • Working with Processes
      • Using Pipes and Redirection
      • Bash Scripting Basics
      • Essential Networking Commands
      • Installing Software with Package Managers
    • Advanced Linux for Validator Nodes
      • Advanced Bash Scripting for Node Automation and Maintenance
      • Monitoring and Logging Essentials
      • Networking and Security Best Practices
      • Backup and Disaster Recovery
  • Staking 101
    • Understand What Staking Is and How It Works
    • Choose a Blockchain Network to Stake On
    • Set Up a Compatible Wallet for Staking
    • Purchase or Transfer Funds for Staking
    • Choose a Staking Pool
    • Connect Your Wallet to a Staking Platform
    • Confirm and Stake Your Funds
    • Monitor Staking Rewards and Performance
    • Withdraw or Re-Stake Rewards
  • Optimizing Your Infrastructure Choices
    • Infrastructure Comparison: VPS vs. Bare Metal
Powered by GitBook
On this page
  • Quickstart
  • How NHC works
  • Running NHC: Docker
  • Running NHC: Source
  • Generating the OpenAPI specs

Was this helpful?

  1. Blockchains
  2. Aptos
  3. Monitor your Nodes

Node Health Checker

PreviousImportant Node MetricsNextNode Health Checker FAQ

Last updated 7 months ago

Was this helpful?

The Aptos Node Health Checker (NHC) service can be used to check the health of any Aptos fullnodes (VFNs or PFNs). If you are a node operator, use the NHC service to check if your node is running correctly. The NHC service evaluates your node’s health by comparing against a baseline node configuration, and outputs the evaluation results.

This document describes how to run NHC locally when you are operating a node.

If you don’t want to run the NHC service yourself, you can use the run by the Aptos Foundation.

Quickstart

Before you get into the details of how NHC works, you can run the below steps to start the NHC service and send it a request. This tutorial uses a baseline configuration for a devnet fullnode, i.e., it will evaluate your node against a devnet fullnode that is configured with the baseline configuration YAML.

Important: If your local node is not a devnet fullnode, you must use a different baseline config. See for other such example configs.

Download the baseline configuration YAML

Download a baseline configuration YAML file for a devnet fullnode. The below command will download the devnet_fullnode.yaml configuration file:

mkdir /tmp/nhc
cd /tmp/nhc
wget https://raw.githubusercontent.com/aptos-labs/aptos-core/main/ecosystem/node-checker/configuration_examples/devnet_fullnode.yaml

Start the NHC service

Start the NHC service by providing the above-downloaded devnet_fullnode.yaml baseline configuration YAML file:

docker run -v /tmp/nhc:/nhc -p 20121:20121 -t aptoslabs/node-checker:nightly /usr/local/bin/aptos-node-checker server run --baseline-config-paths /nhc/devnet_fullnode.yaml

Send a request to NHC service

Finally, send a request to the NHC service you started above. The following command runs health checks of your node that is at node_url=http://mynode.mysite.com and compares these results with the node configured in the baseline configuration devnet_fullnode:

curl 'http://localhost:20121/check?node_url=http://mynode.mysite.com&api_port=80&baseline_configuration_id=devnet_fullnode'

You will see output similar to this:

{
  "check_results": [
    {
      "headline": "Chain ID reported by baseline and target match",
      "score": 100,
      "explanation": "The node under investigation reported the same Chain ID 18 as is reported by the baseline node",
      "checker_name": "node_identity",
      "links": []
    },
    {
      "headline": "Role Type reported by baseline and target match",
      "score": 100,
      "explanation": "The node under investigation reported the same Role Type full_node as is reported by the baseline node",
      "checker_name": "node_identity",
      "links": []
    },
    {
      "headline": "Target node produced valid recent transaction",
      "score": 100,
      "explanation": "We were able to pull the same transaction (version: 3238616) from both your node and the baseline node. Great! This implies that your node is keeping up with other nodes in the network.",
      "checker_name": "transaction_availability",
      "links": []
    }
  ],
  "summary_score": 100,
  "summary_explanation": "100: Awesome!"
}

How NHC works

The NHC runs as a service. When you want to run a health check of your node, you send the HTTP requests to this service.

A single NHC instance can be configured to check the health of multiple node configurations, each of different type, for example:

  • A public fullnode connected to the Aptos mainnet.

  • A validator node connected to the Aptos testnet.

  • A node running in a single node testnet.

Baseline configuration

In all the above cases, a baseline node is used to compare your node’s health. For example, for a public fullnode connected to the Aptos devnet, the baseline node might be a node run by the Aptos team and this node demonstrates optimal performance and participation characteristics.

When you send requests to the NHC service, you must include a baseline configuration. For example, a request to NHC to use devnet_fullnode as the baseline configuration will look like this:

curl 'http://nhc.aptoslabs.com/check?node_url=http://myfullnode.mysite.com&baseline_configuration_id=devnet_fullnode'

Getting baseline configurations ready

In order to run the NHC service, you must have a baseline configuration that the service can use. You have two options here:

Configure a pre-existing YAML

Next, download these configuration YAML files into the /etc/nhc folder in your host system. For example:

mkdir /tmp/nhc
cd /tmp/nhc
configs=(devnet_fullnode testnet_fullnode mainnet_fullnode); for c in ${configs[@]}; do wget https://raw.githubusercontent.com/aptos-labs/aptos-core/main/ecosystem/node-checker/configuration_examples/$c.yaml; done

These configurations are not quite ready to be used as they are. You will need to modify certain fields, such as the baseline node address or evaluator set (evaluators and evaluator_args in the YAML) used. The best way to iterate on this is to run the NHC with a downloaded baseline configuration and see what it says on startup.

Required files

For some NHC configurations, you will need accompanying files, e.g. mint.key to use for running a TPS test against a validator. You should make sure these files are also available to NHC, either on disk or mounted into your container. NHC expects them on startup at a path specified in the baseline configuration YAML.

Running NHC: Docker

While the Aptos team hosts our own instances of this service, we encourage node operators to run their own instances.

When you are ready with baseline configuration YAML and the required files, you can run the NHC server with a command like this, for example, with Docker:

docker run -v /etc/nhc:/etc/nhc -p 20121:20121 -t aptoslabs/node-checker:nightly /usr/local/bin/aptos-node-checker server run --baseline-config-paths /tmp/nhc/devnet_fullnode.yaml /tmp/nhc/testnet_fullnode.yaml /tmp/nhc/mainnet/fullnode.yaml

You may want to include other environment variables such as RUST_LOG=info. As you can see, by default NHC runs on port 20121. Make sure to publish it from the container, as shown in the above command, and ensure the port is open on your host. You may change the port NHC runs on with --listen-port.

Running NHC: Source

First, check out the source:

git clone git@github.com:aptos-labs/aptos-core.gitcd aptos-core

Depending on your setup, you may want to check out a particular branch, to ensure NHC is compatible with your node, e.g. git checkout --track devnet.

Run NHC:

cargo run -p aptos-node-checker --release -- server run --baseline-config-paths /tmp/nhc/devnet_fullnode.yaml

Generating the OpenAPI specs

To generate the OpenAPI specs, run the following commands from ecosystem/node-checker:

cargo run -- server generate-openapi -f yaml > doc/spec.yamlcargo run -- server generate-openapi -f json > doc/spec.json

You can also hit the /spec.yaml and /spec.json endpoints of the running service.

You will download the baseline configuration YAML before running the NHC service for your node. The baseline node’s configuration YAML describes where to find this baseline node (URL + port), what evaluators (e.g. metrics checks, TPS tests, API validations, etc.) the NHC service should run, what parameters the NHC should use for those evaluators, what name the configuration has, and so on. See these .

You can find a few that work for each of the above use cases and more.

publicly available NHC service
the configuration examples in aptos-core
example baseline configuration YAML files
example baseline configuration YAML files