lib

package
v0.0.0-...-bf93e6c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EntCachePath = "~/.ent/cache/"

persist and load migration caches

Functions

func BlockstoreCopy

func BlockstoreCopy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error

func ExportSectors

func ExportSectors(ctx context.Context, store adt.Store, actorsIn *states.Tree) (chan *SectorInfo, error)

ExportSectors returns a channel iterating over all sector infos in miner actor state

func LoadCache

func LoadCache(stateRoot cid.Cid) (*migration10.MemMigrationCache, error)

func NewBlockstore

func NewBlockstore(dstore ds.Batching) blockstore.Blockstore

NewBlockstore creates a new blockstore wrapped by the given datastore.

func NewTemporary

func NewTemporary() blockstore.Blockstore

NewTemporary returns a temporary blockstore.

func NewTemporarySync

func NewTemporarySync() blockstore.Blockstore

NewTemporarySync returns a thread-safe temporary blockstore.

func PersistCache

func PersistCache(stateRoot cid.Cid, cache *migration10.MemMigrationCache) error

func V0TreeMinerBalances

func V0TreeMinerBalances(ctx context.Context, store cbornode.IpldStore, stateRootIn cid.Cid) (map[address.Address]BalanceInfo, error)

V0TreeMinerBalancse returns a map of every miner's balance info at the provided state tree. It is used for displaying and validating miner info.

func WrapIDStore

func WrapIDStore(bstore blockstore.Blockstore) blockstore.Blockstore

WrapIDStore wraps the underlying blockstore in an "identity" blockstore.

Types

type BalanceInfo

type BalanceInfo struct {
	Balance           abi.TokenAmount
	LockedFunds       abi.TokenAmount
	InitialPledge     abi.TokenAmount
	PreCommitDeposits abi.TokenAmount
}

type BeaconEntry

type BeaconEntry struct {
	Round uint64
	Data  []byte
}

func (*BeaconEntry) MarshalCBOR

func (t *BeaconEntry) MarshalCBOR(w io.Writer) error

func (*BeaconEntry) UnmarshalCBOR

func (t *BeaconEntry) UnmarshalCBOR(r io.Reader) error

type BlockHeader

type BlockHeader struct {
	Miner address.Address // 0

	Ticket *Ticket // 1

	ElectionProof *ElectionProof // 2

	BeaconEntries []BeaconEntry // 3

	WinPoStProof []proof2.PoStProof // 4

	Parents []cid.Cid // 5

	ParentWeight big.Int // 6

	Height abi.ChainEpoch // 7

	ParentStateRoot cid.Cid // 8

	ParentMessageReceipts cid.Cid // 8

	Messages cid.Cid // 10

	BLSAggregate *crypto.Signature // 11

	Timestamp uint64 // 12

	BlockSig *crypto.Signature // 13

	ForkSignaling uint64 // 14

	// ParentBaseFee is the base fee after executing parent tipset
	ParentBaseFee abi.TokenAmount // 15
	// contains filtered or unexported fields
}

func DecodeBlock

func DecodeBlock(b []byte) (*BlockHeader, error)

func (*BlockHeader) MarshalCBOR

func (t *BlockHeader) MarshalCBOR(w io.Writer) error

func (*BlockHeader) UnmarshalCBOR

func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error

type BufferedBlockstore

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

BufferedBlockstore pushes all writes to an in memory cache blockstore and reads through this cache into a slower lotus blockstore backed by an on disk repo. It has an extra method for flushing data from the in memory blockstore to a third on disk badger datastore backed blockstore.

func NewBufferedBlockstore

func NewBufferedBlockstore(readLotusPath, writeEntPath string) (*BufferedBlockstore, error)

func (*BufferedBlockstore) AllKeysChan

