Documentation ¶
Index ¶
- Constants
- Variables
- type GapFiller
- type GapIndexer
- type HeadEvent
- type HeadNotifier
- type TaskHeight
- type TipSetCache
- func (c *TipSetCache) Add(ts *types.TipSet) (*types.TipSet, error)
- func (c *TipSetCache) Confidence() int
- func (c *TipSetCache) Head() (*types.TipSet, error)
- func (c *TipSetCache) Height() abi.ChainEpoch
- func (c *TipSetCache) Len() int
- func (c *TipSetCache) Reset()
- func (c *TipSetCache) Revert(ts *types.TipSet) error
- func (c *TipSetCache) SetCurrent(ts *types.TipSet) error
- func (c *TipSetCache) Size() int
- func (c *TipSetCache) Tail() (*types.TipSet, error)
- func (c *TipSetCache) TailHeight() abi.ChainEpoch
- func (c *TipSetCache) Warm(ctx context.Context, head *types.TipSet, ...) error
- type TipSetObserver
- func (h *TipSetObserver) Apply(ctx context.Context, from, to *types.TipSet) error
- func (h *TipSetObserver) Cancel(err error)
- func (h *TipSetObserver) Err() error
- func (h *TipSetObserver) HeadEvents() <-chan *HeadEvent
- func (h *TipSetObserver) Revert(ctx context.Context, from, to *types.TipSet) error
- func (h *TipSetObserver) SetCurrent(ctx context.Context, ts *types.TipSet) error
- type Walker
- type Watcher
- type WatcherAPI
Constants ¶
const ( // HeadEventRevert indicates that the event signals a reversion of a tipset from the chain HeadEventRevert = "revert" // HeadEventRevert indicates that the event signals the application of a tipset to the chain HeadEventApply = "apply" // HeadEventRevert indicates that the event signals the current known head tipset HeadEventCurrent = "current" )
Constants for HeadEvent types
Variables ¶
Functions ¶
This section is empty.
Types ¶
type GapFiller ¶
func NewGapFiller ¶
type GapIndexer ¶
func NewGapIndexer ¶
func (*GapIndexer) Done ¶ added in v0.8.6
func (g *GapIndexer) Done() <-chan struct{}
func (*GapIndexer) Find ¶ added in v0.9.0
func (g *GapIndexer) Find(ctx context.Context) (visor.GapReportList, error)
type HeadNotifier ¶
type HeadNotifier interface { // HeadEvents returns a channel that receives head events. It may be closed // by the sender of the events, in which case Err will return a non-nil error // explaining why. HeadEvents may return nil if this implementation will never // notify any events. HeadEvents() <-chan *HeadEvent // Err returns the reason for the closing of the HeadEvents channel. Err() error }
A HeadNotifier reports tipset events that occur at the head of the chain
type TaskHeight ¶
type TipSetCache ¶
type TipSetCache struct {
// contains filtered or unexported fields
}
TipSetCache is a cache of recent tipsets that can keep track of reversions. Inspired by tipSetCache in Lotus chain/events package.
func NewTipSetCache ¶
func NewTipSetCache(size int) *TipSetCache
func (*TipSetCache) Add ¶
Add adds a new tipset which becomes the new head of the cache. If the buffer is full, the tail being evicted is also returned.
func (*TipSetCache) Confidence ¶ added in v0.8.2
func (c *TipSetCache) Confidence() int
Confidence returns the number of tipset that the cache must hold before tipsets are evicted on Add.
func (*TipSetCache) Head ¶
func (c *TipSetCache) Head() (*types.TipSet, error)
Head returns the tipset at the head of the cache.
func (*TipSetCache) Height ¶
func (c *TipSetCache) Height() abi.ChainEpoch
Height returns the height of the current head or zero if the cache is empty.
func (*TipSetCache) Len ¶
func (c *TipSetCache) Len() int
Len returns the number of tipsets in the cache. This will never exceed the size of the cache.
func (*TipSetCache) Revert ¶
func (c *TipSetCache) Revert(ts *types.TipSet) error
Revert removes the head tipset
func (*TipSetCache) SetCurrent ¶
func (c *TipSetCache) SetCurrent(ts *types.TipSet) error
SetCurrent replaces the current head
func (*TipSetCache) Size ¶
func (c *TipSetCache) Size() int
Size returns the maximum number of tipsets that may be present in the cache.
func (*TipSetCache) Tail ¶
func (c *TipSetCache) Tail() (*types.TipSet, error)
Tail returns the tipset at the tail of the cache.
func (*TipSetCache) TailHeight ¶
func (c *TipSetCache) TailHeight() abi.ChainEpoch
TailHeight returns the height of the current tail or zero if the cache is empty.
type TipSetObserver ¶
type TipSetObserver struct {
// contains filtered or unexported fields
}
func (*TipSetObserver) Cancel ¶ added in v0.9.0
func (h *TipSetObserver) Cancel(err error)
func (*TipSetObserver) Err ¶ added in v0.9.0
func (h *TipSetObserver) Err() error
func (*TipSetObserver) HeadEvents ¶ added in v0.9.0
func (h *TipSetObserver) HeadEvents() <-chan *HeadEvent
func (*TipSetObserver) SetCurrent ¶ added in v0.9.0
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker is a job that indexes blocks by walking the chain history.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is a task that indexes blocks by following the chain head.
func NewWatcher ¶
func NewWatcher(api WatcherAPI, indexer *indexer.Manager, name string, confidence int, poolSize int, bufferSize int) *Watcher
NewWatcher creates a new Watcher. confidence sets the number of tipsets that will be held in a cache awaiting possible reversion. Tipsets will be written to the database when they are evicted from the cache due to incoming later tipsets.
Directories ¶
Path | Synopsis |
---|---|
builtin
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/account
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/cron
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/init
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/market
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/miner
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/multisig
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/paych
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/power
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/reward
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
builtin/verifreg
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
policy
Code generated by: `make actors-gen`.
|
Code generated by: `make actors-gen`. |
Code generate by: `make tasks-gen`.
|
Code generate by: `make tasks-gen`. |