Documentation ¶
Index ¶
- Variables
- func BlockstoreCopy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error
- func ExportSectors(ctx context.Context, store adt.Store, actorsIn *states.Tree) (chan *SectorInfo, error)
- func LoadCache(stateRoot cid.Cid) (*migration10.MemMigrationCache, error)
- func NewBlockstore(dstore ds.Batching) blockstore.Blockstore
- func NewTemporary() blockstore.Blockstore
- func NewTemporarySync() blockstore.Blockstore
- func PersistCache(stateRoot cid.Cid, cache *migration10.MemMigrationCache) error
- func V0TreeMinerBalances(ctx context.Context, store cbornode.IpldStore, stateRootIn cid.Cid) (map[address.Address]BalanceInfo, error)
- func WrapIDStore(bstore blockstore.Blockstore) blockstore.Blockstore
- type BalanceInfo
- type BeaconEntry
- type BlockHeader
- type BufferedBlockstore
- func (rb *BufferedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (rb *BufferedBlockstore) DeleteBlock(c cid.Cid) error
- func (rb *BufferedBlockstore) FlushFromBuffer(ctx context.Context, c cid.Cid) error
- func (rb *BufferedBlockstore) Get(c cid.Cid) (blocks.Block, error)
- func (rb *BufferedBlockstore) GetSize(c cid.Cid) (int, error)
- func (rb *BufferedBlockstore) Has(c cid.Cid) (bool, error)
- func (rb *BufferedBlockstore) HashOnRead(enabled bool)
- func (rb *BufferedBlockstore) LoadToReadOnlyBuffer(ctx context.Context, c cid.Cid) error
- func (rb *BufferedBlockstore) Put(b blocks.Block) error
- func (rb *BufferedBlockstore) PutMany(bs []blocks.Block) error
- type Chain
- func (c *Chain) FlushBufferedState(ctx context.Context, stateRoot cid.Cid) error
- func (c *Chain) LoadCborStore(ctx context.Context) (cbornode.IpldStore, error)
- func (c *Chain) LoadToReadOnlyBuffer(ctx context.Context, stateRoot cid.Cid) error
- func (c *Chain) NewChainStateIterator(ctx context.Context, tipCid cid.Cid) (*ChainStateIterator, error)
- type ChainStateIterator
- type ElectionProof
- type IterVal
- type MigrationLogger
- type SectorInfo
- type StateRoot
- type StateTreeVersion
- type Ticket
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 (*BufferedBlockstore) DeleteBlock ¶
func (rb *BufferedBlockstore) DeleteBlock(c cid.Cid) error
func (*BufferedBlockstore) FlushFromBuffer ¶
func (*BufferedBlockstore) HashOnRead ¶
func (rb *BufferedBlockstore) HashOnRead(enabled bool)
func (*BufferedBlockstore) LoadToReadOnlyBuffer ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) FlushBufferedState ¶
func (*Chain) LoadCborStore ¶
LoadCborStore loads the ~/.lotus chain datastore for chain traversal and state loading
func (*Chain) LoadToReadOnlyBuffer ¶
func (*Chain) NewChainStateIterator ¶
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 ¶
func (*ElectionProof) MarshalCBOR ¶
func (t *ElectionProof) MarshalCBOR(w io.Writer) error
func (*ElectionProof) UnmarshalCBOR ¶
func (t *ElectionProof) UnmarshalCBOR(r io.Reader) error
type MigrationLogger ¶
type MigrationLogger struct {
// contains filtered or unexported fields
}
func NewMigrationLogger ¶
func NewMigrationLogger(out io.Writer) *MigrationLogger
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 }
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 )