A blockchain data processing pipeline for extracting, tracing, and processing Ethereum blockchain data (blocks, transactions, state changes, call traces, events), with uploads to S3 and Kafka publishing.
- Real-time block and transaction tracing via EVM hooks
- State diff tracking (balance, nonce, code, storage changes)
- Call stack tracing for all internal transactions
- Dual S3 bucket strategy for internal and external data
- Kafka notifications for block changes
- Leader election for high availability (manual or etcd-based)
- Multi-chain support: Ethereum, Scroll, XDC, Nitro (Arbitrum), L2geth
- Go 1.23+
- AWS credentials configured
- Kafka cluster (optional)
- etcd cluster (optional, for leader election)
go build ./...# All tests
go test ./...
# Specific package
go test -v ./types/...
go test -v ./util/...Pipeline supports two integration modes:
Mode 1: Live Tracer - Real-time tracing with automatic S3/Kafka upload
Block Execution → PipelineTracer → S3 Upload + Kafka Publish
Mode 2: RPC Tracer - On-demand tracing via trace_debankBlock RPC
RPC Request → Block Replay → RPCTracer → Return DebankOutPut
See docs/integration-modes.md for detailed documentation.
Embeds tracer into block processing, automatically uploads to S3 and publishes to Kafka.
import "github.com/Chaintable/pipeline/tracer"
// Initialize pipeline (S3 + Kafka)
tracer.InitPipeline(
region, // AWS region
nodeXBucket, // Internal S3 bucket
chainTableBucket, // External S3 bucket
brokers, // Kafka brokers
topic, // Kafka topic
bizChainID, // Chain ID
version, // Version
s3TmpDir, // Local temp directory for S3 uploads
)
// Optional: Setup leader election
tracer.SetupLeaderElection(
etcdEndpoints, // etcd endpoints
electionKey, // Election key path
nodeID, // Unique node ID
version, // Version
isBackup, // nil for auto election, true/false for manual
gracePeriod, // Grace period for leader transition
writerConfig, // Writer registry config (optional)
)
// Create tracer and register with EVM
pipelineTracer := tracer.NewPipelineTracer(configJSON)
// Register hooks: OnBlockStart, OnTxStart, OnCommit, etc.Implements trace_debankBlock RPC method, returns DebankOutPut containing BlockFile, Header, StateDiff.
import "github.com/Chaintable/pipeline/tracer"
// Implement RPC method
func (api *DebugAPI) TraceDebankBlock(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.DebankOutPut, error) {
// Create RPC tracer
rpcTracer := tracer.NewRPCTracer(configJSON)
// Replay block with tracer hooks
// ...
// Get complete output
return rpcTracer.GetOutPut(originRoot, root, destructs, accounts, storages, codes)
}
// DebankOutPut contains:
// - BlockFile: block, transactions, traces, events
// - Header: full block header
// - StateDiff: RLP-encoded state changes
// - ValidationHash: integrity checksumpipeline/
├── tracer/ # Block/transaction tracing (EVM hooks)
├── processor/ # Data serialization and upload
├── types/ # Core data structures
├── leader/ # Leader election (manual/etcd)
├── writer/ # Writer node registration
├── util/ # S3, Kafka, codec utilities
└── metrics/ # Observability metrics
Mode 1: Live Tracer
Ethereum Node (block execution)
↓
PipelineTracer (EVM hooks)
↓
CallTracer + PrestateTracer (traces, events, state diff)
↓
Processor (serialize to JSON/gzip + RLP)
↓
S3 Upload (dual bucket) + Kafka Publish (BlockChangeNotification)
Mode 2: RPC Tracer
RPC Request (trace_debankBlock)
↓
Block Replay with RPCTracer
↓
CallTracer + PrestateTracer (traces, events, state diff)
↓
Return DebankOutPut (BlockFile + Header + StateDiff + ValidationHash)
To integrate Pipeline into an execution client, follow the guide matching your client type:
| Guide | Client | When to Use |
|---|---|---|
| Standard Geth Adaptation | go-ethereum v1.14.0+ | Geth and forks with tracing.Hooks live tracer support |
| Legacy Geth Adaptation | go-ethereum < v1.14.0 | Older geth forks using the vm.EVMLogger interface (e.g., op-geth) |
| Reth Adaptation | Reth (Rust) | Rust-based clients; RPC Tracer only, no core EVM changes needed |
Is your client written in Rust?
YES → Reth Adaptation Guide
NO ↓
Does your geth fork have tracing.Hooks and tracers.LiveDirectory? (v1.14.0+)
YES → Standard Adaptation Guide
NO → Legacy Adaptation Guide
Key differences:
| Standard (Geth v1.14.0+) | Legacy (Geth < v1.14.0) | Reth | |
|---|---|---|---|
| Tracer interface | tracing.Hooks |
vm.EVMLogger |
revm-inspectors |
| Pipeline code | Go module dependency | Embedded Go source | Reimplemented in Rust |
| Integration mode | Live Tracer + RPC | Live Tracer | RPC only |
| Core EVM changes | Hook injection | Manual hook dispatch | None |
If you use Claude Code, you can use the interactive adaptation skills to have AI guide you through the entire process — auto-detecting your client type, exploring your codebase, generating modification code, and verifying each step.
- Install Claude Code
- Clone this Pipeline repository
- Have your target client repository ready locally
Open Claude Code in the Pipeline repository directory, then run:
/adapt-pipeline /path/to/your-client
This will:
- Detect your client type by scanning for
Cargo.toml,go.mod,tracing.Hooks,vm.EVMLogger, etc. - Report the detection result (language, client type, evidence)
- Check for existing Pipeline integration to avoid conflicts
- Route to the matching specialized skill automatically
> /adapt-pipeline /home/user/op-geth
## Detection Result
- Repository: /home/user/op-geth
- Language: Go
- Client Type: Legacy Geth
- Evidence: Found vm.EVMLogger in core/vm/logger.go, no core/tracing/hooks.go
- Recommended Skill: adapt-pipeline-legacy
Routing to /adapt-pipeline-legacy...
## Phase 1: Embed Pipeline Source Code
[AI reads your go.mod, copies pipeline/ directory, updates import paths...]
## Phase 2: Create Tracing Hooks
[AI creates core/tracing/hooks.go with custom hook types...]
...each phase: explore → reference → modify → verify (go build)...
| Skill | Target Client | Phases | What It Does |
|---|---|---|---|
/adapt-pipeline |
Any | — | Entry point: auto-detects client type and routes |
/adapt-pipeline-geth |
Geth v1.14.0+ | 7 | Extends tracing.Hooks, modifies StateDB/BlockChain, registers live tracer, adds RPC endpoint |
/adapt-pipeline-legacy |
Geth < v1.14.0 | 12 | Embeds pipeline source, creates hooks, manual dispatch, disables tracer in non-tracing paths |
/adapt-pipeline-reth |
Reth (Rust) | 7 | Reimplements types in Rust, adds StateDiffTraceDB, implements trace_debankBlock RPC |
You can also invoke a specialized skill directly if you already know your client type:
/adapt-pipeline-geth /path/to/geth-fork
/adapt-pipeline-legacy /path/to/op-geth
/adapt-pipeline-reth /path/to/reth-fork
Every phase follows the same interactive pattern:
- Explore — AI reads target files, searches for key patterns, understands existing structure
- Reference — AI consults the adaptation guide for code templates and requirements
- Modify — AI generates and applies changes tailored to your codebase
- Verify — Runs
go build ./...orcargo checkto ensure compilation passes
If a phase fails verification, AI will analyze the errors and fix them before moving on.
- go-ethereum v1.15.11 - Ethereum core types
- etcd client v3.5.10 - Leader election
- AWS SDK v2 - S3 operations
- kafka-go - Kafka publishing