func (rb *BufferedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

func (*BufferedBlockstore) DeleteBlock

func (rb *BufferedBlockstore) DeleteBlock(c cid.Cid) error

func (*BufferedBlockstore) FlushFromBuffer

func (rb *BufferedBlockstore) FlushFromBuffer(ctx context.Context, c cid.Cid) error

func (*BufferedBlockstore) Get

func (rb *BufferedBlockstore) Get(c cid.Cid) (blocks.Block, error)

func (*BufferedBlockstore) GetSize

func (rb *BufferedBlockstore) GetSize(c cid.Cid) (int, error)

func (*BufferedBlockstore) Has

func (rb *BufferedBlockstore) Has(c cid.Cid) (bool, error)

func (*BufferedBlockstore) HashOnRead

func (rb *BufferedBlockstore) HashOnRead(enabled bool)

func (*BufferedBlockstore) LoadToReadOnlyBuffer

func (rb *BufferedBlockstore) LoadToReadOnlyBuffer(ctx context.Context, c cid.Cid) error

func (*BufferedBlockstore) Put

func (rb *BufferedBlockstore) Put(b blocks.Block) error

func (*BufferedBlockstore) PutMany

func (rb *BufferedBlockstore) PutMany(bs []blocks.Block) error

type Chain

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

func (*Chain) FlushBufferedState

func (c *Chain) FlushBufferedState(ctx context.Context, stateRoot cid.Cid) error

func (*Chain) LoadCborStore

func (c *Chain) LoadCborStore(ctx context.Context) (cbornode.IpldStore, error)

LoadCborStore loads the ~/.lotus chain datastore for chain traversal and state loading

func (*Chain) LoadToReadOnlyBuffer

func (c *Chain) LoadToReadOnlyBuffer(ctx context.Context, stateRoot cid.Cid) error

func (*Chain) NewChainStateIterator

func (c *Chain) NewChainStateIterator(ctx context.Context, tipCid cid.Cid) (*ChainStateIterator, error)

type ChainStateIterator

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

ChainStateIterator moves from tip to genesis emiting parent state roots of blocks

func (*ChainStateIterator) Done

func (it *ChainStateIterator) Done() bool

func (*ChainStateIterator) Step

func (it *ChainStateIterator) Step(ctx context.Context) error

Moves iterator backwards towards genesis. Noop at genesis

func (*ChainStateIterator) Val

func (it *ChainStateIterator) Val() IterVal

Return the parent state root and parent height of the current block

type ElectionProof

type ElectionProof struct {
	WinCount int64
	VRFProof []byte
}

func (*ElectionProof) MarshalCBOR

func (t *ElectionProof) MarshalCBOR(w io.Writer) error

func (*ElectionProof) UnmarshalCBOR

func (t *ElectionProof) UnmarshalCBOR(r io.Reader) error

type IterVal

type IterVal struct {
	Height int64
	State  cid.Cid
}

type MigrationLogger

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

func NewMigrationLogger

func NewMigrationLogger(out io.Writer) *MigrationLogger

func (*MigrationLogger) Log

func (m *MigrationLogger) Log(level rt.LogLevel, msg string, args ...interface{})

type SectorInfo

type SectorInfo struct {
	Sector *miner.SectorOnChainInfo
	Status string
}

type StateRoot

type StateRoot struct {
	// State tree version.
	Version StateTreeVersion
	// Actors tree. The structure depends on the state root version.
	Actors cid.Cid
	// Info. The structure depends on the state root version.
	Info cid.Cid
}

func (*StateRoot) MarshalCBOR

func (t *StateRoot) MarshalCBOR(w io.Writer) error

func (*StateRoot) UnmarshalCBOR

func (t *StateRoot) UnmarshalCBOR(r io.Reader) error

type StateTreeVersion

type StateTreeVersion uint64

StateTreeVersion is the version of the state tree itself, independent of the network version or the actors version.

const (
	// StateTreeVersion0 corresponds to actors < v2.
	StateTreeVersion0 StateTreeVersion = iota
	// StateTreeVersion1 corresponds to actors >= v2.
	StateTreeVersion1
)

type Ticket

type Ticket struct {
	VRFProof []byte
}

func (*Ticket) MarshalCBOR

func (t *Ticket) MarshalCBOR(w io.Writer) error

func (*Ticket) UnmarshalCBOR

func (t *Ticket) UnmarshalCBOR(r io.Reader) error

Jump to

Keyboard shortcuts

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