
High-performance Substreams indexer for ERC-8004 Trustless Agents on Base.

| Contract | Address | Events |
|---|---|---|
| IdentityRegistry | 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 |
Registered, Transfer, MetadataSet, URIUpdated |
| ReputationRegistry | 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63 |
NewFeedback, FeedbackRevoked, ResponseAppended |
| Module | Type | Description |
|---|---|---|
map_events |
map | Extracts all ERC-8004 events from both contracts |
store_agents |
store | Tracks agent owner, URI, and wallet state |
store_feedback_counts |
store | Aggregate feedback/response counts per agent |
store_reputation |
store | Running reputation scores per agent and tag |
db_out |
map | Produces DatabaseChanges for PostgreSQL/ClickHouse |
# Authenticate
substreams auth
# Build
substreams build
# Test with 1000 blocks
substreams run -s 25000000 -t +1000 map_events
# Visual debugger
substreams gui -s 25000000 -t +1000 map_events
docker compose up -d postgres
substreams-sink-sql setup "psql://erc8004:erc8004pass@localhost:5432/erc8004?sslmode=disable" ./erc8004-substreams-v0.1.0.spkg
substreams-sink-sql run "psql://erc8004:erc8004pass@localhost:5432/erc8004?sslmode=disable" ./erc8004-substreams-v0.1.0.spkg
docker compose up -d clickhouse
substreams-sink-sql setup "clickhouse://default:@localhost:9000/default" ./erc8004-substreams-v0.1.0.spkg
substreams-sink-sql run "clickhouse://default:@localhost:9000/default" ./erc8004-substreams-v0.1.0.spkg
The ClickHouse schema includes 6 materialized views for real-time analytics:
agents — Agent identities (owner, URI, wallet)agent_metadata — Key-value metadata per agentagent_transfers — Transfer historyfeedbacks — All feedback entries with scores and tagsresponses — Feedback responsesidentity_events — Raw IdentityRegistry event logreputation_events — Raw ReputationRegistry event logmake build # Build WASM + spkg
make run # Test run (1000 blocks)
make gui # Visual debugger
make docker-up # Start Postgres + ClickHouse + Grafana
make all-postgres # Full setup: build + setup + run PostgreSQL sink
make all-clickhouse # Full setup: build + setup + run ClickHouse sink
Extracts all ERC-8004 events from IdentityRegistry and ReputationRegistry contracts on Base. Covers agent registrations, transfers, metadata changes, feedback, revocations, and responses.
substreams gui erc8004-substreams@v0.1.0 map_eventsProduces DatabaseChanges for all ERC-8004 events and aggregated state. Powers both PostgreSQL and ClickHouse sinks.
substreams gui erc8004-substreams@v0.1.0 db_outTracks current agent state: owner address, URI, and wallet. Key format: agent:{agentId} → owner|uri|wallet
substreams gui erc8004-substreams@v0.1.0 store_agentsTracks total feedback count, active (non-revoked) count, and response count per agent. Keys: feedback_total:{agentId}, feedback_active:{agentId}, responses:{agentId}
substreams gui erc8004-substreams@v0.1.0 store_feedback_countsMaintains running reputation score aggregates per agent. Key: rep:{agentId} → sum_value|count|avg Also per-tag: rep:{agentId}:{tag1} → sum_value|count|avg
substreams gui erc8004-substreams@v0.1.0 store_reputationmessage
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
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
DatabaseChanges
message
TableChange
message
CompositePrimaryKey
message
Field
message
Service
message
DBTConfig
message
HasuraFrontend
message
PostgraphileFrontend
message
PGWebFrontend
message
RESTFrontend
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
Events
message
AgentRegistered
message
AgentTransfer
message
MetadataSet
message
URIUpdated
message
NewFeedback
message
FeedbackRevoked
message
ResponseAppended