Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Setting Up a Network Security Parameter Dashboard

A technical tutorial for developers to build a real-time dashboard that monitors critical on-chain security parameters, sources data from nodes and indexers, and sets up alerting systems for governance.
Chainscore © 2026
introduction
BLOCKCHAIN MONITORING

Setting Up a Network Security Parameter Dashboard

A real-time dashboard is essential for monitoring the health and security of blockchain nodes and networks. This guide explains how to set one up using open-source tools.

Network security monitoring in Web3 involves tracking key on-chain and off-chain metrics to detect anomalies, performance degradation, and potential attacks. Unlike traditional IT monitoring, blockchain systems require observing consensus participation, peer connections, block propagation times, and mempool activity. A centralized dashboard provides a single pane of glass for these disparate data points, enabling faster incident response. Tools like Prometheus for metrics collection and Grafana for visualization form a robust, open-source foundation for this task.

The first step is instrumenting your node software to expose metrics. Most clients, including Geth, Besu, and Lighthouse, have built-in Prometheus endpoints. You enable this by adding flags like --metrics and --metrics.port to your startup command. For example, starting Geth with --metrics --metrics.addr 0.0.0.0 --metrics.port 6060 exposes a /metrics endpoint. You must then configure Prometheus to scrape this endpoint at regular intervals, storing time-series data like geth_chain_head_block and geth_p2p_peers.

Next, you define critical alerting rules in Prometheus to trigger notifications. These rules are written in PromQL and monitor thresholds that indicate problems. For a validator client, you might alert on increase(beacon_node_eth1_fallback_failed_total[5m]) > 0 to detect ETH1 connection issues. For an execution client, a rule like geth_chain_head_block - offset 1m geth_chain_head_block > 60 can warn of a block production halt. These alerts can be routed to channels like Slack, PagerDuty, or email via the Alertmanager service.

With data flowing into Prometheus, you build dashboards in Grafana. Effective panels for blockchain security include: a graph of peer count over time to spot isolation attacks, a gauge for sync status, a histogram of block propagation latency, and a log of proposed vs. missed blocks for validators. You should also monitor system resources like CPU, memory, and disk I/O, as resource exhaustion is a common attack vector. Importing community-built dashboards, like those from the Grafana Labs library, can accelerate setup.

For a comprehensive view, integrate logs using the Loki stack. While metrics show the "what," logs provide the "why." By feeding node log output (e.g., geth.log) into Loki and linking it with Grafana, you can correlate a spike in geth_p2p_peers_disconnect_total with specific log lines about bad peers or protocol violations. This unified logging and metrics approach is crucial for forensic analysis after an incident. Always ensure your dashboard is itself secure, placed behind authentication and, if public, using read-only data sources.

Finally, establish a review and iteration process. A dashboard is not a set-and-forget tool. As network upgrades occur (like a hard fork) or your node infrastructure changes, the relevant metrics will shift. Regularly test your alerting pipeline with controlled failures and update thresholds based on observed baselines. The goal is to move from reactive monitoring to predictive insights, where trends in metrics like growing mempool size or increasing orphaned blocks can signal broader network stress before it impacts your operations.

prerequisites
PREREQUISITES AND SETUP

Setting Up a Network Security Parameter Dashboard

This guide walks through the initial setup required to build a dashboard for monitoring critical on-chain security parameters across multiple networks.

Before building your dashboard, you need a foundational development environment. This includes installing Node.js (v18 or later) and a package manager like npm or yarn. You will also need a code editor such as VS Code. The core of the dashboard will interact with blockchain nodes, so you must have access to RPC endpoints for the networks you wish to monitor. For Ethereum mainnet, you can use a service like Alchemy or Infura, or run your own node with Geth or Erigon. For other EVM chains like Polygon or Arbitrum, similar RPC providers are available. Securely store your API keys using environment variables.

The dashboard's backend will require a framework to fetch and process blockchain data. We recommend using a Node.js framework like Express.js or Fastify to create API endpoints. You will need to install essential libraries: ethers.js v6 or viem for interacting with the Ethereum Virtual Machine, axios for HTTP requests to external APIs, and dotenv to manage environment variables. For data persistence and historical analysis, consider setting up a database. A time-series database like TimescaleDB (built on PostgreSQL) is ideal for storing metric data, while a simpler start can be made with SQLite or a document database like MongoDB.

Security parameter data is often scattered. You will need to identify and integrate data sources. For slashing events on Ethereum, you can query the Beacon Chain API directly or use a service like Beaconcha.in's API. Validator set information is available via the eth2 endpoints of your consensus layer client. For governance parameters (e.g., voting periods, quorum), you will need to interact with the specific smart contracts for each protocol, such as Compound's Governor Bravo or Uniswap's governance contract. Create a configuration file to map network names to their respective RPC URLs, contract addresses, and API endpoints.

With the environment ready, you can begin structuring the application. Create a project directory and initialize it with npm init. Install your chosen dependencies. Organize your code into logical modules: a config/ folder for network configurations, a services/ folder for data-fetching logic (e.g., slashingService.js, governanceService.js), and a routes/ folder for your API endpoints. Implement a scheduler, using node-cron or a similar library, to periodically fetch data—for example, every epoch for beacon chain data or every block for certain governance metrics—and store the results in your database.

Finally, you need a way to visualize the data. For the frontend, you can use a framework like React or Vue.js paired with a charting library such as Recharts or Chart.js. Your backend API will serve the aggregated data to these frontend components. Ensure you implement proper CORS policies on your backend to allow your frontend application to make requests. The initial dashboard view should display key metrics at a glance: current active validator count, recent slashing events, and the status of ongoing governance proposals. This setup provides the scaffold upon which you can add alerts, historical trends, and multi-chain comparisons.

key-concepts-text
DASHBOARD CONFIGURATION

Key Security Metrics to Monitor

A guide to selecting and visualizing the critical on-chain and off-chain data points that indicate the health and security of a blockchain network.

