Documentation ¶
Overview ¶
Package files defines a Provider that stores all data in the filesystem
We assume the same validator hash may be reused by many different headers/Commits, and thus store it separately. This leaves us with three issues:
- Given a validator hash, retrieve the validator set if previously stored
- Given a block height, find the Commit with the highest height <= h
- Given a FullCommit, 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
Index ¶
- Constants
- func LoadFullCommit(path string) (certifiers.FullCommit, error)
- func LoadFullCommitJSON(path string) (certifiers.FullCommit, error)
- func NewProvider(dir string) certifiers.Provider
- func SaveFullCommit(fc certifiers.FullCommit, path string) error
- func SaveFullCommitJSON(fc certifiers.FullCommit, path string) error
Constants ¶
View Source
const ( Ext = ".tsd" ValDir = "validators" CheckDir = "checkpoints" )
View Source
const ( // MaxFullCommitSize is the maximum number of bytes we will // read in for a full commit to avoid excessive allocations // in the deserializer MaxFullCommitSize = 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func LoadFullCommit ¶
func LoadFullCommit(path string) (certifiers.FullCommit, error)
func LoadFullCommitJSON ¶
func LoadFullCommitJSON(path string) (certifiers.FullCommit, error)
func NewProvider ¶
func NewProvider(dir string) certifiers.Provider
NewProvider creates the parent dir and subdirs for validators and checkpoints as needed
func SaveFullCommit ¶
func SaveFullCommit(fc certifiers.FullCommit, path string) error
SaveFullCommit exports the seed in binary / go-wire style
func SaveFullCommitJSON ¶
func SaveFullCommitJSON(fc certifiers.FullCommit, path string) error
SaveFullCommitJSON exports the seed in a json format
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.