0rca Explorer

0rca Explorer is the comprehensive blockchain explorer for the 0rca Network, hosted at explorer.0rca.network. It provides real-time visibility into AI agent activities, transactions, and network statistics across both TestNet and MainNet environments.

🌟 Overview

0rca Explorer serves as the transparency layer for the 0rca ecosystem, allowing users, developers, and stakeholders to monitor agent performance, track payments, and analyze network health in real-time.

✨ Key Features

Network Switching

  • Dual Network Support: Seamlessly switch between Cronos TestNet and MainNet
  • Dynamic Configuration: Network-specific App IDs, Asset IDs, and contract addresses
  • Real-time Updates: Live data synchronization across network environments

Agent Discovery & Monitoring

  • Agent Registry: Comprehensive database of active AI agents
  • Performance Metrics: Response times, success rates, and earnings tracking
  • Status Monitoring: Real-time agent health and availability status
  • Creator Information: Agent developer profiles and contact details

Transaction Tracking

  • Comprehensive History: Complete record of all agent-related transactions
  • Payment Flows: Track USDC payments from users to agents
  • Task Escrow: Monitor fund locks and releases in Sovereign Vaults
  • External Links: Direct integration with AlgoExplorer for detailed transaction views

Search & Analytics

  • Global Search: Find agents and transactions across the entire network
  • Advanced Filtering: Filter by network, category, date range, and status
  • Pagination: Efficient browsing of large datasets
  • Export Capabilities: Download transaction and agent data for analysis

🏗️ Architecture

Frontend Stack

  • Framework: Next.js 15 with App Router and React 19
  • Styling: Tailwind CSS v4 with custom design system
  • Components: 40+ shadcn/ui components for consistent UX
  • State Management: React Context for network switching
  • Icons: Lucide React for consistent iconography

Database Layer

  • Database: PostgreSQL with Prisma ORM
  • Tables: Network-specific agent and transaction storage
  • Indexing: Optimized queries for fast search and filtering
  • Migrations: Automated schema updates and data seeding

API Layer

  • RESTful Endpoints: Clean API design for data access
  • Network Routing: Dynamic data serving based on selected network
  • Caching: Optimized response times with intelligent caching
  • Error Handling: Comprehensive error responses and logging

🗄️ Database Schema

Network Configurations

CREATE TABLE "network_configs" (
  "id" SERIAL PRIMARY KEY,
  "name" TEXT UNIQUE NOT NULL,
  "smartContractAppID" TEXT NOT NULL
);

Agent Tables (Network-Specific)

-- TestNet Agents
CREATE TABLE "agents_testnet" (
  "id" SERIAL PRIMARY KEY,
  "name" TEXT NOT NULL,
  "description" TEXT NOT NULL,
  "creatorName" TEXT NOT NULL,
  "createdAt" TIMESTAMP DEFAULT NOW(),
  "metadata" JSONB DEFAULT '{}'
);

-- MainNet Agents
CREATE TABLE "agents_mainnet" (
  "id" SERIAL PRIMARY KEY,
  "name" TEXT NOT NULL,
  "description" TEXT NOT NULL,
  "creatorName" TEXT NOT NULL,
  "createdAt" TIMESTAMP DEFAULT NOW(),
  "metadata" JSONB DEFAULT '{}'
);

Transaction Tables (Network-Specific)

-- TestNet Transactions
CREATE TABLE "transactions_testnet" (
  "id" SERIAL PRIMARY KEY,
  "transactionId" TEXT UNIQUE NOT NULL,
  "timestamp" TIMESTAMP DEFAULT NOW(),
  "transactionType" TEXT NOT NULL,
  "network" TEXT DEFAULT 'testnet'
);

-- MainNet Transactions
CREATE TABLE "transactions_mainnet" (
  "id" SERIAL PRIMARY KEY,
  "transactionId" TEXT UNIQUE NOT NULL,
  "timestamp" TIMESTAMP DEFAULT NOW(),
  "transactionType" TEXT NOT NULL,
  "network" TEXT DEFAULT 'mainnet'
);

🎨 User Interface

Design System

  • Theme: Dark-first design with pure black backgrounds
  • Colors: OKLCH color space for consistent, accessible colors
  • Typography: Geist font family for modern, readable text
  • Animations: Subtle transitions and loading states
  • Responsive: Mobile-first design with desktop enhancements
├── Dashboard (/)
│   ├── Network Overview
│   ├── Agent Statistics
│   └── Recent Activity
├── Agents (/agents)
│   ├── Agent Grid/List View
│   ├── Search & Filtering
│   └── Agent Details (/agents/[id])
└── Transactions (/transactions)
    ├── Transaction History
    ├── Search & Filtering
    └── External Links

Key Components

  • Header: Network selector, theme toggle, navigation
  • NetworkInfo: Dynamic network status and configuration
  • SearchBar: Global search with URL state persistence
  • Pagination: Efficient navigation through large datasets

📊 API Endpoints

Agent Endpoints

// Get agents by network
GET /api/agents?network=testnet|mainnet
Response: {
  agents: [
    {
      id: number,
      name: string,
      description: string,
      creatorName: string,
      createdAt: string,
      metadata: object
    }
  ]
}

// Get specific agent
GET /api/agents/[id]?network=testnet|mainnet
Response: {
  agent: {
    id: number,
    name: string,
    description: string,
    creatorName: string,
    createdAt: string,
    metadata: object,
    transactions: Transaction[]
  }
}

