Skip to content

Commit bc1897d

Browse files
chore: update subgraph docs (#1534)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4f7bfdb commit bc1897d

14 files changed

Lines changed: 119 additions & 157 deletions

File tree

.changeset/famous-ducks-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ensindexer": patch
3+
---
4+
5+
Updated default plugin activations when `SUBGRAPH_COMPAT=false` (default) to also include protocol-acceleration, registrars, and tokenscope.

.changeset/flat-teams-sin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@docs/ensnode": patch
3+
---
4+
5+
Refine docs for the ENS Subgraph

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ ENSNode provides enhanced ENS indexing capabilities beyond the ENS Subgraph, inc
5252
- ✅ Automatically reconciles chain reorganizations
5353
- ✅ Deploy anywhere with Node.js & Docker
5454
- Designed for web developers
55-
-[use ENSNode with ENSjs](https://www.ensnode.io/docs/usage/with-ensjs/)
55+
-[use ENSNode with ENSjs](https://ensnode.io/docs/usage/with-ensjs/)
5656
-[GraphQL APIs](https://ensnode.io/docs/usage/api/)
5757
- ✅ Custom APIs for your app
58-
- [1:1 Subgraph Compatibility](https://www.ensnode.io/docs/reference/subgraph-compatibility/)
58+
- [1:1 Subgraph Compatibility](https://ensnode.io/docs/concepts/what-is-the-ens-subgraph/)
5959
-[100% data equivalency](https://github.com/namehash/ens-subgraph-transition-tools) as compared to Subgraph
6060
- ✅ 100% ensjs test suites passing via [ens-test-env](https://github.com/namehash/ens-test-env)
6161
- ✅ 100% ens-app-v3 test suites passing via [ens-test-env](https://github.com/namehash/ens-test-env)

apps/ensindexer/src/config/environment-defaults.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const EnvironmentDefaults = {
2323
PluginName.Basenames,
2424
PluginName.Lineanames,
2525
PluginName.ThreeDNS,
26+
PluginName.ProtocolAcceleration,
27+
PluginName.Registrars,
28+
PluginName.TokenScope,
2629
].join(","),
2730
// TODO: set these to the most up-to-date ENSRainbow Label Set
2831
LABEL_SET_ID: "subgraph",

apps/fallback-ensapi/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ This Fallback ENSApi proxies ENS Subgraph GraphQL API requests originally sent t
1010

1111
When run in production, it also requires configuration of the `CLOUDFLARE_SECRET` environment variable to avoid exposing our `/subgraph` proxy to the public net.
1212

13-
For data consistency, this fallback is exclusively enabled for NameHash's ENSNode deployments that use a [Subgraph Compatible](https://ensnode.io/docs/reference/subgraph-compatibility/) configuration. More specifically:
13+
For data consistency, this fallback is exclusively enabled for NameHash's ENSNode deployments that use a [Subgraph Compatible](https://ensnode.io/docs/concepts/what-is-the-ens-subgraph/) configuration. More specifically:
1414
- Mainnet: https://api.mainnet.ensnode.io/
1515
- Sepolia: https://api.sepolia.ensnode.io/
1616

17-
The following NameHash ENSNode deployments are _not_ fully [Subgraph Compatible](https://ensnode.io/docs/reference/subgraph-compatibility/), as they produce a _superset_ of the data indexed by TheGraph. Fallback ENSApi will return an HTTP 503 (Service Unavailable) in response to any Subgraph API requests for these deployments:
17+
The following NameHash ENSNode deployments are _not_ fully [Subgraph Compatible](https://ensnode.io/docs/concepts/what-is-the-ens-subgraph/), as they produce a _superset_ of the data indexed by TheGraph. Fallback ENSApi will return an HTTP 503 (Service Unavailable) in response to any Subgraph API requests for these deployments:
1818
- Mainnet: https://api.alpha.ensnode.io/
1919
- Sepolia: https://api.alpha-sepolia.ensnode.io/
2020

docs/ensnode.io/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ The documentation uses optional environment variables:
2424
- `ENSADMIN_URL`: Base URL for an ENSAdmin instance. Used for links that open in ENSAdmin. (defaults to `https://admin.ensnode.io`)
2525
3. Stop the Astro server and restart it with `pnpm dev`
2626

27-
Visit [ensnode.io](https://www.ensnode.io) for documentation, guides, and the API reference.
27+
Visit [ensnode.io](https://ensnode.io) for documentation, guides, and the API reference.

docs/ensnode.io/src/content/docs/docs/concepts/what-is-ensnode.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ENSNode version 1 (`V1`), discussed here, prioritizes equivalency with the [ENS
3030

3131
- Full support for existing ENS Subgraph queries used by [`ensjs`](https://github.com/ensdomains/ensjs/) and [`ens-app-v3`](https://github.com/ensdomains/ens-app-v3)
3232
- Drop-in replacement for applications using the ENS Subgraph
33-
- Verified compatibility through extensive testing with [`ens-test-env`](https://github.com/namehash/ens-test-env/) and [ens-subgraph-transition-tools](https://github.com/namehash/ens-subgraph-transition-tools) (see [Subgraph Compatibility](/reference/subgraph-compatibility))
33+
- Verified compatibility through extensive testing with [`ens-test-env`](https://github.com/namehash/ens-test-env/) and [ens-subgraph-transition-tools](https://github.com/namehash/ens-subgraph-transition-tools) (see [Subgraph Compatibility](/docs/concepts/what-is-the-ens-subgraph/))
3434

3535
2. **Multi-Registry Plugin Architecture**
3636

docs/ensnode.io/src/content/docs/docs/concepts/what-is-the-ens-subgraph.mdx

Lines changed: 95 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,115 @@ Each Graph Node server can run any number of "subgraphs". Each subgraph is essen
2929

3030
## ENS Subgraph
3131

32-
[ENS Labs](https://www.enslabs.org/) has led development of the [ENS Subgraph](https://github.com/ensdomains/ens-subgraph). So far this has been the "official" strategy for indexing ENS data. Additional background info is available in [official ENS docs](https://docs.ens.domains/web/subgraph).
32+
[ENS Labs](https://www.enslabs.org/) has led development of the [ENS Subgraph](https://github.com/ensdomains/ens-subgraph). In the past, this was the "official" strategy for indexing ENS data. Additional background info is available in [official ENS docs](https://docs.ens.domains/web/subgraph).
3333

3434
## Graph Network
3535

3636
Operating your own Graph Node server instance can be complex, expensive, and time consuming. An alternative is to use The Graph's semi-decentralized network of indexers operating Graph Node instances.
3737

3838
This network provides access to a [semi-decentralized ENS Subgraph](https://thegraph.com/explorer/subgraphs/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH?view=Query&chain=arbitrum-one). Developers are welcome to use this rate limited API endpoint above for testing, but are highly encouraged to sign up for an account with The Graph to get their own (paid) API key.
3939

40-
## NameHash Labs Hosted Graph Node Instance
40+
## ENSNode's Backwards Compatibility with the ENS Subgraph
4141

42-
As an alternative to the Graph Network, [NameHash Labs](https://namehashlabs.org/) operates an independent Graph Node instance. This is currently being freely offered to the ENS community without need for API keys or rate limiting. It can be found at https://graphnode.namehashlabs.org:8030. An [interactive GraphQL Playground](https://graphnode.namehashlabs.org:8030/graphql/playground) is also available.
42+
To support the ENS ecosystem's transition away from legacy ENS indexing strategies to ENSNode, ENSNode provides a verified backwards compatible ENS Subgraph GraphQL endpoint. This therefore also provides backwards compatibility with `ensjs`.
4343

44-
This server is running [Graph Node version 0.39.1](https://github.com/graphprotocol/graph-node/releases/tag/v0.39.1) which is the [latest Graph Node release](https://github.com/graphprotocol/graph-node/releases) (as of July 15, 2025).
44+
1. For those that wish to host their own ENS indexer, it is faster and easier to deploy ENSNode than to run an ENS Subgraph instance.
45+
2. For those building an app that simply want to query the legacy ENS Subgraph API in the easiest way possible, we make this freely available through [our hosted ENSNode instances](/docs/usage/hosted-ensnode-instances/).
4546

46-
## NameHash Labs Hosted ENS Subgraphs
47+
## Self-hosted ENSNode instance configuration for ENS Subgraph compatibility
4748

48-
Our Graph Node instance indexes the ENS Subgraph on mainnet and sepolia. The live indexing status of each can be monitored with [the indexing status API endpoint](https://graphnode.namehashlabs.org:8030/graphql/playground?query=%7B%0A%20%20indexingStatuses%20%7B%0A%20%20%20%20subgraph%0A%20%20%20%20health%0A%20%20%20%20historyBlocks%0A%20%20%20%20paused%0A%20%20%20%20synced%0A%20%20%20%20chains%20%7B%0A%20%20%20%20%20%20network%0A%20%20%20%20%20%20chainHeadBlock%20%7B%0A%20%20%20%20%20%20%20%20number%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20latestBlock%20%7B%0A%20%20%20%20%20%20%20%20number%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D).
49+
To enable full ENS Subgraph compatibility on a self-hosted ENSNode instance, configure ENSIndexer with `SUBGRAPH_COMPAT=true`. This single flag:
4950

50-
As of the latest update to this page on July 15, 2025:
51+
1. **Applies Subgraph Indexing Behavior**: Uses Subgraph Interpreted Labels and Names, allowing unnormalized labels to be returned as they appear in the original ENS Subgraph
52+
2. **Sets Default Plugins & Label Set**: Defaults to `PLUGINS=subgraph`, `LABEL_SET_ID=subgraph` and `LABEL_SET_VERSION=0` to match subgraph indexing logic and label healing behavior
5153

52-
- The ["old" version](https://github.com/ensdomains/ens-subgraph/commit/c8447914e8743671fb4b20cffe5a0a97020b3cee) of the ENS Subgraph ([the version currently served by the semi-decentralized Graph Network](https://thegraph.com/explorer/subgraphs/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH?view=Query&chain=arbitrum-one)) is no longer being indexed by our Graph Node server.
53-
- The ["new" version](https://github.com/ensdomains/ens-subgraph/pull/90) (as of commit `310bdb2`) is now being indexed across the following chains:
54+
When `SUBGRAPH_COMPAT=false` (default), ENSIndexer operates in enhanced mode with:
5455

55-
**Mainnet**
56+
- **Enhanced Indexing Behavior**: Uses Interpreted Labels and Names with improved security by encoding unnormalized labels as labelhashes
57+
- **Expanded Plugin Support**: Defaults to `PLUGINS=subgraph,basenames,lineanames,threedns,protocol-acceleration,registrars,tokenscope` for multichain ENS indexing
58+
- **Reverse Address Healing**: Attempts to heal subnames of addr.reverse for enhanced reverse resolution support
5659

57-
- Subgraph ID: `QmcE8RpWtsiN5hkJKdfCXGfTDoTgPEjMbQwnjLPfThT7kZ`
58-
- [GraphQL Endpoint](https://graphnode.namehashlabs.org:8000/subgraphs/name/namehash/ens-subgraph-mainnet)
59-
- [Interactive GraphiQL Explorer](https://graphnode.namehashlabs.org:8000/subgraphs/name/namehash/ens-subgraph-mainnet/graphql)
60+
## Compatibility Tooling
6061

61-
**Sepolia**
62+
ENSNode has developed tooling to verify subgraph compatibility and ease migration from the ENS Subgraph.
6263

63-
- Subgraph ID: `QmZkCMqRDzq8tWfJy12KudmRjwzHLSA5F6KnSnHRoC6kQe`
64-
- [GraphQL Endpoint](https://graphnode.namehashlabs.org:8000/subgraphs/name/namehash/ens-subgraph-3)
65-
- [Interactive GraphiQL Explorer](https://graphnode.namehashlabs.org:8000/subgraphs/name/namehash/ens-subgraph-3/graphql)
64+
<LinkCard
65+
title="Subgraph Compatibility Tooling"
66+
href="/docs/reference/subgraph-compatibility-tooling/"
67+
/>
68+
69+
## Subgraph-Compatible GraphQL API Reference
70+
71+
### Supported Features
72+
73+
The feature set used by `ensjs` and `ens-app-v3` is fully supported: see the [well-known queries](#well-known-queries) section below.
74+
75+
### Planned Features
76+
77+
- any open [issues](https://github.com/namehash/ensnode/issues) regarding Subgraph-Compatibility
78+
- [subgraph `_Meta_` object](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#subgraph-metadata-example)
79+
80+
:::note[Contributions]
81+
If you'd like to contribute to these features, please [open a Pull Request on GitHub](https://github.com/namehash/ensnode).
82+
:::
83+
84+
## Possible Features
85+
86+
The following features could be implemented, but are not yet planned.
87+
88+
- [fulltext search queries](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#full-text-search-example)
89+
90+
:::note[Contributions]
91+
If you'd like to contribute to these features, please [open a Pull Request on GitHub](https://github.com/namehash/ensnode).
92+
:::
93+
94+
### Unplanned Features
95+
96+
The following features of the subgraph graphql api are explicitly unsupported and are not planned.
97+
98+
- [1-level-nested Entity `_orderBy` param](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#nested-entity-sorting-example)
99+
- [time travel queries](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#time-travel-queries-example)
100+
- [\_change_block filtering](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#block-based-filtering-example)
101+
102+
:::note[Contributions]
103+
If you'd like to discuss these features, please [open an Issue on GitHub](https://github.com/namehash/ensnode/issues).
104+
:::
105+
106+
### Well-Known Queries
107+
108+
These are some of the popular queries we've seen in the wild (namely via ENSjs and ens-app-v3)—the Subgraph-compatible GraphQL API includes full compatibility with these use-cases (and all other possible queries with the exceptions listed above).
109+
110+
:::note[Contributions]
111+
If you'd like to highlight additional query patterns of the ENS Subgraph GraphQL, please [contribute to this documentation](https://github.com/namehash/ensnode/issues).
112+
:::
113+
114+
#### from ensjs
115+
116+
- [`getDecodedName`](https://github.com/ensdomains/ensjs/blob/17ab314/packages/ensjs/src/functions/subgraph/getDecodedName.ts) — Gets the full name for a name with unknown labels from the subgraph
117+
- Heals encoded labels using the subgraph
118+
- Returns if name is fully decoded
119+
- Splits name into labels
120+
- Finds domains by id for encoded labels
121+
- Queries domain by namehash
122+
- [`getNameHistory`](https://github.com/ensdomains/ensjs/blob/17ab314/packages/ensjs/src/functions/subgraph/getNameHistory.ts)
123+
- Retrieves all events associated with a name
124+
- [`getNamesForAddress`](https://github.com/ensdomains/ensjs/blob/17ab314/packages/ensjs/src/functions/subgraph/getNamesForAddress.ts)
125+
- Gets all names related to an address via registrant, owner, wrappedOwner, resolvedAddress
126+
- Supports searchString
127+
- Supports filtering by expiry, reverse records, empty domains
128+
- Supports ordering by expiry date, name, labelName, createdAt
129+
- Supports pagination by excluding previous results
130+
- [`getSubgraphRecords`](https://github.com/ensdomains/ensjs/blob/17ab314/packages/ensjs/src/functions/subgraph/getSubgraphRecords.ts) — Gets the records for a name from the subgraph
131+
- Allows querying by specific resolver id
132+
- [`getSubgraphRegistrant`](https://github.com/ensdomains/ensjs/blob/17ab314/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.ts) — Gets the name registrant from the subgraph
133+
- Supports .eth second-level domains only
134+
- [`getSubnames`](https://github.com/ensdomains/ensjs/blob/17ab314/packages/ensjs/src/functions/subgraph/getSubnames.ts) — Gets the subnames for a name
135+
- Supports searchString
136+
- Supports filtering by expiry, empty domains
137+
- Supports ordering by expiry date, name, labelName, createdAt
138+
- Supports pagination by excluding previous results
139+
140+
#### from ens-app-v3
141+
142+
- [`useResolverExists`](https://github.com/ensdomains/ens-app-v3/blob/328692ae832618f8143916c143b7e4cb9e520811/src/hooks/useResolverExists.ts#L27) — Checks if a resolver exists
143+
- [`useRegistrationData`](https://github.com/ensdomains/ens-app-v3/blob/328692ae832618f8143916c143b7e4cb9e520811/src/hooks/useRegistrationData.ts#L31) — Gets registration by id and nameRegistered events

0 commit comments

Comments
 (0)