A network security dashboard transforms raw blockchain data into actionable intelligence. The first step is defining your data sources. For on-chain metrics, you need direct access to a node RPC endpoint (e.g., https://eth-mainnet.g.alchemy.com/v2/your_key) or a block explorer API like Etherscan. Off-chain data, such as social sentiment or governance forum activity, requires scraping tools or specialized APIs. Use a data pipeline—like The Graph for indexed historical data or a Pythia for real-time feeds—to aggregate and normalize this information before it hits your visualization layer.

Focus your dashboard on metrics that signal economic security and network health. Key on-chain indicators include: - Total Value Secured (TVS): The aggregate value of assets staked or locked in the network's consensus mechanism. - Validator Set Decentralization: Track the Gini coefficient or Nakamoto Coefficient of the validator/staker distribution. - Finality Time & Rate: The speed and reliability of block finalization. - Slashing Events: Frequency and severity of penalties for validator misbehavior, accessible via events like Slashed(address indexed validator, uint256 amount).

Operational security requires monitoring network performance and client diversity. Implement alerts for: - Peer Count & Block Propagation Time: A sudden drop in peers or spike in propagation time can indicate partitioning or eclipse attacks. - Client Version Distribution: Over-reliance on a single execution or consensus client (e.g., >66% Geth) is a critical centralization risk. - MemPool Saturation: High pending transaction volume can lead to network congestion and increased MEV extraction opportunities, which destabilizes user experience.

For smart contract networks, application-layer metrics are essential. Monitor: - Top Contract Gas Consumption: Identify contracts driving network load. - Flash Loan Volume & Success Rate: Sudden spikes can precede exploit attempts. - Protocol Treasury Balances & Outflows: Unusual large withdrawals from major DeFi treasuries. Tools like Tenderly or OpenZeppelin Defender can help track and alert on these. Correlate this with off-chain chatter from platforms like Twitter and Discord using sentiment analysis to detect early warning signs of coordinated action.

Visualize this data for clarity and rapid response. Use time-series graphs for metrics like TVS and finality rate. A heatmap is effective for displaying client diversity across different node operators. A leaderboard view can highlight the most active (or potentially malicious) smart contracts. Always include threshold-based alerting; for example, trigger a critical alert if the Nakamoto Coefficient falls below 4 or if slashing events exceed a 24-hour rolling average. Open-source tools like Grafana with blockchain-specific plugins (e.g., for Prometheus metrics from nodes) provide a solid foundation for building this dashboard.

Continuously refine your metrics. Security is adversarial; as new attack vectors like time-bandit attacks or balancing attacks are identified, your dashboard must evolve. Regularly review incident post-mortems from other networks and incorporate relevant learnings. The goal is not just to monitor the present state but to build a predictive model of network security, allowing operators to mitigate risks before they materialize into exploits or downtime.

DATA COLLECTION

Metric Sources and Collection Methods

Comparison of primary methods for sourcing and aggregating on-chain and off-chain security data.

Metric / Data PointRPC Node QueriesIndexer APIsBlock ExplorersCustom Subgraphs

Real-time Block Data

Historical State (Archive)

Event Logs

Smart Contract State

Gas Price & Base Fee

Validator/Sequencer Health

MEV-Boost Relay Data

Latency

< 100 ms

200-500 ms

1-2 sec

Varies by query

Setup & Maintenance Cost

$200-500/month

$0-50/month

$0

$50-200/month

architecture-data-pipeline
TUTORIAL

Architecture: Building the Data Pipeline

A practical guide to constructing a real-time data pipeline for monitoring on-chain security parameters.

A robust data pipeline is the foundation of any effective network security dashboard. It ingests raw blockchain data, processes it for specific metrics, and serves it to a frontend for visualization. For a security parameter dashboard, this means continuously tracking critical on-chain data points like validator uptime, slashing events, governance proposal participation, and total value secured (TVS). The architecture typically follows an ETL (Extract, Transform, Load) pattern, where data is extracted from node RPC endpoints or indexers, transformed into aggregated metrics, and loaded into a time-series database like TimescaleDB or InfluxDB for efficient querying.

The extraction layer is your connection to the blockchain. For reliability, you should implement a multi-RPC provider strategy using services like Chainstack, Alchemy, or Infura to avoid single points of failure. Use WebSocket subscriptions to listen for new blocks and specific events, such as ValidatorSlashEvent on Cosmos chains or LogValidatorJoined on EigenLayer. For historical data, batch queries via the provider's API are necessary. A common practice is to use a message broker like Apache Kafka or RabbitMQ to decouple the data ingestion from processing, ensuring the system can handle spikes in blockchain activity without data loss.

Transformation is where raw data becomes actionable intelligence. This occurs in a stream processing engine. For instance, using Apache Flink or a simple Node.js service with Redis for state, you can calculate rolling 24-hour validator signatures, track changes in a protocol's governance quorum, or compute the health score of a restaking pool. Code is essential here. For example, to calculate a validator's uptime from missed blocks:

javascript
// Pseudo-code for uptime calculation
const totalBlocksInWindow = 10000;
const missedBlocks = await queryMissedBlocks(validatorAddress, window);
const uptimePercentage = ((totalBlocksInWindow - missedBlocks) / totalBlocksInWindow) * 100;

These computed metrics are then structured and emitted for loading.

The load phase writes the transformed metrics to your chosen datastore. A time-series database is optimal for the temporal nature of this data. Define clear schemas; for example, a validator_metrics table with fields for timestamp, validator_address, uptime, voting_power, and slashing_events. Use the database's continuous aggregate features to pre-compute hourly or daily roll-ups for fast dashboard queries. Finally, expose this data through a dedicated GraphQL or REST API (built with frameworks like Express.js or FastAPI) that your dashboard frontend can consume. This completes the pipeline, turning raw chain data into a real-time security overview.

code-data-collection
CODE

Collecting Data from Nodes and Indexers

This guide explains how to programmatically gather security metrics from blockchain nodes and indexing services to build a real-time dashboard.

A network security parameter dashboard provides visibility into the health and integrity of a blockchain network. Core data points include peer count, block height synchronization, validator uptime, and gas price volatility. For Ethereum, you can query an Ethereum Execution Client like Geth or Erigon using the JSON-RPC API. Key endpoints are eth_syncing to check sync status and net_peerCount to monitor network connectivity. For Solana, the getClusterNodes RPC method returns a list of all visible validators and their status.

Indexers provide enriched, queryable data that is difficult to extract directly from nodes. For analyzing historical security events like reorgs or uncle rates, you can use The Graph's subgraphs or an indexed RPC provider like Alchemy or QuickNode. A practical example is querying a subgraph to track the average block time over the last 100 blocks, which can signal network congestion. Using the GraphQL endpoint, you can run a query to fetch blocks(orderBy: timestamp, orderDirection: desc, first: 100) { timestamp } and calculate the interval.

To build a robust data collection service, implement a Node.js or Python script that polls these sources on a schedule. Use the web3.js or ethers.js library for Ethereum RPC calls. Always implement error handling for rate limits and node unavailability, and consider using a fallback provider configuration. Store the collected metrics in a time-series database like InfluxDB or TimescaleDB, which are optimized for dashboarding. This creates a historical record for trend analysis.

Here is a basic Python example using Web3.py to collect two key metrics from an Ethereum node:

python
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('YOUR_RPC_URL'))

is_syncing = w3.eth.syncing
peer_count = w3.net.peer_count

