Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading