
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:- 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. a. Subgraph should support this graphql schema
- Submit your subgraph to graph-node.
- Submit a PR to the blockscout-rs repository (hosted version) or integrate with your Blockscout fork. a. Example PR for BNS (Base Name Service)
-
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?
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 RecordsIt 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?
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?
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.
