Documentation
¶
Overview ¶
Package tracker is the host's chain tracker: overlay-bridge's header store, read over the bridge's header API (default :9178) through the bridge's own Go client, with the two questions every admission asks answered from memory for a moment.
The engine, the SPV verifier and the root reconciler all read this one tracker (ruling #55: the tracker is injected everywhere and asserted non-nil at startup).
Index ¶
- Variables
- type Bridge
- func (b *Bridge) CurrentHeight(ctx context.Context) (uint32, error)
- func (b *Bridge) FreshHeight(ctx context.Context) (uint32, error)
- func (b *Bridge) IsValidRootForHeight(ctx context.Context, root *chainhash.Hash, height uint32) (bool, error)
- func (b *Bridge) RootAt(ctx context.Context, height uint32) (*chainhash.Hash, error)
- type Timed
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownHeight = errors.New("tracker: height not in the header store")
ErrUnknownHeight means the header store does not hold that height yet.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge is a chain tracker backed by an overlay-bridge header API.
func NewBridge ¶
NewBridge reads the header API at base (an origin such as http://127.0.0.1:9178). A tip is reused for a second and a root that verified for thirty seconds, as on the TypeScript host; a root the store did not know is never cached, because it may be known a moment later.
func (*Bridge) CurrentHeight ¶
CurrentHeight implements chaintracker.ChainTracker.
func (*Bridge) FreshHeight ¶
FreshHeight asks the store for its tip, never from the cache.
func (*Bridge) IsValidRootForHeight ¶
func (b *Bridge) IsValidRootForHeight(ctx context.Context, root *chainhash.Hash, height uint32) (bool, error)
IsValidRootForHeight implements chaintracker.ChainTracker.
type Timed ¶
type Timed struct {
Inner chaintracker.ChainTracker
// contains filtered or unexported fields
}
Timed wraps a tracker and adds the time spent in it to a running total, so a verification's merkle/root share can be told apart from its scripts.
func (*Timed) CurrentHeight ¶
CurrentHeight implements chaintracker.ChainTracker.