powergate: github.com/textileio/powergate/chainsync Index | Files

package chainsync

import "github.com/textileio/powergate/chainsync"


Package Files


func ResolveBase Uses

func ResolveBase(ctx context.Context, api *apistruct.FullNodeStruct, left *types.TipSetKey, right types.TipSetKey) (*types.TipSetKey, []*types.TipSet, error)

ResolveBase returns the base TipSetKey that both left and right TipSetKey share, plus a Revert/Apply set of operations to get from last to new.

type ChainSync Uses

type ChainSync struct {
    // contains filtered or unexported fields

ChainSync provides methods to resolve chain syncing situations.

func New Uses

func New(clientBuilder lotus.ClientBuilder) *ChainSync

New returns a new ChainSync.

func (*ChainSync) Precedes Uses

func (cs *ChainSync) Precedes(ctx context.Context, from, to types.TipSetKey) (bool, error)

Precedes returns true if from and to don't live in different chain forks, and from is at a lower epoch than to.

Package chainsync imports 5 packages (graph) and is imported by 6 packages. Updated 2020-09-21. Refresh now. Tools for package owners.