store

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2019 License: Apache-2.0, MIT Imports: 25 Imported by: 58

Documentation

Index

Constants

View Source
const (
	HCRevert  = "revert"
	HCApply   = "apply"
	HCCurrent = "current"
)

Variables

This section is empty.

Functions

func NewChainRand

func NewChainRand(cs *ChainStore, blks []cid.Cid, bheight uint64) vm.Rand

func PutMessage

func PutMessage(bs bstore.Blockstore, m storable) (cid.Cid, error)

Types

type ChainMsg

type ChainMsg interface {
	Cid() cid.Cid
	VMMessage() *types.Message
	ToStorageBlock() (block.Block, error)
}

type ChainStore

type ChainStore struct {
	// contains filtered or unexported fields
}

func NewChainStore

func NewChainStore(bs bstore.Blockstore, ds dstore.Batching) *ChainStore

func (*ChainStore) AddBlock

func (cs *ChainStore) AddBlock(ctx context.Context, b *types.BlockHeader) error

func (*ChainStore) AddToTipSetTracker

func (cs *ChainStore) AddToTipSetTracker(b *types.BlockHeader) error

func (*ChainStore) Blockstore

func (cs *ChainStore) Blockstore() bstore.Blockstore

func (*ChainStore) Contains

func (cs *ChainStore) Contains(ts *types.TipSet) (bool, error)

func (*ChainStore) GetBlock

func (cs *ChainStore) GetBlock(c cid.Cid) (*types.BlockHeader, error)

func (*ChainStore) GetCMessage

func (cs *ChainStore) GetCMessage(c cid.Cid) (ChainMsg, error)

func (*ChainStore) GetGenesis

func (cs *ChainStore) GetGenesis() (*types.BlockHeader, error)

func (*ChainStore) GetHeaviestTipSet

func (cs *ChainStore) GetHeaviestTipSet() *types.TipSet

func (*ChainStore) GetMessage

func (cs *ChainStore) GetMessage(c cid.Cid) (*types.Message, error)

func (*ChainStore) GetParentReceipt

func (cs *ChainStore) GetParentReceipt(b *types.BlockHeader, i int) (*types.MessageReceipt, error)

func (*ChainStore) GetRandomness

func (cs *ChainStore) GetRandomness(ctx context.Context, blks []cid.Cid, round int64) ([]byte, error)

func (*ChainStore) GetSignedMessage

func (cs *ChainStore) GetSignedMessage(c cid.Cid) (*types.SignedMessage, error)

func (*ChainStore) GetTipsetByHeight

func (cs *ChainStore) GetTipsetByHeight(ctx context.Context, h uint64, ts *types.TipSet) (*types.TipSet, error)

func (*ChainStore) IsAncestorOf

func (cs *ChainStore) IsAncestorOf(a, b *types.TipSet) (bool, error)

returns true if 'a' is an ancestor of 'b'

func (*ChainStore) Load

func (cs *ChainStore) Load() error

func (*ChainStore) LoadMessagesFromCids

func (cs *ChainStore) LoadMessagesFromCids(cids []cid.Cid) ([]*types.Message, error)

func (*ChainStore) LoadSignedMessagesFromCids

func (cs *ChainStore) LoadSignedMessagesFromCids(cids []cid.Cid) ([]*types.SignedMessage, error)

func (*ChainStore) LoadTipSet

func (cs *ChainStore) LoadTipSet(cids []cid.Cid) (*types.TipSet, error)

func (*ChainStore) MaybeTakeHeavierTipSet

func (cs *ChainStore) MaybeTakeHeavierTipSet(ctx context.Context, ts *types.TipSet) error

func (*ChainStore) MessagesForBlock

func (cs *ChainStore) MessagesForBlock(b *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error)

func (*ChainStore) MessagesForTipset

func (cs *ChainStore) MessagesForTipset(ts *types.TipSet) ([]ChainMsg, error)

func (*ChainStore) NearestCommonAncestor

func (cs *ChainStore) NearestCommonAncestor(a, b *types.TipSet) (*types.TipSet, error)

func (*ChainStore) PersistBlockHeaders

func (cs *ChainStore) PersistBlockHeaders(b ...*types.BlockHeader) error

func (*ChainStore) PutMessage

func (cs *ChainStore) PutMessage(m storable) (cid.Cid, error)

func (*ChainStore) PutTipSet

func (cs *ChainStore) PutTipSet(ctx context.Context, ts *types.TipSet) error

func (*ChainStore) ReorgOps

func (cs *ChainStore) ReorgOps(a, b *types.TipSet) ([]*types.TipSet, []*types.TipSet, error)

func (*ChainStore) SetGenesis

func (cs *ChainStore) SetGenesis(b *types.BlockHeader) error

func (*ChainStore) SetHead

func (cs *ChainStore) SetHead(ts *types.TipSet) error

SetHead sets the chainstores current 'best' head node. This should only be called if something is broken and needs fixing

func (*ChainStore) SubHeadChanges

func (cs *ChainStore) SubHeadChanges(ctx context.Context) chan []*HeadChange

func (*ChainStore) SubscribeHeadChanges

func (cs *ChainStore) SubscribeHeadChanges(f func(rev, app []*types.TipSet) error)

func (*ChainStore) TryFillTipSet

func (cs *ChainStore) TryFillTipSet(ts *types.TipSet) (*FullTipSet, error)

func (*ChainStore) Weight

func (cs *ChainStore) Weight(ctx context.Context, ts *types.TipSet) (types.BigInt, error)

type FullTipSet

type FullTipSet struct {
	Blocks []*types.FullBlock
	// contains filtered or unexported fields
}

FullTipSet is an expanded version of the TipSet that contains all the blocks and messages

func NewFullTipSet

func NewFullTipSet(blks []*types.FullBlock) *FullTipSet

func (*FullTipSet) Cids

func (fts *FullTipSet) Cids() []cid.Cid

func (*FullTipSet) TipSet

func (fts *FullTipSet) TipSet() *types.TipSet

type HeadChange

type HeadChange struct {
	Type string
	Val  *types.TipSet
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL