Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP consolidate docs #264

Merged
merged 7 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions docs/ensnode.io/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "ENSNode Docs",
social: {
github: "https://github.com/namehash/ensnode",
},
sidebar: [
{
label: "ENSNode",
items: [
{
label: "Quickstart",
slug: "ensnode/quickstart",
},
{
label: "Guides",
autogenerate: { directory: "ensnode/guides" },
collapsed: true,
},
{
label: "Reference",
autogenerate: { directory: "ensnode/reference" },
collapsed: true,
},
],
},
{
label: "ENSRainbow",
items: [
{
label: "Quickstart",
slug: "ensrainbow/quickstart",
},
{
label: "Guides",
autogenerate: { directory: "ensrainbow/guides" },
collapsed: true,
},
{
label: "Reference",
autogenerate: { directory: "ensrainbow/reference" },
collapsed: true,
},
],
},

],
}),
],
});
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Understanding ENSNode V1
sidebar:
order: 1
order: 3
---

:::note
Expand All @@ -13,24 +13,27 @@ ENSNode is the new multichain indexer for ENS and ENSv2. It is built on [Ponder]
## Core Design Principles

1. **Full Backwards Compatibility w/ ENS Subgraph**
- 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)
- Drop-in replacement for applications using the ENS Subgraph
- 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))

- 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)
- Drop-in replacement for applications using the ENS Subgraph
- 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))

2. **Multi-Registry Plugin Architecture**
- Support for indexing ENS data across multiple chains & subregistries (i.e. mainnet, Base, Linea)
- Plugins can be activated independently or in combination

- Support for indexing ENS data across multiple chains & subregistries (i.e. mainnet, Base, Linea)
- Plugins can be activated independently or in combination

3. **Built on Ponder**
- Improved indexing speed (>10x faster than ENS Subgraph)
- Isolated indexing schemas (supporting branches, staging environments)
- Access your indexed data directly from Postgres
- `@ponder/client` for efficent client-side live queries

- Improved indexing speed (>10x faster than ENS Subgraph)
- Isolated indexing schemas (supporting branches, staging environments)
- Access your indexed data directly from Postgres
- `@ponder/client` for efficent client-side live queries

4. **Self-hostable Decentralization Approach**
- Self-hostable infrastructure
- Bring-your-own Postgres
- Bring-your-own ENSRainbow
- Self-hostable infrastructure
- Bring-your-own Postgres
- Bring-your-own ENSRainbow

## Plugins

Expand All @@ -44,7 +47,6 @@ Because plugins indexing subregistries use the shared handlers and may clobber e

This scoping also applies to the concept of an `OwnedName` (see `apps/ensnode/src/lib/types.ts` and `makeRegistrarHandlers` in `apps/ensnode/src/handlers/Registrar.ts`) — each plugin exists in the context of a name whos subnames they manage, and the shared handlers reference that name instead of a hardcoded constant (`"eth"`, in the subgraph implementation).


### Plugin Definition

An ENSNode plugin is defined by its Ponder config (network & contracts & abis & such) and the ponder handler registration code that it executes at runtime (via the `activate` function).
Expand Down Expand Up @@ -88,19 +90,21 @@ In general, however, each handler is written in a more ponder-native way, using
ENSNode exposes three distinct API endpoints:

1. **Subgraph-Compatible GraphQL** (`/subgraph`)
- Implements the ENS Subgraph schema and query patterns
- Enables gradual migration from existing Subgraph implementations
- Maintains compatibility with `ensjs` client library — just replace

- Implements the ENS Subgraph schema and query patterns
- Enables gradual migration from existing Subgraph implementations
- Maintains compatibility with `ensjs` client library — just replace

2. **Native Ponder GraphQL** (`/`)
- Auto-generated GraphQL API from Ponder schema
- More efficient query patterns than Subgraph API, particularly for pagination

- Auto-generated GraphQL API from Ponder schema
- More efficient query patterns than Subgraph API, particularly for pagination

3. **Ponder Client API**
- SQL-based alternative to GraphQL
- End-to-end type inference
- Support for live updates
- Optimized for client application integration
- SQL-based alternative to GraphQL
- End-to-end type inference
- Support for live updates
- Optimized for client application integration

## Label Healing with ENSRainbow

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: Using ENSNode's APIs
sidebar:
order: 1
---

