Skip to content
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
9 changes: 9 additions & 0 deletions .changeset/fast-bats-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@ensnode/ensrainbow-sdk": minor
"ensindexer": minor
"@docs/ensnode": minor
"ensadmin": minor
"ensapi": minor
---

Altered code references accordingly to the updated `EnsIndexerPublicConfig` data model.
5 changes: 5 additions & 0 deletions .changeset/lovely-teeth-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensnode/ensnode-sdk": minor
---

Added `ensRainbowPublicConfig` field to `EnsIndexerPublicConfig`.
10 changes: 8 additions & 2 deletions apps/ensadmin/src/app/mock/config-api.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ export const ensIndexerPublicConfig = deserializeENSIndexerPublicConfig({
},
indexedChainIds: [1, 8453, 59144, 10, 42161, 534352, 567],
databaseSchemaName: "alphaSchema0.34.0",
ensRainbowPublicConfig: {
version: "0.34.0",
labelSet: {
labelSetId: "subgraph",
highestLabelSetVersion: 0,
},
recordsCount: 100,
},
isSubgraphCompatible: false,
namespace: "mainnet",
plugins: [
Expand All @@ -23,8 +31,6 @@ export const ensIndexerPublicConfig = deserializeENSIndexerPublicConfig({
ponder: "0.11.43",
ensIndexer: "0.35.0",
ensDb: "0.35.0",
ensRainbow: "0.34.0",
ensRainbowSchema: 3,
ensNormalize: "1.11.1",
},
});
60 changes: 45 additions & 15 deletions apps/ensadmin/src/app/mock/config-info/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
},
"indexedChainIds": [1, 8453, 59144, 10, 42161, 534352, 567],
"databaseSchemaName": "alphaSchema0.34.0",
"ensRainbowPublicConfig": {
"version": "0.34.0",
"labelSet": {
"labelSetId": "subgraph",
"highestLabelSetVersion": 0
},
"recordsCount": 100
},
"isSubgraphCompatible": false,
"namespace": "mainnet",
"plugins": [
Expand All @@ -28,9 +36,7 @@
"ponder": "0.11.43",
"ensDb": "0.35.0",
"ensIndexer": "0.35.0",
"ensNormalize": "1.11.1",
"ensRainbow": "0.34.0",
"ensRainbowSchema": 3
"ensNormalize": "1.11.1"
}
}
},
Expand All @@ -50,9 +56,7 @@
"ponder": "0.11.43",
"ensDb": "0.35.0",
"ensIndexer": "0.35.0",
"ensNormalize": "1.11.1",
"ensRainbow": "0.34.0",
"ensRainbowSchema": 3
"ensNormalize": "1.11.1"
},
"indexedChainIds": [11155111, 84532, 59141, 11155420, 421614, 534351],
"namespace": "sepolia",
Expand All @@ -65,6 +69,14 @@
"registrars"
],
"databaseSchemaName": "alphaSepoliaSchema0.34.0",
"ensRainbowPublicConfig": {
"version": "0.34.0",
"labelSet": {
"labelSetId": "subgraph",
"highestLabelSetVersion": 0
},
"recordsCount": 100
},
"isSubgraphCompatible": false
}
},
Expand All @@ -84,14 +96,20 @@
"ponder": "0.11.43",
"ensDb": "0.35.0",
"ensIndexer": "0.35.0",
"ensNormalize": "1.11.1",
"ensRainbow": "0.34.0",
"ensRainbowSchema": 3
"ensNormalize": "1.11.1"
},
"indexedChainIds": [1],
"namespace": "mainnet",
"plugins": ["subgraph"],
"databaseSchemaName": "mainnetSchema0.34.0",
"ensRainbowPublicConfig": {
"version": "0.34.0",
"labelSet": {
"labelSetId": "subgraph",
"highestLabelSetVersion": 0
},
"recordsCount": 100
},
"isSubgraphCompatible": true
}
},
Expand All @@ -111,14 +129,20 @@
"ponder": "0.11.43",
"ensDb": "0.35.0",
"ensIndexer": "0.35.0",
"ensNormalize": "1.11.1",
"ensRainbow": "0.34.0",
"ensRainbowSchema": 3
"ensNormalize": "1.11.1"
},
"indexedChainIds": [11155111],
"namespace": "sepolia",
"plugins": ["subgraph"],
"databaseSchemaName": "sepoliaSchema0.34.0",
"ensRainbowPublicConfig": {
"version": "0.34.0",
"labelSet": {
"labelSetId": "subgraph",
"highestLabelSetVersion": 0
},
"recordsCount": 100
},
"isSubgraphCompatible": true
}
},
Expand All @@ -138,14 +162,20 @@
"ponder": "",
"ensDb": "",
"ensIndexer": "",
"ensNormalize": "",
"ensRainbow": "",
"ensRainbowSchema": -1
"ensNormalize": ""
},
"indexedChainIds": [11155111],
"namespace": "sepolia",
"plugins": ["subgraph"],
"databaseSchemaName": "DeserializationSchema0.34.0",
"ensRainbowPublicConfig": {
"version": "",
"labelSet": {
"labelSetId": "",
"highestLabelSetVersion": -1
},
"recordsCount": -1
},
"isSubgraphCompatible": true
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/ensadmin/src/app/mock/config-info/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com

