mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
8d8368091c
This PR adds beacon blocks snapshots for the following chains: * Mainnet snapshots * Sepolia snapshots
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package persistence
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
"github.com/ledgerwatch/erigon-lib/kv"
|
|
"github.com/ledgerwatch/erigon/cl/cltypes"
|
|
"github.com/ledgerwatch/erigon/cl/sentinel/peers"
|
|
)
|
|
|
|
type BlockSource interface {
|
|
GetRange(ctx context.Context, tx kv.Tx, from uint64, count uint64) (*peers.PeeredObject[[]*cltypes.SignedBeaconBlock], error)
|
|
PurgeRange(ctx context.Context, tx kv.Tx, from uint64, count uint64) error
|
|
GetBlock(ctx context.Context, tx kv.Tx, slot uint64) (*peers.PeeredObject[*cltypes.SignedBeaconBlock], error)
|
|
}
|
|
|
|
type BeaconChainWriter interface {
|
|
WriteBlock(ctx context.Context, tx kv.RwTx, block *cltypes.SignedBeaconBlock, canonical bool) error
|
|
}
|
|
|
|
type RawBeaconBlockChain interface {
|
|
BlockWriter(ctx context.Context, slot uint64, blockRoot libcommon.Hash) (io.WriteCloser, error)
|
|
BlockReader(ctx context.Context, slot uint64, blockRoot libcommon.Hash) (io.ReadCloser, error)
|
|
DeleteBlock(ctx context.Context, slot uint64, blockRoot libcommon.Hash) error
|
|
}
|
|
|
|
type BeaconChainDatabase interface {
|
|
BlockSource
|
|
BeaconChainWriter
|
|
}
|