Skip to content

Commit

Permalink
Feat: ens subgraph (#82)
Browse files Browse the repository at this point in the history
* feat: add ens subgraph

* chore: update ens-subgraph readme

* fix: fix docker build

* chore: disable docker build for now
  • Loading branch information
wantedsystem authored Mar 28, 2024
1 parent 897e900 commit f972247
Show file tree
Hide file tree
Showing 35 changed files with 13,327 additions and 6 deletions.
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

0 comments on commit f972247

Please sign in to comment.