diff --git a/database/database.go b/database/database.go index 182699949b3d..9d0c9128a839 100644 --- a/database/database.go +++ b/database/database.go @@ -94,3 +94,21 @@ type Database interface { io.Closer health.Checker } + +// BlockDatabase defines the interface for storing and retrieving blockchain blocks. +type BlockDatabase interface { + // WriteBlock inserts a block into the store at the given height. + WriteBlock(height uint64, block []byte) error + + // ReadBlock retrieves a block by its height. + ReadBlock(height uint64) ([]byte, error) + + // HasBlock checks if a block exists at the given height. + HasBlock(height uint64) (bool, error) + + // Inspect returns a detailed report of the block database. + Inspect() (string, error) + + // Close closes the block database. + io.Closer +}