-
Notifications
You must be signed in to change notification settings - Fork 16
ENSDb SDK enhancements #1837
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
ENSDb SDK enhancements #1837
Changes from all commits
e415a9e
e324b2f
1c744a8
9cf85b9
b57ed91
5071348
fde2e88
0912bcd
96ebaca
5f34c2c
6e8ddbc
332848b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "ensapi": minor | ||
| --- | ||
|
|
||
| Updated response data model for `/api/config` route to include `ensDbPublicConfig` field. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@ensnode/ensnode-sdk": minor | ||
| --- | ||
tk-o marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Introduced the `EnsDbPublicConfig` data model. | ||
tk-o marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@ensnode/ensdb-sdk": minor | ||
| --- | ||
|
|
||
| Added `getEnsDbPublicConfig` method to `EnsDbReader` class. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,15 @@ | ||||||||||||||||
| import { and, eq } from "drizzle-orm/sql"; | ||||||||||||||||
| import { and, eq, sql } from "drizzle-orm/sql"; | ||||||||||||||||
|
|
||||||||||||||||
| import { | ||||||||||||||||
| type CrossChainIndexingStatusSnapshot, | ||||||||||||||||
| deserializeCrossChainIndexingStatusSnapshot, | ||||||||||||||||
| deserializeEnsIndexerPublicConfig, | ||||||||||||||||
| type EnsDbPublicConfig, | ||||||||||||||||
| type EnsIndexerPublicConfig, | ||||||||||||||||
| validateEnsDbPublicConfig, | ||||||||||||||||
| } from "@ensnode/ensnode-sdk"; | ||||||||||||||||
|
|
||||||||||||||||
| import { ENSDB_ROOT_SCHEMA_VERSION } from "../config"; | ||||||||||||||||
| import { | ||||||||||||||||
| type AbstractEnsIndexerSchema, | ||||||||||||||||
| buildEnsDbDrizzleClient, | ||||||||||||||||
|
|
@@ -126,6 +129,19 @@ export class EnsDbReader< | |||||||||||||||
| return this._ensNodeSchema; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * Get ENSDb Public Config | ||||||||||||||||
| */ | ||||||||||||||||
| async getEnsDbPublicConfig(): Promise<EnsDbPublicConfig> { | ||||||||||||||||
| const postgresVersion = await this.getPgVersion(); | ||||||||||||||||
| const rootSchemaVersion = ENSDB_ROOT_SCHEMA_VERSION; | ||||||||||||||||
|
Comment on lines
+136
to
+137
|
||||||||||||||||
| const postgresVersion = await this.getPgVersion(); | |
| const rootSchemaVersion = ENSDB_ROOT_SCHEMA_VERSION; | |
| const [postgresVersion, dbRootSchemaVersion] = await Promise.all([ | |
| this.getPgVersion(), | |
| this.getEnsDbVersion(), | |
| ]); | |
| const rootSchemaVersion = dbRootSchemaVersion ?? ENSDB_ROOT_SCHEMA_VERSION; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** | ||
| * Version of the Root Schema definition for ENSDb. | ||
| * | ||
| * The Root Schema definition is a union of all | ||
| * the individual schema definitions in ENSDb: | ||
| * - The "abstract" ENSIndexer Schema definition | ||
| * - ENSNode Schema definition | ||
| * - (future) other schemas related to ENSDb | ||
| */ | ||
| export const ENSDB_ROOT_SCHEMA_VERSION = "1.0.0"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from "./client"; | ||
| export * from "./config"; |
Uh oh!
There was an error while loading. Please reload this page.