import mockDataJson from "./data.json" with { type: "json" };

const mockConfigData = mockDataJson as Record<string, SerializedENSApiPublicConfig>;
const mockConfigData = mockDataJson as unknown as Record<string, SerializedENSApiPublicConfig>;

type LoadingVariant = "Loading" | "Loading Error";
type ConfigVariant = keyof typeof mockConfigData | LoadingVariant;
Expand Down
27 changes: 23 additions & 4 deletions apps/ensadmin/src/components/connection/cards/ensnode-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ function ENSNodeConfigCardContent({
{ensIndexerPublicConfig.plugins.map((plugin) => (
<span
key={`${plugin}-plugin-badge`}
className="flex justify-start items-start py-[2px] px-[10px] rounded-full bg-secondary text-sm leading-normal font-semibold text-black cursor-default whitespace-nowrap"
className="flex justify-start items-start py-0.5 px-2.5 rounded-full bg-secondary text-sm leading-normal font-semibold text-black cursor-default whitespace-nowrap"
>
{plugin}
</span>
Expand Down Expand Up @@ -561,7 +561,7 @@ function ENSNodeConfigCardContent({
icon={<ENSRainbowIcon width={24} height={24} />}
version={
<p className="text-sm leading-normal font-normal text-muted-foreground">
v{ensIndexerPublicConfig.versionInfo.ensRainbow}
v{ensIndexerPublicConfig.ensRainbowPublicConfig.version}
</p>
}
docsLink={new URL("https://ensnode.io/ensrainbow/")}
Expand All @@ -571,8 +571,8 @@ function ENSNodeConfigCardContent({
label="Server LabelSet"
value={
<p className={cardItemValueStyles}>
{ensIndexerPublicConfig.labelSet.labelSetId}:
{ensIndexerPublicConfig.labelSet.labelSetVersion}
{ensIndexerPublicConfig.ensRainbowPublicConfig.labelSet.labelSetId}:
{ensIndexerPublicConfig.ensRainbowPublicConfig.labelSet.highestLabelSetVersion}
</p>
}
additionalInfo={
Expand All @@ -586,6 +586,25 @@ function ENSNodeConfigCardContent({
</p>
}
/>

<InfoCardItem
label="Records Count"
value={
<p className={cardItemValueStyles}>
{ensIndexerPublicConfig.ensRainbowPublicConfig.recordsCount.toLocaleString()}
</p>
}
additionalInfo={
<p>
The total number of Rainbow Records.{" "}
<ExternalLinkWithIcon
href={`https://ensnode.io/ensrainbow/concepts/glossary/#rainbow-record`}
>
Learn more.
</ExternalLinkWithIcon>
</p>
}
/>
Comment on lines +590 to +607
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We present extra info now that we have access to it 👍

</InfoCardItems>
</InfoCard>
</div>
Expand Down
7 changes: 5 additions & 2 deletions apps/ensapi/src/config/config.schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ const BASE_ENV = {
const ENSINDEXER_PUBLIC_CONFIG = {
namespace: "mainnet",
databaseSchemaName: "ensapi",
ensRainbowPublicConfig: {
version: packageJson.version,
labelSet: { labelSetId: "subgraph", highestLabelSetVersion: 0 },
recordsCount: 100,
},
indexedChainIds: new Set([1]),
isSubgraphCompatible: false,
labelSet: { labelSetId: "subgraph", labelSetVersion: 0 },
plugins: [PluginName.Subgraph],
versionInfo: {
ensDb: packageJson.version,
ensIndexer: packageJson.version,
ensRainbow: packageJson.version,
ensRainbowSchema: 1,
ensNormalize: "1.1.1",
nodejs: "1.1.1",
ponder: "1.1.1",
Expand Down
8 changes: 4 additions & 4 deletions apps/ensapi/src/config/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export function invariant_ensIndexerPublicConfigVersionInfo(
}

// Invariant: ENSApi & ENSRainbow must match version numbers
if (ensIndexerPublicConfig.versionInfo.ensRainbow !== packageJson.version) {
if (ensIndexerPublicConfig.ensRainbowPublicConfig.version !== packageJson.version) {
ctx.issues.push({
code: "custom",
path: ["ensIndexerPublicConfig.versionInfo.ensRainbow"],
input: ensIndexerPublicConfig.versionInfo.ensRainbow,
message: `Version Mismatch: ENSRainbow@${ensIndexerPublicConfig.versionInfo.ensRainbow} !== ENSApi@${packageJson.version}`,
path: ["ensIndexerPublicConfig.ensRainbowPublicConfig.version"],
input: ensIndexerPublicConfig.ensRainbowPublicConfig.version,
message: `Version Mismatch: ENSRainbow@${ensIndexerPublicConfig.ensRainbowPublicConfig.version} !== ENSApi@${packageJson.version}`,
});
}
}
21 changes: 14 additions & 7 deletions apps/ensindexer/src/config/public.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import type { ENSIndexerPublicConfig } from "@ensnode/ensnode-sdk";
import type { EnsIndexerPublicConfig } from "@ensnode/ensnode-sdk";

import { getENSRainbowApiClient } from "@/lib/ensraibow-api-client";
import { getENSIndexerVersionInfo } from "@/lib/version-info";

import type { ENSIndexerConfig } from "./types";
import type { EnsIndexerConfig } from "./types";

const ensRainbowApiClient = getENSRainbowApiClient();

/**
* Build a public version of {@link ENSIndexerConfig}.
* Build a public version of {@link EnsIndexerConfig}.
*
* Note: some values required to build an {@link ENSIndexerPublicConfig} object
* Note: some values required to build an {@link EnsIndexerPublicConfig} object
* have to fetched over the network.
*/
export async function buildENSIndexerPublicConfig(
config: ENSIndexerConfig,
): Promise<ENSIndexerPublicConfig> {
const versionInfo = await getENSIndexerVersionInfo();
config: EnsIndexerConfig,
): Promise<EnsIndexerPublicConfig> {
const [versionInfo, ensRainbowPublicConfig] = await Promise.all([
getENSIndexerVersionInfo(),
ensRainbowApiClient.config(),
]);

return {
databaseSchemaName: config.databaseSchemaName,
ensRainbowPublicConfig,
labelSet: config.labelSet,
indexedChainIds: config.indexedChainIds,
isSubgraphCompatible: config.isSubgraphCompatible,
Expand Down
10 changes: 8 additions & 2 deletions apps/ensindexer/src/lib/ensdb-client/ensdb-client.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ export const databaseSchemaName = "public";

export const publicConfig = {
databaseSchemaName,
ensRainbowPublicConfig: {
version: "0.32.0",
labelSet: {
labelSetId: "subgraph",
highestLabelSetVersion: 0,
},
recordsCount: 100,
},
labelSet: {
labelSetId: "subgraph",
labelSetVersion: 0,
Expand All @@ -39,8 +47,6 @@ export const publicConfig = {
ensDb: "0.32.0",
ensIndexer: "0.32.0",
ensNormalize: "1.11.1",
ensRainbow: "0.32.0",
ensRainbowSchema: 2,
},
} satisfies EnsIndexerPublicConfig;

Expand Down
10 changes: 0 additions & 10 deletions apps/ensindexer/src/lib/version-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { prettifyError } from "zod/v4";
import type { ENSIndexerVersionInfo, SerializedENSIndexerVersionInfo } from "@ensnode/ensnode-sdk";
import { makeENSIndexerVersionInfoSchema } from "@ensnode/ensnode-sdk/internal";

import { getENSRainbowApiClient } from "@/lib/ensraibow-api-client";

/**
* Get NPM package version.
*
Expand Down Expand Up @@ -109,12 +107,6 @@ function getPackageVersionFromPnpmStore(pnpmDir: string, packageName: string): s
* Get complete {@link ENSIndexerVersionInfo} for ENSIndexer app.
*/
export async function getENSIndexerVersionInfo(): Promise<ENSIndexerVersionInfo> {
const ensRainbowApiClient = getENSRainbowApiClient();
const { versionInfo: ensRainbowVersionInfo } = await ensRainbowApiClient.version();

// ENSRainbow version (fetched dynamically from the connected ENSRainbow service instance)
const ensRainbowSchema = ensRainbowVersionInfo.dbSchemaVersion;

// ENSIndexer version
const ensIndexerVersion = packageJson.version;

Expand All @@ -125,13 +117,11 @@ export async function getENSIndexerVersionInfo(): Promise<ENSIndexerVersionInfo>
// parse unvalidated version info
const schema = makeENSIndexerVersionInfoSchema();
const parsed = schema.safeParse({
ensRainbow: ensRainbowVersionInfo.version,
nodejs: process.versions.node,
ponder: getPackageVersion("ponder"),
ensDb: ensDbVersion,
ensIndexer: ensIndexerVersion,
ensNormalize: getPackageVersion("@adraffy/ens-normalize"),
ensRainbowSchema,
} satisfies SerializedENSIndexerVersionInfo);

if (parsed.error) {
Expand Down
15 changes: 9 additions & 6 deletions docs/ensnode.io/src/content/docs/docs/usage/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The response includes several important configuration categories:
functionality
- **Plugins**: Activated plugins
- **ENSIndexer Version Information**: Node.js version, Ponder framework version,
ENSRainbow version and schema details, ENSDb version, ENSIndexer version, [ENS Normalize version](https://www.npmjs.com/package/@adraffy/ens-normalize)
ENSRainbow public config, ENSDb version, ENSIndexer version, [ENS Normalize version](https://www.npmjs.com/package/@adraffy/ens-normalize)

### Example response

Expand Down Expand Up @@ -118,12 +118,15 @@ The response includes several important configuration categories:
],
"versionInfo": {
"nodejs": "22.18.0",
"ponder": "0.11.43",
"ensDb": "0.35.0",
"ensIndexer": "0.35.0",
"ponder": "0.16.1",
"ensDb": "1.5.1",
"ensIndexer": "1.5.1",
"ensNormalize": "1.11.1",
"ensRainbow": "0.34.0",
"ensRainbowSchema": 3
"ensRainbowPublicConfig": {
"version": "1.5.1",
"labelSet": { "labelSetId": "subgraph", "highestLabelSetVersion": 0 },
"recordsCount": 133856894
}
}
}
Comment on lines 119 to 131
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example JSON response in the documentation shows ensRainbowPublicConfig nested inside versionInfo, but according to the actual type definitions (EnsIndexerPublicConfig in packages/ensnode-sdk/src/ensindexer/config/types.ts), ensRainbowPublicConfig is a top-level field of the config, not a child of versionInfo. The versionInfo object only contains nodejs, ponder, ensDb, ensIndexer, and ensNormalize.

The example response should be corrected: ensRainbowPublicConfig should appear as a top-level sibling of versionInfo, labelSet, namespace, etc., and the versionInfo block should not contain ensRainbowPublicConfig.

Copilot uses AI. Check for mistakes.
```
Expand Down
Loading