erigon-pulse/cl/persistence/interface.go
2023-08-22 01:24:26 +02:00

23 lines
553 B
Go

package persistence
import (
"context"
"github.com/ledgerwatch/erigon/cl/cltypes"
"github.com/ledgerwatch/erigon/cl/sentinel/peers"
)
type BlockSource interface {
GetRange(ctx context.Context, from uint64, count uint64) ([]*peers.PeeredObject[*cltypes.SignedBeaconBlock], error)
PurgeRange(ctx context.Context, from uint64, count uint64) error
}
type BeaconChainWriter interface {
WriteBlock(ctx context.Context, block *cltypes.SignedBeaconBlock, canonical bool) error
}
type BeaconChainDatabase interface {
BlockSource
BeaconChainWriter
}