print(f"Syncing: {is_syncing}")
print(f"Active peers: {peer_count}")

This script should be extended to log these values and handle exceptions if the node is unreachable.

For dashboard visualization, connect your database to a tool like Grafana. Create panels to display metrics such as Peer Count Over Time, Block Propagation Latency, and Missed Slot Count (for proof-of-stake chains). Setting alerts on these panels is crucial; for instance, trigger a notification if peer count drops below 10 or if the node falls more than 50 blocks behind the chain tip. This transforms raw data into an actionable security monitoring system.

Continuously expand your data sources. Incorporate MEV-Boost relay metrics for post-Merge Ethereum to monitor censorship risks, or query Oracles like Chainlink for real-world data reliability. The goal is to create a composite view of network health. By automating the collection of node and indexer data, you build a foundational tool for protocol research, infrastructure management, and proactive security response.

code-alerting-system
TUTORIAL

Implementing Threshold-Based Alerting

A guide to building a dashboard that monitors critical on-chain metrics and triggers alerts when they exceed predefined safety thresholds.

Threshold-based alerting is a proactive security mechanism for blockchain networks. It involves defining acceptable ranges for key network parameters—such as gas price, validator set changes, or smart contract balances—and automatically notifying operators when these values breach their limits. This approach transforms raw on-chain data into actionable intelligence, enabling teams to respond to potential threats like front-running, governance attacks, or liquidity drains before they escalate. Unlike passive monitoring, threshold alerts are event-driven, reducing noise and focusing attention on genuine anomalies.

The first step is selecting and sourcing your metrics. Critical parameters vary by network but often include: avg_gas_price for congestion, active_validators for consensus health, total_value_locked in core contracts, and failed_transaction_rate. Data can be pulled directly from an RPC node, indexed via The Graph, or sourced from providers like Chainscore's API which offers pre-aggregated metrics. For example, to monitor a DeFi protocol's treasury, you would track the balance of its multi-sig wallet address. Establish a baseline for each metric by analyzing historical data to set realistic, data-informed thresholds.

Implementation typically involves a script or service that polls data at regular intervals. Here's a conceptual Node.js example using ethers.js to check a contract balance:

javascript
const balance = await provider.getBalance(treasuryAddress);
const threshold = ethers.utils.parseEther('1000');
if (balance.lt(threshold)) {
  await sendAlert('Treasury balance below 1000 ETH');
}

For production, use a scheduler like cron or a serverless function. The logic should include debouncing to prevent alert spam from temporary fluctuations and severity levels (e.g., WARNING for 80% threshold, CRITICAL for 95%).

Integrate alerts with your team's workflow. Use notification channels like Slack, Discord webhooks, PagerDuty, or email. For critical infrastructure, consider escalating alerts that go unacknowledged. Tools like Prometheus with Alertmanager or Grafana Alerts can manage this pipeline if you're already using them for dashboards. The key is to ensure the right person gets the right information with enough context—include the metric value, the threshold, the contract address, and a link to a block explorer in the alert message for immediate investigation.

Continuously refine your thresholds and alert rules. A threshold that triggers too often will cause alert fatigue, while one that's too lenient defeats its purpose. Review alert history monthly: adjust thresholds based on network upgrades, seasonal usage patterns, or protocol changes. Implement a staging environment to test new alert rules against historical data before deploying them to production. Effective threshold-based alerting is not a set-and-forget system; it's a dynamic component of your security posture that evolves with your protocol and the broader blockchain ecosystem.

visualization-dashboard-build
TUTORIAL

Visualization: Building the Dashboard Frontend

A step-by-step guide to creating a React-based dashboard for monitoring real-time network security parameters using D3.js and WebSocket data.

This guide details the frontend implementation for a network security parameter dashboard. We'll use React for the component structure and state management, D3.js for dynamic data visualizations, and a WebSocket client to stream live data from a backend API. The dashboard will display key metrics like block finality time, validator health, and gas price volatility. We'll structure the project with a clear separation between data-fetching logic, visualization components, and the main layout.

Start by initializing a new React project using Vite for faster builds: npm create vite@latest security-dashboard -- --template react. Install the necessary dependencies: npm install d3 axios recharts ws for charting and data handling. The core application state will be managed with React's useState and useEffect hooks. Create a services/ directory for the WebSocket connection logic, establishing a persistent link to your Node API endpoint to receive real-time metric updates.

