Skip to main content

Overview

Chain management covers monitoring and exploring your Pylon appchain through its RPC endpoint. Since Pylon manages the infrastructure, this guide focuses on setting up a block explorer and basic monitoring tasks you can perform using standard Ethereum RPC methods. For infrastructure issues (block production problems, cross-chain failures, etc.), contact Pylon support. This guide covers application-level monitoring and exploration.

Block Explorer Setup

BlockScout is an open-source blockchain explorer that provides detailed transaction views, contract verification, and chain analytics. It enables exploring and monitoring appchain transactions through a web interface.

Quick Start with Docker Compose

BlockScout consists of a backend API and a frontend web application. Before creating the docker-compose file, generate a secret key:
openssl rand -hex 64
Save this value to use in the SECRET_KEY_BASE environment variable. Then create a docker-compose.yml file:
version: '3.8'

services:
  blockscout-backend:
    image: blockscout/blockscout:latest
    command: sh -c "/app/bin/blockscout eval \"Elixir.Explorer.ReleaseTasks.create_and_migrate()\" && /app/bin/blockscout start"
    ports:
      - "4000:4000"
    environment:
      - ETHEREUM_JSONRPC_HTTP_URL=https://pylon.base-sepolia.spire.dev/v1/chain/2137/rpc
      - ETHEREUM_JSONRPC_WS_URL=wss://pylon.base-sepolia.spire.dev/v1/chain/2137/ws
      - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/blockscout
      - SECRET_KEY_BASE=GENERATE_A_SECRET_KEY_HERE
      - ECTO_USE_SSL=false
      - COIN=ETH
      - NETWORK=Your Appchain Name
      - SUBNETWORK=Your Appchain Name
      - SHOW_MAINTENANCE_ALERT=false
      - DISABLE_EXCHANGE_RATES=true
      - INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=true
      - INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=true
      - INDEXER_DISABLE_BLOCK_REWARD_FETCHER=true
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started
    volumes:
      - ./blockscout-data:/var/app/priv/static/images

  blockscout-frontend:
    image: ghcr.io/blockscout/frontend:latest
    platform: linux/amd64
    ports:
      - "8080:3000"
    environment:
      - NEXT_PUBLIC_API_PROTOCOL=http
      - NEXT_PUBLIC_API_HOST=localhost
      - NEXT_PUBLIC_API_PORT=4000
      - NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws
      - NEXT_PUBLIC_APP_HOST=http://localhost:8080
      - NEXT_PUBLIC_NETWORK_NAME=Your Appchain Name
      - NEXT_PUBLIC_NETWORK_ID=YOUR_CHAIN_ID
    depends_on:
      - blockscout-backend

  postgres:
    image: postgres:15
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=blockscout
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    volumes:
      - redis-data:/var/lib/redis/data

volumes:
  postgres-data:
  redis-data:
Important Configuration Notes:
  • RPC URL: Set ETHEREUM_JSONRPC_HTTP_URL to your Pylon RPC endpoint (e.g., https://pylon.base-sepolia.spire.dev/v1/chain/2137/rpc)
  • Chain Name: Update NETWORK, SUBNETWORK, and NEXT_PUBLIC_NETWORK_NAME with your appchain name
  • Chain ID: Set NEXT_PUBLIC_NETWORK_ID to your appchain’s Chain ID (found in your Chain Setup details)
  • App Host: If accessing remotely, update NEXT_PUBLIC_APP_HOST to your server’s address (e.g., http://your-domain.com:8080)
  • Secret Key: Replace GENERATE_A_SECRET_KEY_HERE with the secret key generated above

Running BlockScout

docker-compose up -d
Access BlockScout at http://localhost:8080. The frontend connects to the backend API at http://localhost:4000. The first sync may take several minutes depending on chain size. Note: BlockScout indexes from the latest block backward, so new transactions appear immediately even while historical blocks are still syncing. The indexing progress banner shows historical sync status, but the latest blocks shown are always current. For production deployments, see the BlockScout documentation for detailed setup instructions including HTTPS configuration, database backups, and monitoring.

Basic Monitoring

Use standard Ethereum RPC methods to monitor your appchain’s health and activity. The Pylon RPC endpoint supports all standard Ethereum JSON-RPC methods.

Check Block Production

Verify blocks are being produced:
cast block-number --rpc-url YOUR_RPC_URL

Inspect Transactions

View transaction details:
cast tx TX_HASH --rpc-url YOUR_RPC_URL

Query Contract Events

Query event logs from contracts:
cast logs --from-block 0 --to-block latest \
    --address CONTRACT_ADDRESS \
    --rpc-url YOUR_RPC_URL

View Transaction Receipts

Get transaction receipts to see logs and events:
cast receipt TX_HASH --rpc-url YOUR_RPC_URL
For infrastructure issues (blocks not producing, cross-chain failures, etc.), contact Pylon support.

Next Steps