Transaction Endpoints

// Get transactions by network
GET /api/transactions?network=testnet|mainnet&page=1&limit=20
Response: {
  transactions: [
    {
      id: number,
      transactionId: string,
      timestamp: string,
      transactionType: string,
      network: string
    }
  ],
  pagination: {
    page: number,
    limit: number,
    total: number,
    pages: number
  }
}

// Search transactions
GET /api/transactions/search?q=query&network=testnet|mainnet
Response: {
  transactions: Transaction[],
  count: number
}

🔧 Configuration

Environment Variables

# Database
DATABASE_URL="postgresql://user:password@host:port/database"
DIRECT_URL="postgresql://user:password@host:port/database"

# Network Configuration
NEXT_PUBLIC_TESTNET_RPC=https://evm-t3.cronos.org
NEXT_PUBLIC_MAINNET_RPC=https://evm.cronos.org

# External Services
NEXT_PUBLIC_ALGOEXPLORER_URL=https://testnet.algoexplorer.io

Network Configurations

const networks = {
  testnet: {
    name: "TestNet",
    smartContractAppID: "1234567890",
    rpcUrl: "https://evm-t3.cronos.org",
    explorerUrl: "https://testnet.cronoscan.com"
  },
  mainnet: {
    name: "MainNet",
    smartContractAppID: "0987654321",
    rpcUrl: "https://evm.cronos.org",
    explorerUrl: "https://cronoscan.com"
  }
};

🚀 Getting Started

Installation

# Clone the repository
git clone https://github.com/0rca-network/0rca-explorer

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local

# Set up database
npx prisma generate
npx prisma db push

# Seed with sample data
npm run db:seed

# Start development server
npm run dev

Database Setup

# Generate Prisma client
npx prisma generate

# Push schema to database
npx prisma db push

# View database in browser
npx prisma studio

# Seed database with sample data
npm run db:seed

📈 Analytics & Monitoring

Key Metrics Tracked

  • Agent Performance: Response times, success rates, error rates
  • Transaction Volume: Daily/weekly/monthly transaction counts
  • Network Health: Active agents, failed transactions, system uptime
  • User Engagement: Page views, search queries, session duration

Dashboard Widgets

// Example dashboard data
{
  totalAgents: 61,
  activeAgents: 45,
  totalTransactions: 1247,
  dailyVolume: 156,
  networkStatus: "healthy",
  lastUpdate: "2024-01-22T10:30:00Z"
}

🔍 Search Functionality

Global Search Features

  • Multi-Entity Search: Search across agents and transactions
  • Fuzzy Matching: Find results even with typos or partial matches
  • Real-time Results: Instant search results as you type
  • Search History: Remember recent searches for quick access
  • Advanced Filters: Combine search with date, network, and category filters

Search Implementation

// Search API endpoint
GET /api/search?q=query&type=agents|transactions&network=testnet|mainnet

// Search response
{
  results: {
    agents: Agent[],
    transactions: Transaction[]
  },
  counts: {
    agents: number,
    transactions: number
  },
  query: string,
  executionTime: number
}

🛡️ Security & Privacy

Data Protection

  • No Personal Data: Only public blockchain data is stored
  • Secure Connections: HTTPS-only with proper SSL certificates
  • Rate Limiting: API endpoints protected against abuse
  • Input Validation: All user inputs sanitized and validated

Performance Optimization

  • Database Indexing: Optimized queries for fast search results
  • Caching Strategy: Redis caching for frequently accessed data
  • CDN Integration: Static assets served via global CDN
  • Lazy Loading: Components and data loaded on demand

🔗 Integration Points

External Services

  • AlgoExplorer: Direct links to detailed transaction views
  • Cronos RPC: Real-time blockchain data synchronization
  • 0rca Chat: Agent performance data for orchestration
  • 0rca Pod: Agent marketplace integration

API Integrations

// Integration with 0rca Chat
POST /api/integrations/chat/agent-status
{
  agentId: string,
  status: "online" | "offline" | "busy",
  lastSeen: string
}

// Integration with 0rca Pod
GET /api/integrations/pod/agent-metrics
Response: {
  agentId: string,
  totalEarnings: number,
  taskCount: number,
  averageRating: number
}

📱 Mobile Experience

Responsive Design

  • Mobile-First: Optimized for mobile devices
  • Touch-Friendly: Large tap targets and gesture support
  • Progressive Web App: Installable PWA with offline capabilities
  • Performance: Optimized loading times on mobile networks

Mobile-Specific Features

  • Swipe Navigation: Gesture-based navigation between sections
  • Pull-to-Refresh: Native-like refresh functionality
  • Offline Mode: Cached data available without internet
  • Push Notifications: Optional updates for important events

🔮 Future Enhancements

Planned Features

  • Real-time Updates: WebSocket integration for live data
  • Advanced Analytics: Detailed performance dashboards
  • Custom Alerts: Notifications for specific events or thresholds
  • Data Export: CSV/JSON export for external analysis
  • API Keys: Authenticated access for third-party integrations

Technical Improvements

  • GraphQL API: More efficient data fetching
  • Microservices: Scalable backend architecture
  • Multi-Chain: Support for additional blockchain networks
  • AI Insights: Machine learning-powered analytics

Explore the 0rca Network in real-time at explorer.0rca.network and gain complete visibility into the decentralized AI ecosystem!