ENSNode exposes two GraphQL endpoints to query:

- `/` uses a Ponder-native GraphQL schema
- `/subgraph` uses a subgraph-compatible GraphQL schema

### Examples

Fetch data about the three most recently-created domains.

<details>
<summary>Ponder-native query</summary>

```gql
{
domains(orderBy: "createdAt", orderDirection: "desc", limit: 3) {
items {
name
expiryDate
}
}
}
```

<details>
<summary>Ponder-native response</summary>

```json
{
"data": {
"domains": {
"items": [
{
"name": "ensanguo.eth",
"expiryDate": "1758170255"
},
{
"name": "fiffer.eth",
"expiryDate": "2041994243"
},
{
"name": "rifaisicilia.eth",
"expiryDate": "1758170039"
}
]
}
}
}
```

</details>
</details>

<details>
<summary>Subgraph-compatible query</summary>

```gql
{
domains(orderBy: "createdAt", orderDirection: "desc", first: 3) {
name
expiryDate
}
}
```

<details>
<summary>Subgraph-native response</summary>

```json
{
"data": {
"domains": [
{
"name": "ensanguo.eth",
"expiryDate": "1758170255"
},
{
"name": "fiffer.eth",
"expiryDate": "2041994243"
},
{
"name": "rifaisicilia.eth",
"expiryDate": "1758170039"
}
]
}
}
```

</details>
</details>
26 changes: 26 additions & 0 deletions docs/ensnode.io/src/content/docs/ensnode/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: ENSNode Quickstart
description: Get started building ENS applications with your own ENSNode.
---

## Quick Start with Hosted Instances

NameHash Labs hosts instances of ENSNode and ENSRainbow that you can instantly query.

:::note[Hosted Instances Documentation]
[See documentation for the ENSNode hosted instances](/ensnode/reference/hosted-ensnode-instances/)
:::

## Quick Start with Docker

:::caution[Work In Progress]
TODO: docker-compose example
:::

## Using ENSNode's APIs

See the [Using ENSNode](/ensnode/guides/using-ensnode-apis/) guide for examples of how to query ENSNode's GraphQL API or `@ponder/client` endpoint.

## Using ENSNode with ensjs

See the [Using ENSNode with ensjs](/ensnode/guides/using-ensnode-with-ensjs/) guide for examples of how to query ENSNode from ensjs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: What is the ENS Subgraph?
---

The following serves as background information regarding the ENS Subgraph. It is not necessary for running ENSNode but may be helpful in descriing the ecosystem & context in which ENSNode was developed.

## The Graph & Graph Node

[The Graph](https://thegraph.com/) leads development of [Graph Node](https://thegraph.com/docs/en/indexing/tooling/graph-node/), an [open source software application](https://github.com/graphprotocol/graph-node) for indexing blockchain data.

## Subgraphs

Each Graph Node server can run any number of "subgraphs". Each subgraph is essentially a plugin describing:
1. A strategy for how the Graph Node should index blockchain data.
2. A schema for a GraphQL API providing access to the indexed data.

## ENS Subgraph

[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).

## Graph Network

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.

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.

## NameHash Labs Hosted Graph Node Instance

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.

This server is running [Graph Node version 0.33.0](https://github.com/graphprotocol/graph-node/releases/tag/v0.33.0). The latest Graph Node release (as of this writing) is [version 0.36.0](https://github.com/graphprotocol/graph-node/releases), however it is understood that this version update has no impact on the data being indexed.

## NameHash Labs Hosted ENS Subgraphs

Our Graph Node instance indexes the ENS Subgraph. The live status 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).
Subgraph Id: QmVsj1tYQ84DZH3NHAbZKjQ5agQ5Gt6VusUBf67CU32FWP
* As of the time of writing this wiki page:
* This is the latest version of the ENS Subgraph, published [Feb 15, 2024](https://github.com/graphprotocol/ens-subgraph/commit/c8447914e8743671fb4b20cffe5a0a97020b3cee).
* The subgraph is fully synced with the latest block on mainnet.
* [Interactive GraphiQL Explorer](https://graphnode.namehashlabs.org:8000/subgraphs/name/namehash/ens-subgraph-2/graphql)

This Subgraph Id is understood to be distinct from the "official" hosted ENS subgraph because it is associated with our own hosted Graph Node instance that is not participating in The Graph's distributed network of indexers.
Loading