Skip to content

acuity-network/hybrid-dapp

Repository files navigation

Hybrid Dapp

Development of this tool was funded by a grant from the Web3 Foundation.

Overview

Hybrid takes a unique, partially decentralized approach that improves two major problems with current open source Substrate block explorers: centralization and huge hosting requirements.

A fully centralized block explorer typically populates an SQL database with the entirety of an archive node and stores additional data to index everything. Operating such a database reliably requires huge system resources and expense.

When querying block information, or the chain state at any block height, the Hybrid dapp will use the Substrate Connect light client from within the browser. Alternatively, these queries can be made directly to an archive node via WSS.

For event search functionality, the Hybrid indexer efficiently indexes events in all blocks so they can be found with a simple WSS query. For example, to find all events connected with a specific AccountId.

This architecture has three main advantages:

  • state queries are fully decentralized - you don't have to trust an RPC provider not to lie to you
  • 100% availability - the light client doesn't depend on any centralized service that may not always be available
  • the Hybrid indexer has significantly lower system requirements - it doesn't need to store all chain history

Eventually, Hybrid will use this centralized / decentralized approach as the basis for an ink! contract explorer.

Because Substrate is a federated platform, it will be possible browse multiple chains from the Hybrid dapp.

Architecture

Hybrid Architecture

The Hybrid dapp is a Vue dapp, using the Vuetify framework for the user interface. pnpm and Vite are used for the build.

It uses @polkadot/api to retrieve data from the chain. The Hybrid Indexer is queried via WSS.

Tutorial

Start indexing Polkadot

Follow the instructions at Hybrid Indexer

Build the dapp

Install pnpm

pnpm install
pnpm dev

Open the dapp

Go to http://127.0.0.1:5173/

Query the indexer

  1. Select which key type to search for.
  2. Enter the key to search for.
  3. Click "Search".

Events with the key will be appear.

Docker

Follow the instructions in polkadot-indexer to run a docker image in a separate console tab for each of polkadot, kusama, rococo & westend.

Run the following command to build the image:

docker build .

Then run the image (replace [image_hash] with the hash of the docker image displayed at the end of the build):

docker run --rm -p 8272:8272 [image_hash]

Go to http://127.0.0.1:8272/

About

Hybrid Explorer Dapp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published