Documentation
¶
Overview ¶
Package bootstrap checks for the bootstrap/fallback data update from the spacemesh administrator (a centralized entity controlled by the spacemesh team). This is intended as a short-term solution at the beginning of the network deployment to facilitate recovering from network failures and should be removed once the network is stable.
The updater periodically checks for the latest update from a URL provided by the spacemesh administrator, verifies the data, persists on disk and notifies subscribers of a new update.
Subscribers register by calling `Subscribe()` to receive a channel for the latest update.
Index ¶
Constants ¶
View Source
const ( DefaultURL = "http://localhost:3000/bootstrap" DirName = "bootstrap" )
Variables ¶
Functions ¶
func PersistFilename ¶
Types ¶
type Config ¶
type Config struct { URL string `mapstructure:"bootstrap-uri"` Version string `mapstructure:"bootstrap-version"` DataDir string Interval time.Duration NumToKeep int }
func DefaultConfig ¶
func DefaultConfig() Config
type EpochOverride ¶
type Opt ¶
type Opt func(*Updater)
func WithConfig ¶
func WithFilesystem ¶
func WithHttpClient ¶
func WithLogger ¶
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func (*Updater) Subscribe ¶
func (u *Updater) Subscribe() chan *VerifiedUpdate
type VerifiedUpdate ¶
type VerifiedUpdate struct { Persisted string ID uint32 Data []*EpochOverride }
func (*VerifiedUpdate) MarshalLogObject ¶
func (vd *VerifiedUpdate) MarshalLogObject(encoder log.ObjectEncoder) error
Click to show internal directories.
Click to hide internal directories.