-
Notifications
You must be signed in to change notification settings - Fork 16
Fix/remove ensadmin loopback #1160
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e041324
refactor: remove ENSNODE_PUBLIC_URL, ENSADMIN_URL, PORT env variables
shrugs 0888e87
remove vars from terraform
shrugs c788c53
docs(changeset): BREAKING: Removed ENSNODE_PUBLIC_URL, ENSADMIN_URL, …
shrugs 2fdb8f9
clean up port docs, closes #954
shrugs b3fe82d
fix react issues
shrugs ab78dac
Merge branch 'main' into fix/remove-ensadmin-loopback
shrugs 0bd0579
pr notes
shrugs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "ensindexer": minor | ||
| --- | ||
|
|
||
| BREAKING: Removed ENSNODE_PUBLIC_URL, ENSADMIN_URL, PORT configuration variables. PORT is still overridable, and defaults to Ponder's default (of 42069) as before. Removes "ENSAdmin Loopback" behavior when accessing ENSIndexer at '/'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import packageJson from "@/../package.json"; | ||
|
|
||
| import { db, publicClients } from "ponder:api"; | ||
| import config from "@/config"; | ||
|
|
||
| import { | ||
| fetchEnsRainbowVersion, | ||
| fetchFirstBlockToIndexByChainId, | ||
| fetchPonderStatus, | ||
| fetchPrometheusMetrics, | ||
| } from "@/lib/ponder-metadata-provider"; | ||
| import { ponderMetadata } from "@ensnode/ponder-metadata"; | ||
|
|
||
| import { Hono } from "hono"; | ||
|
|
||
| const app = new Hono(); | ||
|
|
||
| app.get( | ||
| ponderMetadata({ | ||
| app: { | ||
| name: packageJson.name, | ||
| version: packageJson.version, | ||
| }, | ||
| env: { | ||
| PLUGINS: config.plugins.join(","), | ||
| DATABASE_SCHEMA: config.databaseSchemaName, | ||
| NAMESPACE: config.namespace, | ||
| }, | ||
| db, | ||
| query: { | ||
| firstBlockToIndexByChainId: fetchFirstBlockToIndexByChainId, | ||
| prometheusMetrics: fetchPrometheusMetrics, | ||
| ensRainbowVersion: fetchEnsRainbowVersion, | ||
| ponderStatus: fetchPonderStatus, | ||
| }, | ||
| publicClients, | ||
| }), | ||
| ); | ||
|
|
||
| export default app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import { db, publicClients } from "ponder:api"; | ||
| import schema from "ponder:schema"; | ||
| import { Hono } from "hono"; | ||
| import { createDocumentationMiddleware } from "ponder-enrich-gql-docs-middleware"; | ||
|
|
||
| import config from "@/config"; | ||
| import { makeSubgraphApiDocumentation } from "@/lib/api-documentation"; | ||
| import { filterSchemaByPrefix } from "@/lib/filter-schema-by-prefix"; | ||
| import { fixContentLengthMiddleware } from "@/lib/fix-content-length-middleware"; | ||
| import { makePonderMetadataProvider } from "@/lib/ponder-metadata-provider"; | ||
| import { buildGraphQLSchema, subgraphGraphQLMiddleware } from "@ensnode/ponder-subgraph"; | ||
|
|
||
| import { makeDrizzle } from "@/api/lib/handlers/drizzle"; | ||
|
|
||
| // generate a subgraph-specific subset of the schema | ||
| const subgraphSchema = filterSchemaByPrefix("subgraph_", schema); | ||
| // and a drizzle db object that accesses it | ||
| const subgaphDrizzle = makeDrizzle({ | ||
| schema: subgraphSchema, | ||
| databaseUrl: config.databaseUrl, | ||
| databaseSchema: config.databaseSchemaName, | ||
| }); | ||
|
|
||
| const app = new Hono(); | ||
|
|
||
| // hotfix content length after documentation injection | ||
| app.use(fixContentLengthMiddleware); | ||
|
|
||
| // inject api documentation into graphql introspection requests | ||
| app.use(createDocumentationMiddleware(makeSubgraphApiDocumentation(), { path: "/subgraph" })); | ||
|
|
||
| // use our custom graphql middleware | ||
| app.use( | ||
| subgraphGraphQLMiddleware({ | ||
| drizzle: subgaphDrizzle, | ||
| graphqlSchema: buildGraphQLSchema({ | ||
| schema: subgraphSchema, | ||
| // provide PonderMetadataProvider to power `_meta` field | ||
| metadataProvider: makePonderMetadataProvider({ db, publicClients }), | ||
| // describes the polymorphic (interface) relationships in the schema | ||
| polymorphicConfig: { | ||
| types: { | ||
| DomainEvent: [ | ||
| subgraphSchema.transfer, | ||
| subgraphSchema.newOwner, | ||
| subgraphSchema.newResolver, | ||
| subgraphSchema.newTTL, | ||
| subgraphSchema.wrappedTransfer, | ||
| subgraphSchema.nameWrapped, | ||
| subgraphSchema.nameUnwrapped, | ||
| subgraphSchema.fusesSet, | ||
| subgraphSchema.expiryExtended, | ||
| ], | ||
| RegistrationEvent: [ | ||
| subgraphSchema.nameRegistered, | ||
| subgraphSchema.nameRenewed, | ||
| subgraphSchema.nameTransferred, | ||
| ], | ||
| ResolverEvent: [ | ||
| subgraphSchema.addrChanged, | ||
| subgraphSchema.multicoinAddrChanged, | ||
| subgraphSchema.nameChanged, | ||
| subgraphSchema.abiChanged, | ||
| subgraphSchema.pubkeyChanged, | ||
| subgraphSchema.textChanged, | ||
| subgraphSchema.contenthashChanged, | ||
| subgraphSchema.interfaceChanged, | ||
| subgraphSchema.authorisationChanged, | ||
| subgraphSchema.versionChanged, | ||
| ], | ||
| }, | ||
| fields: { | ||
| "Domain.events": "DomainEvent", | ||
| "Registration.events": "RegistrationEvent", | ||
| "Resolver.events": "ResolverEvent", | ||
| }, | ||
| }, | ||
| }), | ||
| }), | ||
| ); | ||
|
|
||
| export default app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.