Skip to content

cmd0s/arkmon

Repository files navigation

ArkMon - Arkiv Network Monitor

Real-time monitoring dashboard for Arkiv Web3 database network.

Features

  • Service Monitoring: Portal, HTTP RPC, WebSocket RPC, Faucet, Bridge, Block Explorer
  • RPC Performance Tests: Write small (<1KB), write large (~100KB), read operations
  • Historical Data: SQLite database for storing metrics history
  • Multi-testnet Support: Parameterized for mendoza, rosario, and other testnets
  • Modern Dark UI: Built with Next.js, Tailwind CSS, shadcn/ui, and Recharts
  • Real-time Updates: Automatic refresh with SWR
  • Clickable Service Cards: Direct links to monitored services

Quick Start

Prerequisites

  • Node.js 22+
  • npm

Installation

npm install

Configuration

Copy the example environment file and configure:

cp .env.example .env

Edit .env with your settings:

# Wallet for RPC tests
MONITOR_WALLET_ADDRESS=0xYourWalletAddress
MONITOR_PRIVATE_KEY=0xYourPrivateKey

# Database
DATABASE_PATH=./data/arkmon.db

# Monitoring
MONITOR_INTERVAL_MS=60000
ENABLED_TESTNETS=mendoza

Development

Run the dashboard and monitoring worker together:

npm run dev:all

Or run them separately:

# Dashboard only
npm run dev

# Worker only (in another terminal)
npm run worker

Open http://localhost:3000 to view the dashboard.

Production Build

npm run build
npm run start

Docker Deployment

Build and run with Docker Compose

docker compose up -d

Environment Variables for Docker

Set these in your deployment platform (Coolify, Dokploy, etc.):

  • MONITOR_WALLET_ADDRESS - Wallet address for RPC tests
  • MONITOR_PRIVATE_KEY - Private key for signing transactions
  • ENABLED_TESTNETS - Comma-separated list of testnets (default: mendoza)
  • MONITOR_INTERVAL_MS - Monitoring interval in ms (default: 60000)

Volume Mount for Data Persistence

The SQLite database is stored in /app/data. To persist data:

Docker Compose (already configured):

volumes:
  - arkmon_data:/app/data

Coolify: Use "Volume Mount" with:

  • Volume Name: arkmon-data
  • Mount Path: /app/data

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        Next.js App                          │
├─────────────────────────────────────────────────────────────┤
│  Frontend (React)           │  API Routes                   │
│  ├── Dashboard page         │  ├── GET /api/metrics         │
│  ├── Service cards          │  ├── GET /api/services        │
│  ├── Charts (Recharts)      │  ├── GET /api/rpc-tests       │
│  └── Real-time updates      │  └── GET /api/testnets        │
├─────────────────────────────────────────────────────────────┤
│                    Background Worker                        │
│  ├── Runs at configurable interval                          │
│  ├── Tests all services (Portal, RPC, WS, Faucet, etc.)     │
│  ├── Writes metrics to SQLite                               │
│  └── Logs results                                           │
├─────────────────────────────────────────────────────────────┤
│                    SQLite Database                          │
│  ├── metrics (timestamp, testnet, service, latency, status) │
│  └── rpc_tests (timestamp, testnet, operation, duration)    │
└─────────────────────────────────────────────────────────────┘

Monitored Services

Service Description
Portal Main network portal page
HTTP RPC JSON-RPC endpoint
WebSocket RPC WebSocket endpoint
Faucet Test token faucet
Bridge Cross-chain bridge
Block Explorer Blockchain explorer

API Endpoints

  • GET /api/testnets - List of available testnets
  • GET /api/services?testnet=mendoza - Current service status
  • GET /api/metrics?testnet=mendoza&hours=24 - Historical metrics
  • GET /api/rpc-tests?testnet=mendoza&hours=24 - RPC test history

Adding New Testnets

Edit src/config/testnets.ts:

export const TESTNETS = {
  mendoza: {
    id: "mendoza",
    name: "Mendoza Testnet",
    chainId: 60138453056,
    rpcUrl: "https://mendoza.hoodi.arkiv.network/rpc",
    wsUrl: "wss://mendoza.hoodi.arkiv.network/rpc/ws",
    portalUrl: "https://mendoza.hoodi.arkiv.network",
    faucetUrl: "https://mendoza.hoodi.arkiv.network/faucet/",
    bridgeUrl: "https://mendoza.hoodi.arkiv.network/bridgette/",
    explorerUrl: "https://explorer.mendoza.hoodi.arkiv.network",
  },
  // Add new testnet here
};

Then update ENABLED_TESTNETS in your .env file.

Tech Stack

  • Framework: Next.js 15 (App Router)
  • UI: Tailwind CSS + shadcn/ui
  • Charts: Recharts
  • Database: SQLite + Drizzle ORM
  • Real-time: SWR
  • Deployment: Docker

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published