Skip to content

Indexing server for status.orcfax.io

License

Notifications You must be signed in to change notification settings

orcfax/status-index

Repository files navigation

Status Index

The Orcfax Status Index is a Node.js server that monitors and tracks Orcfax validator licenses, FACT token holdings, and system notifications for the Orcfax network. It provides automated tracking of license transfers, FACT token balances, and system status updates through various data sources.

It serves as the backend for the Orcfax Status Dashboard and the Orcfax RSS Feed.

Features

Validator License Tracking

  • Monitors Orcfax validator license transfers on the Cardano blockchain
  • Tracks license holder information and wallet addresses
  • Maintains historical records of license ownership
  • Monitors NFT marketplace listings for licenses

FACT Token Monitoring

  • Tracks FACT token holdings for license holders
  • Calculates average FACT holdings during the ITN snapshot period
  • Monitors minimum FACT holding requirements
  • Updates holder multiplier statuses

System Notifications + RSS Feed

  • Monitors and syncs incident reports and network updates from GitHub
  • Monitors and syncs blog posts from Medium
  • Maintains and indexes an RSS Feed for the Orcfax Status Dashboard

ITN Snapshot System

  • Captures daily snapshots of FACT holdings during the ITN period
  • Ran from April 22, 2024, to December 1, 2024
  • Calculates cumulative averages for multiplier qualifications

Architecture

The application is built using:

  • TypeScript
  • Node.js
  • Express.js
  • PocketBase (database)
  • Docker
  • Blockfrost API (Cardano blockchain data)
  • GitHub API (incident reports and network updates)
  • Medium RSS Feed (blog posts)

Local Development

  1. Clone this repository
  2. Get a local version of PocketBase running on your machine by following the docs
  3. Create necessary base collections in pocketbase (to be included in repo soon)
  4. Create an .env file in the root of the project based on the .env.example file
  5. Add the following environment variables to your .env:
    NODE_ENV=development
    DB_HOST=http://127.0.0.1:8090
    DB_EMAIL=your_admin_email
    DB_PASSWORD=your_admin_password
    FACT_TOKEN_HEX=your_fact_token_hex
    LICENSE_NFT_POLICY_ID=your_license_policy_id
    BLOCKFROST_WEBHOOK_AUTH_TOKEN=your_blockfrost_webhook_token
    BLOCKFROST_PROJECT_ID=your_blockfrost_project_id
    DISCORD_WEBHOOK_URL=your_discord_webhook_url
    INCIDENT_REPORTS_REPO_URL=your_github_repo_url
    MEDIUM_RSS_FEED_URL=your_medium_rss_feed_url
    
  6. Run docker-compose up --build to build the Docker image and start the development container

Cron Jobs

The application runs several automated tasks:

  1. Validator Sync

    • Updates license holder information
    • Processes any license transfers
    • Updates FACT holdings
  2. RSS Sync

    • Checks for new incident reports
    • Checks for new network updates
    • Checks for new blog posts
    • Updates notification statuses
  3. ITN Snapshot

    • Captures FACT holdings for all license holders
    • Updates multiplier qualifications
    • Calculates cumulative averages

API Endpoints

License Transfer Webhook

  • POST /api/license
  • Receives Blockfrost webhook events for license transfers
  • Authenticates using Blockfrost signature
  • Processes license transfers and updates holder information

Error Handling and Logging

The application includes comprehensive error handling and logging:

  • Winston logger for structured logging
  • Discord webhook integration for production error notifications
  • Detailed error tracking and reporting
  • Rate limiting and retry mechanisms for external APIs

Docker Support

The repository includes both production and development Docker configurations:

  • Dockerfile - Production build
  • Dockerfile.dev - Development build with hot-reloading
  • docker-compose.yml - Local development setup

License

This project is licensed under the Apache License 2.0 - see the LICENSE.txt file for details.