Documentation ¶
Index ¶
Constants ¶
View Source
const ( Ext = ".tsd" ValDir = "validators" CheckDir = "checkpoints" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider stores all data in the filesystem We assume the same validator hash may be reused by many different headers/Checkpoints, and thus store it separately. This leaves us with three issues:
1. Given a validator hash, retrieve the validator set if previously stored 2. Given a block height, find the Checkpoint with the highest height <= h 3. Given a Seed, store it quickly to satisfy 1 and 2
Note that we do not worry about caching, as that can be achieved by pairing this with a MemStoreProvider and CacheProvider from certifiers
func NewProvider ¶
NewProvider creates the parent dir and subdirs for validators and checkpoints as needed
func (Provider) GetByHeight ¶
func (m Provider) GetByHeight(h int) (certifiers.Seed, error)
Click to show internal directories.
Click to hide internal directories.