Skip to main content

Explorer

After building a Verse, you have to create a Verse explorer. Please use blockscout to create a Verse explorer.

Prerequisites

Before setting up the Blockscout explorer, you need to configure your Verse node to support the required JSON-RPC namespaces.

Security Concern Regarding JSON-RPC Namespaces

The Blockscout explorer requires access to the txpool and debug namespaces. However, these namespaces pose security risks that need to be carefully considered:

  • debug namespace: Contains dangerous commands like setHead(blockNum) that can roll back the block head to a past state. Never expose this namespace directly to the public.
  • txpool namespace: While less risky than debug, it's still recommended to restrict public access as the explorer already provides similar capabilities through its interface.

To mitigate these risks, consider the following approaches:

  1. Use verse-proxy to control access to these namespaces. See: Set allowed verse request methods
  2. Set up a read-only replica Verse for the explorer, while keeping the write node's RPC endpoint (with restricted namespaces) for public access.

Configure Verse Node (For Verse v0)

If you are using L2Geth, enable the required namespaces in your node configuration:

# In the case of starting options
geth \
... \
--http.api=eth,web3,net,shh,rollup,txpool,debug \
--ws.api=eth,web3,net,shh,rollup,txpool,debug \
...

# In the case of environment variables
RPC_API=eth,web3,net,shh,rollup,txpool,debug
WS_API=eth,web3,net,shh,rollup,txpool,debug

Configure Verse Node (For Verse v1)

If you are using op-geth, follow these steps to enable the required namespaces:

  1. Locate the Startup Script or Configuration:

    • Find the script or configuration file used to start your op-geth node.
  2. Enable Required JSON-RPC Namespaces:

    op-geth --networkid <your_network_id> \
    ... \
    --http.api "eth,net,web3,txpool,debug" \
    --ws.api "eth,net,web3,txpool,debug" \
    ...

    Or using environment variables:

    ETH_HTTP_API="eth,net,web3,txpool,debug"
    ETH_WS_API="eth,net,web3,txpool,debug"
  3. Restart and Verify:

    • Restart your op-geth node to apply the settings
    • Check the logs to confirm the namespaces are available

Common Backend Environment Variables

Both BlockScout v6 and v7 share the following environment variables that need to be configured:

For more details, see Blockscout Backend Environment Variables.

VariableDescriptionValue
DATABASE_URLPostgres Database endpointpostgresql://postgres:@host.docker.internal:7432/blockscout?ssl=falset
ETHEREUM_JSONRPC_VARIANTRPC Client typegeth
ETHEREUM_JSONRPC_HTTP_URLRPC endpoint for main operationsrpc.myverse.com
ETHEREUM_JSONRPC_TRACE_URLRPC endpoint for tracing operationsrpc.myverse.com
SECRET_KEY_BASERandom string for contract verificationGenerate using: head -c 64 /dev/urandom | base64 | cut -c 1-64
JSON_RPCRPC endpoint for MetaMask integrationrpc.myverse.com
CHAIN_IDChain ID for MetaMask integrationYour Verse ChainID
RE_CAPTCHA_SECRET_KEYreCAPTCHA secret keyYour secret key
RE_CAPTCHA_CLIENT_KEYreCAPTCHA client keyYour client key

Note: If running on the same server, use http://host.docker.internal:8545/ for RPC URLs.

Blockscout v6

Setup Blockscout

Backend Setup

  1. Clone Repository:

    git clone https://github.com/oasysgames/blockscout-v6-backend.git
    cd blockscout-v6-backend
  2. Checkout Specific Version: Check available versions at blockscout-v6-backend releases and checkout the desired version:

    # Example: checking out the latest stable version
    git checkout <version-tag>
  3. Configure Environment Variables and Start: Set the following variables in common-blockscout.env:

    cd docker-compose/envs/
    vim common-blockscout.env
    docker compose build
    docker compose up -d

    Refer to the Common Backend Environment Variables section above for the required configuration.

  4. Run Backend Container:

    sudo FRONT_PROXY_PASS=http://host.docker.internal:3000 docker compose -f external-frontend.yml up -d

Frontend Setup

  1. Clone Repository:

    git clone https://github.com/oasysgames/blockscout-v6-frontend.git
    cd blockscout-v6-frontend
  2. Checkout Specific Version: Check available versions at blockscout-v6-frontend releases and checkout the desired version:

    # Example: checking out the latest stable version
    git checkout <version-tag>
  3. Configure Environment Variables:

  4. Run Frontend Container:

    docker-compose build 
    docker compose up -d

    Access the explorer at http://localhost/ or http://localhost:3000/

Optional: Migrate Verified Contract Data

If you want to migrate verified contract data from v5 to v6:

cd blockscout-v6-backend/migrates/
cp config/.env.sample config/.env
vi config/.env # modify variables as needed
sudo chmod +x excutes/verified_contract.sh
./excutes/verified_contract.sh

Post-Build Verification

Perform these checks to ensure proper operation:

UI Functionality

  • CSV downloads work without errors
  • Logos display correctly in both light/dark modes
  • Network list is accurate
  • MetaMask integration works properly

Core Features

  • Smart Contract verification (GUI and API)
  • REST API and GraphQL endpoints
  • Wallet Connect integration
  • Internal transactions retrieval

System Health

  • Monitor CPU and memory usage
  • Check storage usage and alerts
  • Verify PostgreSQL database performance
  • Review error logs