Caplin is Erigon's embedded Beacon Chain client implementing Ethereum's proof-of-stake consensus.
| Directory | Purpose |
|---|---|
beacon/ |
Beacon API HTTP handlers |
phase1/forkchoice/ |
LMD-GHOST fork choice |
phase1/execution_client/ |
Engine API bridge |
phase1/core/state/ |
Beacon state machine |
phase1/network/ |
Gossip handlers |
cltypes/ |
Consensus types (blocks, attestations) |
sentinel/ |
libp2p P2P networking |
pool/ |
Operations pools (attestations, slashings) |
validator/ |
Attestation producer |
forkchoice.go- LMD-GHOST implementationon_block.go- Block processingon_attestation.go- Attestation handling- Tracks finality and justification checkpoints
Bridge to execution layer:
NewPayload- Receive blocks from consensusForkchoiceUpdated- Set canonical headGetPayload- Request block for building
- State machine with fork upgrades (Altair, Bellatrix, Capella, Deneb)
- Validator registry management
- Epoch processing
- libp2p-based P2P networking
- GossipSub for block/attestation propagation
- Peer scoring and discovery
REST API endpoints:
- Block production and validation
- Validator duties
- Chain state queries
- Node status
# Caplin enabled by default (--internalcl)
./build/bin/erigon --datadir=./data
# Use external consensus client
./build/bin/erigon --externalcl --datadir=./data# Enable historical state/block storage
./build/bin/erigon --caplin.archive --datadir=./data