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(ponder-ens): introduce plugin architecture #3

Merged
merged 31 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dcc37b3
feat(ponder-ens): introduce plugin architecture
tk-o Dec 31, 2024
a5bfb00
feat(ponder-ens-plugin): update abis and contract configs
tk-o Jan 3, 2025
2578b0f
fix(ens-base-plugin): enalbe domain insert setup event
tk-o Jan 3, 2025
fae9508
feat(ponder-ens-plugin): include early adopter registrar contract
tk-o Jan 3, 2025
e1dad39
feat(ponder-ens-plugin): focus plugins around domain names
tk-o Jan 3, 2025
1931ec7
checkpoint: pull shared logic for registry and resolvers into shared …
shrugs Jan 3, 2025
3d181f9
feat: refactor plugin logic, DRY handler code
shrugs Jan 3, 2025
2d079a7
chore: inline some addreses
shrugs Jan 3, 2025
32912d5
refactor: DRY up registrar code
shrugs Jan 3, 2025
7f84cff
Merge pull request #4 from namehash/refactor/plugin-logic
shrugs Jan 3, 2025
a88933e
feat(ponder-ens-plugin): use domain name path as a namespace
tk-o Jan 3, 2025
7e5af0e
chore(ponder-ens-plugin): use biomejs formatter
tk-o Jan 3, 2025
cd152a6
fix: tidy registrar handlers
shrugs Jan 3, 2025
dc0bfdd
fix: handle preminted domain in base node
shrugs Jan 4, 2025
77c1ec2
fix(base.eth): handle `NameRegisteredWithRecord` event
tk-o Jan 4, 2025
ff0b2af
fix(deps): update ponder version
tk-o Jan 5, 2025
b3c17e5
fix: use selected root domain name
tk-o Jan 5, 2025
0e35dd8
refactor: rename consts to apply feedback
tk-o Jan 6, 2025
e5d7541
docs(base.eth): update readme
tk-o Jan 6, 2025
067f570
refactor(ponder-plugins): simplify architecture
tk-o Jan 7, 2025
e3b62c0
refactor(ponder-plugins): use `managed subname` term
tk-o Jan 7, 2025
aad651c
refactor(ponder-plugins): make generic handlers to use ponder types
tk-o Jan 7, 2025
00c9935
chore(code-style): apply `biome format --fix`
tk-o Jan 8, 2025
a39200f
fix(ci): run static analysis
tk-o Jan 8, 2025
9eb9eef
refactor(plugins): rename plugins directory
tk-o Jan 8, 2025
728ec62
refactor(plugins): rename plugin helpers
tk-o Jan 8, 2025
7c4bc1e
refactor(plugins): rename plugin helpers file
tk-o Jan 8, 2025
9891ed0
refactor(plugins): rename ponder plugins to just plugins
tk-o Jan 8, 2025
7b81161
refactor(plugins): drop the ACTIVE_PLUGIN env var parser
tk-o Jan 8, 2025
1dbe2a9
refactor(plugins): use `ownedSubname` name
tk-o Jan 8, 2025
cc6f2c3
refactor(plugins): rename `ownedSubname` to `ownedName`
tk-o Jan 8, 2025
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
15 changes: 15 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# RPC urls, follow the format RPC_URL_{chainId}={rpcUrl}

PONDER_RPC_URL_1=https://ethereum-rpc.publicnode.com
PONDER_RPC_URL_8453=https://base-rpc.publicnode.com
PONDER_RPC_URL_59144=https://linea-rpc.publicnode.com

# ponder indexer ens deployment configuration
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# ponder indexer ens deployment configuration
# Identify which ENS indexer plugin to activate.

Can we please add more docs here? For example? Does this value always need to be a single value, or can it be multiple values? If it can be multiple values, how to format it? It can also be nice to document which values are supported here or perhaps in the overall README.md.

Copy link
Member

Choose a reason for hiding this comment

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

@tk-o This is still an open feedback


ENS_DEPLOYMENT_CHAIN_ID=1

# ponder indexer database configuration

## one schema name per chain ID, i.e. ponder_ens_${ENS_DEPLOYMENT_CHAIN_ID}
DATABASE_SCHEMA=ponder_ens_1
DATABASE_URL=postgresql://dbuser:abcd1234@localhost:5432/my_database
16 changes: 15 additions & 1 deletion ponder.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
import { createConfig } from "ponder";
import { config as ethereumConfig} from "./src/ponder-ens-plugins/ethereum/ponder.config";
import { config as baseConfig } from "./src/ponder-ens-plugins/base/ponder.config";
import { config as ethereumConfig } from "./src/ponder-ens-plugins/ethereum/ponder.config";

console.log({
networks: {
...baseConfig.networks,
...ethereumConfig.networks,
},
contracts: {
...baseConfig.contracts,
...ethereumConfig.contracts,
},
})

export default createConfig({
networks: {
...baseConfig.networks,
...ethereumConfig.networks,
},
contracts: {
...baseConfig.contracts,
...ethereumConfig.contracts,
},
});
1 change: 1 addition & 0 deletions src/lib/ens-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { type Hex, concat, keccak256, namehash, toHex } from "viem";
// TODO: pull from ens utils lib or something
export const NAMEHASH_ZERO = namehash("");
export const NAMEHASH_ETH = namehash("eth");
export const NAMEHASH_BASE_ETH = namehash("base.eth");

// TODO: this should probably be a part of some ens util lib
export const makeSubnodeNamehash = (node: Hex, label: Hex) => keccak256(concat([node, label]));
Expand Down
9 changes: 9 additions & 0 deletions src/ponder-ens-plugins/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Base ENS plugin for Ponder indexer

This plugin contains configuration required to run blockchain indexing with [the Ponder app](https://ponder.sh/). It includes relevant ABI files, contract addresses and the block numbers those contracts were deployed at on a selected network.

## Architecture

The Base implementation for ENS protocol has custom naming convention, which was described here:
https://github.com/base-org/basenames?tab=readme-ov-file#architecture

Loading