For the visualization layer, we'll build reusable chart components. A TimeSeriesChart component will use D3.js to render a line graph for metrics like average block time, mapping timestamps to values. A GaugeChart component can display current values like network load percentage. Use Recharts for simpler bar charts showing validator set distribution. Each component should accept a data prop and be responsible for its own responsive scaling and axis rendering using D3's scaleLinear and scaleTime functions.

The main App.jsx component orchestrates the layout. Use a CSS grid or flexbox to arrange the charts into a dashboard. Implement a MetricsContext or Zustand store to share the live WebSocket data across all visualizations without prop drilling. Critical UI elements include a connection status indicator, a timestamp of the last update, and threshold alerts that change a chart's border color if a value (e.g., uncle rate) exceeds a safe limit defined in your configuration.

Finally, ensure the application is robust. Add error boundaries around chart components to handle malformed data. Implement automatic reconnection logic for the WebSocket client. For production, consider adding data aggregation for historical views and export functionality. The complete code for this tutorial is available in the Chainscore Labs GitHub repository, which includes the full React app and sample backend data server.

MONITORING GUIDELINES

Recommended Alert Thresholds by Network Metric

Suggested trigger values for security and performance alerts on Ethereum mainnet and L2s. Adjust based on your risk tolerance and network conditions.

MetricWarning ThresholdCritical ThresholdData Source

Block Production Delay

12 seconds

30 seconds

Node / RPC

Uncle Rate

8%

15%

Etherscan / Block Explorer

Gas Price (Gwei)

150 Gwei

250 Gwei

Gas Oracle API

Pending Transaction Pool Size

15,000

50,000

Node (txpool_content)

Peer Count

< 25

< 10

Node Admin API

Sync Status

Lag > 5 blocks

Lag > 50 blocks

Node (eth_syncing)

RPC Error Rate (5xx)

1%

5%

Application Logs / Load Balancer

MEV-Boost Relay Participation

< 90%

< 75%

MEV-Boost Client Metrics

NETWORK SECURITY DASHBOARD

Frequently Asked Questions

Common questions and troubleshooting steps for developers setting up a real-time dashboard to monitor blockchain network security parameters.

A comprehensive security dashboard should track both consensus-level and network-level metrics. Core parameters include:

  • Validator Set Health: Active vs. inactive validators, voting power distribution, and slashing events.
  • Finality Metrics: Time to finality, missed blocks, and chain reorganizations (reorgs).
  • Governance Proposals: Active and upcoming proposals, voting participation, and quorum status.
  • Network Gas/Throughput: Average gas price, pending transactions, and block size/utilization.
  • Economic Security: Total value staked (TVS), inflation rate, and validator rewards/commissions.

For example, on an Ethereum beacon chain, you'd monitor the attestation effectiveness rate and participation rate. On Cosmos-based chains, track the signing infraction rate and validator jail status. These metrics provide early warnings for centralization risks, liveness failures, or economic attacks.

conclusion-next-steps
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

Your network security parameter dashboard is now operational, providing a real-time view of your blockchain node's health and security posture.

This guide walked you through building a dashboard to monitor critical security parameters: peer count, block synchronization status, and consensus participation. By implementing the provided scripts with curl and jq, you can now track these metrics in real-time. The core principle is to regularly poll your node's RPC endpoints—like eth_syncing and net_peerCount—and visualize the data. This setup is protocol-agnostic; the same methodology applies to Geth, Erigon, Besu, or any EVM-compatible client with a standard JSON-RPC interface.

To enhance your dashboard, consider integrating additional metrics. Key areas to monitor include memory and CPU usage to prevent resource exhaustion, disk I/O latency for storage performance, and validator effectiveness metrics (e.g., attestation participation, proposal success) if running a consensus client. For Ethereum nodes, track the eth_gasPrice to understand network congestion. Implementing alerting is the logical next step; use tools like Prometheus Alertmanager or Grafana Alerts to trigger notifications when peer count drops below a threshold (e.g., < 10) or the node falls out of sync.

For production deployment, containerize your monitoring stack using Docker Compose to manage Prometheus, Grafana, and your collection scripts. Secure your RPC endpoint with authentication (e.g., --http.api admin,eth,net --authrpc.jwtsecret) and consider using a reverse proxy like nginx with basic auth for Grafana. Regularly update your dashboard queries to reflect protocol upgrades, such as new endpoints introduced in Ethereum's Dencun or subsequent hard forks. Your final, actionable checklist should include: automating script execution with systemd or cron, backing up Grafana dashboards, and establishing a routine review process for alert thresholds based on network conditions.