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

Feat: ens subgraph #82

Merged
merged 4 commits into from
Mar 28, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- develop
pull_request:
# pull_request:
release:
types:
- released
Expand Down
79 changes: 79 additions & 0 deletions packages/ens-subgraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Graph cli generated
src/types
build/
.DS_STORE

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Built output
dist
build
generated

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
dist/


# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# intellij
.idea

/tests/.bin
/tests/.latest.json
3 changes: 3 additions & 0 deletions packages/ens-subgraph/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
91 changes: 91 additions & 0 deletions packages/ens-subgraph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# ENS Subgraph

This Subgraph sources events from the ENS contracts. This includes the ENS registry, the Auction Registrar, and any resolvers that are created and linked to domains. The resolvers are added through dynamic data sources. More information on all of this can be found at [The Graph Documentation](https://thegraph.com/docs/developer/quick-start/).

# Example Queries

Here we have example queries, so that you don't have to type them in yourself eachtime in the graphiql playground:

```graphql
{
domains {
id
labelName
labelhash
parent {
id
}
subdomains {
id
}
owner {
id
}
resolver {
id
}
ttl
}
resolvers {
id
address
domain {
id
}
events {
id
node
... on AddrChanged {
a
}
... on NameChanged {
name
}
... on AbiChanged {
contentType
}
... on PubkeyChanged {
x
y
}
... on TextChanged {
indexedKey
key
}
... on ContenthashChanged {
hash
}
... on InterfaceChanged {
interfaceID
implementer
}
... on AuthorisationChanged {
owner
target
isAuthorized
}
}
}
registrations(where: { labelName_not: null }, orderBy: expiryDate, orderDirection: asc, first: 10, skip: 0) {
expiryDate
labelName
domain{
name
labelName
}
}
}

```

# Build

1/ yarn codegen
2/ graph codegen && graph build

# Authenticate in CLI
graph auth --studio d2010a0f3e4eb8ccf9552d813066dcc1

# Deploy Subgraph
graph deploy --studio ens-sepolia

Loading