A Substreams package for indexing Base Name Service (Base's ENS-compatible naming system) on the Base network.
# Build the Substreams package
cargo build --target wasm32-unknown-unknown --release
# Generate protobuf code
cargo build
# Deploy to The Graph's Substreams Sink
substreams deploy \
--package-path substreams.yaml \
--endpoint https://base.substreams.pinax.network:443 \
--network base \
--start-block 0
# Deploy to Graph Studio for GraphQL API
graph deploy \
--product hosted-service \
--node https://api.studio.thegraph.com/deploy/ \
--ipfs https://api.thegraph.com/ipfs/ \
base-names-substreams
The Substreams package indexes events from these Base Name Service contracts:
0x03c4738ee98ae44591e1a4a4f3cab6641d95dd9a
0x4ccb0bb02fcaba27e82a56646e81d8c5bc4119a5
0x79ea96012eea67a83431f1701b3dff7e37f9e282
0xb94704422c2a1e396835a571837aa5ae53285a95
NewOwner
: Domain ownership transfersNewResolver
: Resolver contract assignmentsNewTTL
: TTL updatesNameRegistered
: New domain registrationsNameRenewed
: Domain renewalsTransfer
: NFT transfersNameRegistered
: Registration events from controllerNameRenewed
: Renewal events from controllerReverseClaimed
: Reverse resolution claimsCompared to traditional subgraphs:
# Base network RPC (optional - Substreams handles this)
BASE_RPC_URL=https://mainnet.base.org
# Substreams endpoint
SUBSTREAMS_ENDPOINT=https://base.substreams.pinax.network:443
The package starts indexing from block 0 to capture all historical Base Name Service data.
{
domains(first: 10) {
id
name
labelName
owner
resolver
}
}
{
registrations(first: 10) {
id
domain {
id
name
}
registrationDate
expiryDate
registrant
}
}
{
reverseRegistrations(first: 10) {
id
domain {
id
name
}
address
}
}
# Run locally with Substreams GUI
substreams gui substreams.yaml map_registry_events
# Test with sample data
substreams run substreams.yaml map_registry_events \
--start-block 18000000 \
--end-block 18000100
src/lib.rs
MIT License - see LICENSE file for details.
substreams gui base-names@v0.1.0 map_registry_events
substreams gui base-names@v0.1.0 map_registrar_events
substreams gui base-names@v0.1.0 map_controller_events
substreams gui base-names@v0.1.0 map_reverse_events
message
Modules
message
Binary
message
Module
message
Package
message
NetworkParams
message
PackageMetadata
message
ModuleMetadata
message
Clock
message
BlockRef
message
Request
message
Response
message
BlockUndoSignal
message
BlockScopedData
message
SessionInit
message
InitialSnapshotComplete
message
InitialSnapshotData
message
MapModuleOutput
message
StoreModuleOutput
message
OutputDebugInfo
message
ModulesProgress
message
ProcessedBytes
message
Error
message
Job
message
Stage
message
ModuleStats
message
ExternalCallMetric
message
StoreDelta
message
BlockRange
message
DeployRequest
message
Parameter
message
DeployResponse
message
UpdateRequest
message
UpdateResponse
message
InfoRequest
message
InfoResponse
message
SinkProgress
message
PackageInfo
message
ListRequest
message
ListResponse
message
DeploymentWithStatus
message
RemoveRequest
message
RemoveResponse
message
PauseRequest
message
PauseResponse
message
StopRequest
message
StopResponse
message
ResumeRequest
message
ResumeResponse
enum
DeploymentStatus
message
RegistryEvents
message
NewOwner
message
NewResolver
message
NewTTL
message
RegistrarEvents
message
NameRegistered
message
NameRenewed
message
Transfer
message
ControllerEvents
message
ReverseEvents
message
ReverseClaimed
message
Domain
message
Registration
message
ReverseRegistration
message
FileDescriptorSet
message
FileDescriptorProto
message
DescriptorProto
message
ExtensionRangeOptions
message
FieldDescriptorProto
message
OneofDescriptorProto
message
EnumDescriptorProto
message
EnumValueDescriptorProto
message
ServiceDescriptorProto
message
MethodDescriptorProto
message
FileOptions
message
MessageOptions
message
FieldOptions
message
OneofOptions
message
EnumOptions
message
EnumValueOptions
message
ServiceOptions
message
MethodOptions
message
UninterpretedOption
message
SourceCodeInfo
message
GeneratedCodeInfo
message
Any
message
Timestamp