Skip to content

Ethereumx/azexplorer

 
 

Repository files navigation

Polkascan Explorer

Polkascan Explorer provides a generalized block explorer for Substrate-based blockchains.

Installation

Run init.sh to initialize repository; this will basically run:

  • git submodule update --init --recursive
  • cp explorer-ui-config.json explorer-ui/src/assets/config.json

The explorer-ui-config.json file contains the URLs of theexposed Substrate and Explorer API endpoints

if not inited you'll get COPY failed: file not found in build context or excluded by .dockerignore: stat polkadapt/package.json: file does not exist

Running the application

  • docker-compose up --build

Links

Components

The explorer application consist of several components:

Harvester component

The harvester retrieves data from the connected Substrate node and stores it into a MySQL (by default) database.

Explorer API component

The explorer API transforms the data via an ETL process into an explorer-specific format. It exposes a GraphQL endpoint and enables subscription-based communication to the UI.

Explorer UI component

Explorer UI is a client-sided Angular based application that utilizes PolkADAPT and its Adapters to obtain data from multiple data sources, like the Explorer API and the Substrate node. Its design is based on flat Material component design, styled in Polkascan branding.

Modifications

Substrate Node

By default, a build of Substrate Node Template is used. If a local Substrate node is already running on the host machine, you can change environment variable in the docker-compose.yml: SUBSTRATE_RPC_URL=ws://host.docker.internal:9944

Or to any public or private websocket endpoint

To use PolkadotJS Apps with the local Substrate node, go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer

Explorer UI

Datasources

The UI is utilizing PolkAdapt to combine on-chain data retrieved directly from the Substrate node, with the GraphQL endpoint with indexed data served by the Explorer API. In this way data like events and extrinsics can be retrieved fast, with the verification of on-chain data.

By default, the UI are using the local endpoints, new networks can be added by extending the dict:

{
  "local": {
    "substrateRpcUrlArray": ["ws://127.0.0.1:9944"],
    "explorerWsUrlArray": ["ws://127.0.0.1:8000/graphql-ws"]
  },
  "polkadot": {
    "substrateRpcUrlArray": ["wss://<PUBLIC_ENDPOINT>"],
    "explorerWsUrlArray": ["wss://<HOSTED_EXPLORER_API_ENDPOINT>/graphql-ws"]
  }
}

About

Polkascan Explorer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%