Skip to content

Latest commit

 

History

History
62 lines (35 loc) · 3.82 KB

blockscout-ens-bens-name-service-integration.md

File metadata and controls

62 lines (35 loc) · 3.82 KB
description
BENS service extends Blockscout support for name services

Blockscout ENS (BENS) Name Service Integration

Blockscout now support Name Services for various chains including ENS for Ethereum. Search by name in the search bar or used the dedicated Name Services lookup page accessible from the Blockchain menu.

On the Name Services page search by name or address and view registration and expiration date for all names.

Adding Name Service Support

Protocols can add Name Service support for Blockscout instances on various chains. The BENS microservice was first introduced in Blockscout v5.4, and several bugs were fixed in Blockscout v6.0, which is the recommended minimum version for integration.

You'll complete the following steps to add Name Service Support to Blockscout:

  1. Use this guide to create a subgraph. Our template uses the ENS subgraph structure, so the closer your project is the ENS the easier the integration.
    1. Subgraph should support this graphql schema
  2. Submit your subgraph to graph-node.
  3. Submit a PR to the blockscout-rs repository (hosted version) or integrate with your Blockscout fork.
    1. Example PR for BNS (Base Name Service)
  4. Enable BENS service on the instance using the MICROSERVICE_BENS_ENABLED & MICROSERVICE_BENS_URL env variables.

FAQs

Some domains are being indexed in a hashed format. What might cause this?

This may be the result of missing information/functions in the subgraph. When a subgraph sees that a domain name has been registered, it only has the label_hash of this name. Therefore, the subgraph has to guess the name using a rainbow table (make sure to load ens-rainbow table) OR find this name later in other events, such as handleNameChanged or any other event that has a name field.

Try to determine events with a name field, write code that will update domain name using maybeSaveDomainName() or other functions you prefer. For example, the ens-subgraph uses the setNamePreimage function, which performs the same function for second-level-eth domains only.

Reverse Records

It may also be the case that unknown names are reverse records. These are not resolved by design, and users don't typically need to see them.

How do I launch BENS locally?

The easiest way is to use docker.

docker run --platform linux/x86_64 -p 8050:8050 --rm --name bens --env-file .env ghcr.io/blockscout/bens:latest

To build locally without docker you should install protoc and protoc-gen-openapiv2 . A complete guide for a local build is not yet available.

What does 'primary' refer to in the Domains dropdown in the Blockscout UI?

The primary name is the first name created which has not yet expired.