Documentation
¶
Index ¶
- func NewAPIBlockstore(cio ChainIO) blockstore.Blockstore
- type AccountAPI
- type ActorAPI
- func (actorAPI *ActorAPI) ActorGetSignature(ctx context.Context, actorAddr address.Address, method abi.MethodNum) (vm.ActorMethodSignature, error)
- func (actorAPI *ActorAPI) ListActor(ctx context.Context) (map[address.Address]*types.Actor, error)
- func (actorAPI *ActorAPI) StateGetActor(ctx context.Context, actor address.Address, tsk block.TipSetKey) (*types.Actor, error)
- type BeaconAPI
- type BlockMessages
- type ChainAPI
- type ChainIO
- type ChainInfoAPI
- func (chainInfoAPI *ChainInfoAPI) BlockTime() time.Duration
- func (chainInfoAPI *ChainInfoAPI) ChainGetBlock(ctx context.Context, id cid.Cid) (*block.Block, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetBlockMessages(ctx context.Context, bid cid.Cid) (*BlockMessages, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetMessage(ctx context.Context, msgID cid.Cid) (*types.UnsignedMessage, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetRandomnessFromBeacon(ctx context.Context, key block.TipSetKey, ...) (abi.Randomness, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetRandomnessFromTickets(ctx context.Context, tsk block.TipSetKey, ...) (abi.Randomness, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetReceipts(ctx context.Context, id cid.Cid) ([]types.MessageReceipt, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetTipSet(key block.TipSetKey) (*block.TipSet, error)
- func (chainInfoAPI *ChainInfoAPI) ChainGetTipSetByHeight(ctx context.Context, height abi.ChainEpoch, tsk block.TipSetKey) (*block.TipSet, error)
- func (chainInfoAPI *ChainInfoAPI) ChainHead(ctx context.Context) (*block.TipSet, error)
- func (chainInfoAPI *ChainInfoAPI) ChainList(ctx context.Context, tsKey block.TipSetKey, count int) ([]block.TipSetKey, error)
- func (chainInfoAPI *ChainInfoAPI) ChainNotify(ctx context.Context) chan []*chain.HeadChange
- func (chainInfoAPI *ChainInfoAPI) ChainSetHead(ctx context.Context, key block.TipSetKey) error
- func (chainInfoAPI *ChainInfoAPI) GetActor(ctx context.Context, addr address.Address) (*types.Actor, error)
- func (chainInfoAPI *ChainInfoAPI) GetEntry(ctx context.Context, height abi.ChainEpoch, round uint64) (*block.BeaconEntry, error)
- func (chainInfoAPI *ChainInfoAPI) GetFullBlock(ctx context.Context, id cid.Cid) (*block.FullBlock, error)
- func (chainInfoAPI *ChainInfoAPI) MessageWait(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*cst.ChainMessage, error)
- func (chainInfoAPI *ChainInfoAPI) ProtocolParameters(ctx context.Context) (*ProtocolParams, error)
- func (chainInfoAPI *ChainInfoAPI) ResolveToKeyAddr(ctx context.Context, addr address.Address, ts *block.TipSet) (address.Address, error)
- func (chainInfoAPI *ChainInfoAPI) StateGetReceipt(ctx context.Context, msg cid.Cid, tsk block.TipSetKey) (*types.MessageReceipt, error)
- func (chainInfoAPI *ChainInfoAPI) StateNetworkName(ctx context.Context) (NetworkName, error)
- func (chainInfoAPI *ChainInfoAPI) StateNetworkVersion(ctx context.Context, tsk block.TipSetKey) (network.Version, error)
- func (chainInfoAPI *ChainInfoAPI) StateSearchMsg(ctx context.Context, mCid cid.Cid) (*cst.MsgLookup, error)
- func (chainInfoAPI *ChainInfoAPI) StateWaitMsg(ctx context.Context, mCid cid.Cid, confidence abi.ChainEpoch) (*cst.MsgLookup, error)
- func (chainInfoAPI *ChainInfoAPI) VerifyEntry(parent, child *block.BeaconEntry, height abi.ChainEpoch) bool
- type ChainSubmodule
- type DbAPI
- type Deadline
- type MarketBalance
- type MarketDeal
- type MinerSectors
- type MinerStateAPI
- func (minerStateAPI *MinerStateAPI) StateCirculatingSupply(ctx context.Context, tsk block.TipSetKey) (abi.TokenAmount, error)
- func (minerStateAPI *MinerStateAPI) StateListActors(ctx context.Context, tsk block.TipSetKey) ([]address.Address, error)
- func (minerStateAPI *MinerStateAPI) StateListMiners(ctx context.Context, tsk block.TipSetKey) ([]address.Address, error)
- func (minerStateAPI *MinerStateAPI) StateLookupID(ctx context.Context, addr address.Address, tsk block.TipSetKey) (address.Address, error)
- func (minerStateAPI *MinerStateAPI) StateMarketBalance(ctx context.Context, addr address.Address, tsk block.TipSetKey) (MarketBalance, error)
- func (minerStateAPI *MinerStateAPI) StateMarketDeals(ctx context.Context, tsk block.TipSetKey) (map[string]pstate.MarketDeal, error)
- func (minerStateAPI *MinerStateAPI) StateMarketStorageDeal(ctx context.Context, dealID abi.DealID, tsk block.TipSetKey) (*MarketDeal, error)
- func (minerStateAPI *MinerStateAPI) StateMinerActiveSectors(ctx context.Context, maddr address.Address, tsk block.TipSetKey) ([]*miner.SectorOnChainInfo, error)
- func (minerStateAPI *MinerStateAPI) StateMinerAvailableBalance(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (big.Int, error)
- func (minerStateAPI *MinerStateAPI) StateMinerDeadlines(ctx context.Context, maddr address.Address, tsk block.TipSetKey) ([]Deadline, error)
- func (minerStateAPI *MinerStateAPI) StateMinerFaults(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (bitfield.BitField, error)
- func (minerStateAPI *MinerStateAPI) StateMinerInfo(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (miner.MinerInfo, error)
- func (minerStateAPI *MinerStateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, ...) (big.Int, error)
- func (minerStateAPI *MinerStateAPI) StateMinerPartitions(ctx context.Context, maddr address.Address, dlIdx uint64, tsk block.TipSetKey) ([]Partition, error)
- func (minerStateAPI *MinerStateAPI) StateMinerPower(ctx context.Context, addr address.Address, tsk block.TipSetKey) (*power.MinerPower, error)
- func (minerStateAPI *MinerStateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, ...) (big.Int, error)
- func (minerStateAPI *MinerStateAPI) StateMinerProvingDeadline(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (*dline.Info, error)
- func (minerStateAPI *MinerStateAPI) StateMinerRecoveries(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (bitfield.BitField, error)
- func (minerStateAPI *MinerStateAPI) StateMinerSectorAllocated(ctx context.Context, maddr address.Address, s abi.SectorNumber, ...) (bool, error)
- func (minerStateAPI *MinerStateAPI) StateMinerSectorCount(ctx context.Context, addr address.Address, tsk block.TipSetKey) (MinerSectors, error)
- func (minerStateAPI *MinerStateAPI) StateMinerSectorSize(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (abi.SectorSize, error)
- func (minerStateAPI *MinerStateAPI) StateMinerSectors(ctx context.Context, maddr address.Address, sectorNos *bitfield.BitField, ...) ([]*miner.SectorOnChainInfo, error)
- func (minerStateAPI *MinerStateAPI) StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (address.Address, error)
- func (minerStateAPI *MinerStateAPI) StateSectorExpiration(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, ...) (*miner.SectorExpiration, error)
- func (minerStateAPI *MinerStateAPI) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, ...) (*miner.SectorOnChainInfo, error)
- func (minerStateAPI *MinerStateAPI) StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, ...) (*miner.SectorLocation, error)
- func (minerStateAPI *MinerStateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, ...) (miner.SectorPreCommitOnChainInfo, error)
- func (minerStateAPI *MinerStateAPI) StateVMCirculatingSupplyInternal(ctx context.Context, tsk block.TipSetKey) (chain.CirculatingSupply, error)
- type NetworkName
- type Partition
- type ProtocolParams
- type SectorInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIBlockstore ¶
func NewAPIBlockstore(cio ChainIO) blockstore.Blockstore
Types ¶
type AccountAPI ¶
type AccountAPI struct {
// contains filtered or unexported fields
}
func NewAccountAPI ¶
func NewAccountAPI(chain *ChainSubmodule) AccountAPI
func (*AccountAPI) StateAccountKey ¶
type ActorAPI ¶
type ActorAPI struct {
// contains filtered or unexported fields
}
func NewActorAPI ¶
func NewActorAPI(chain *ChainSubmodule) ActorAPI
func (*ActorAPI) ActorGetSignature ¶
func (actorAPI *ActorAPI) ActorGetSignature(ctx context.Context, actorAddr address.Address, method abi.MethodNum) (vm.ActorMethodSignature, error)
ActorGetSignature returns the signature of the given actor's given method. The function signature is typically used to enable a caller to decode the output of an actor method call (message).
type BeaconAPI ¶
type BeaconAPI struct {
// contains filtered or unexported fields
}
func NewBeaconAPI ¶
func NewBeaconAPI(chain *ChainSubmodule) BeaconAPI
func (*BeaconAPI) BeaconGetEntry ¶
func (beaconAPI *BeaconAPI) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*block.BeaconEntry, error)
type BlockMessages ¶
type BlockMessages struct { BlsMessages []*types.UnsignedMessage SecpkMessages []*types.SignedMessage Cids []cid.Cid }
BlsMessages[x].cid = Cids[x] SecpkMessages[y].cid = Cids[BlsMessages.length + y]
type ChainAPI ¶
type ChainAPI struct { AccountAPI ActorAPI BeaconAPI ChainInfoAPI DbAPI MinerStateAPI }
type ChainInfoAPI ¶
type ChainInfoAPI struct {
// contains filtered or unexported fields
}
func NewChainInfoAPI ¶
func NewChainInfoAPI(chain *ChainSubmodule) ChainInfoAPI
func (*ChainInfoAPI) BlockTime ¶
func (chainInfoAPI *ChainInfoAPI) BlockTime() time.Duration
todo think which module should this api belong BlockTime returns the block time used by the consensus protocol.
func (*ChainInfoAPI) ChainGetBlock ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetBlock(ctx context.Context, id cid.Cid) (*block.Block, error)
ChainGetBlock gets a block by CID
func (*ChainInfoAPI) ChainGetBlockMessages ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetBlockMessages(ctx context.Context, bid cid.Cid) (*BlockMessages, error)
ChainGetMessages gets a message collection by CID
func (*ChainInfoAPI) ChainGetMessage ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetMessage(ctx context.Context, msgID cid.Cid) (*types.UnsignedMessage, error)
func (*ChainInfoAPI) ChainGetRandomnessFromBeacon ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetRandomnessFromBeacon(ctx context.Context, key block.TipSetKey, personalization acrypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error)
func (*ChainInfoAPI) ChainGetRandomnessFromTickets ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetRandomnessFromTickets(ctx context.Context, tsk block.TipSetKey, personalization acrypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error)
func (*ChainInfoAPI) ChainGetReceipts ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetReceipts(ctx context.Context, id cid.Cid) ([]types.MessageReceipt, error)
ChainGetReceipts gets a receipt collection by CID
func (*ChainInfoAPI) ChainGetTipSet ¶
ChainTipSet returns the tipset at the given key
func (*ChainInfoAPI) ChainGetTipSetByHeight ¶
func (chainInfoAPI *ChainInfoAPI) ChainGetTipSetByHeight(ctx context.Context, height abi.ChainEpoch, tsk block.TipSetKey) (*block.TipSet, error)
ChainGetTipSetByHeight looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned.
func (*ChainInfoAPI) ChainList ¶
func (chainInfoAPI *ChainInfoAPI) ChainList(ctx context.Context, tsKey block.TipSetKey, count int) ([]block.TipSetKey, error)
ChainLs returns an iterator of tipsets from specified head by tsKey to genesis
func (*ChainInfoAPI) ChainNotify ¶
func (chainInfoAPI *ChainInfoAPI) ChainNotify(ctx context.Context) chan []*chain.HeadChange
************Drand****************// ChainNotify subscribe to chain head change event
func (*ChainInfoAPI) ChainSetHead ¶
ChainSetHead sets `key` as the new head of this chain iff it exists in the nodes chain store.
func (*ChainInfoAPI) GetEntry ¶
func (chainInfoAPI *ChainInfoAPI) GetEntry(ctx context.Context, height abi.ChainEpoch, round uint64) (*block.BeaconEntry, error)
GetEntry retrieves an entry from the drand server
func (*ChainInfoAPI) GetFullBlock ¶
func (*ChainInfoAPI) MessageWait ¶
func (chainInfoAPI *ChainInfoAPI) MessageWait(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*cst.ChainMessage, error)
MessageWait invokes the callback when a message with the given cid appears on chain. It will find the message in both the case that it is already on chain and the case that it appears in a newly mined block. An error is returned if one is encountered or if the context is canceled. Otherwise, it waits forever for the message to appear on chain.
func (*ChainInfoAPI) ProtocolParameters ¶
func (chainInfoAPI *ChainInfoAPI) ProtocolParameters(ctx context.Context) (*ProtocolParams, error)
ProtocolParameters return chain parameters
func (*ChainInfoAPI) ResolveToKeyAddr ¶
func (chainInfoAPI *ChainInfoAPI) ResolveToKeyAddr(ctx context.Context, addr address.Address, ts *block.TipSet) (address.Address, error)
ResolveToKeyAddr resolve user address to t0 address
func (*ChainInfoAPI) StateGetReceipt ¶
func (chainInfoAPI *ChainInfoAPI) StateGetReceipt(ctx context.Context, msg cid.Cid, tsk block.TipSetKey) (*types.MessageReceipt, error)
func (*ChainInfoAPI) StateNetworkName ¶
func (chainInfoAPI *ChainInfoAPI) StateNetworkName(ctx context.Context) (NetworkName, error)
func (*ChainInfoAPI) StateNetworkVersion ¶
func (*ChainInfoAPI) StateSearchMsg ¶
func (*ChainInfoAPI) StateWaitMsg ¶
func (chainInfoAPI *ChainInfoAPI) StateWaitMsg(ctx context.Context, mCid cid.Cid, confidence abi.ChainEpoch) (*cst.MsgLookup, error)
func (*ChainInfoAPI) VerifyEntry ¶
func (chainInfoAPI *ChainInfoAPI) VerifyEntry(parent, child *block.BeaconEntry, height abi.ChainEpoch) bool
VerifyEntry verifies that child is a valid entry if its parent is.
type ChainSubmodule ¶
type ChainSubmodule struct { ChainReader *chain.Store MessageStore *chain.MessageStore State *cst.ChainStateReadWriter Sampler *chain.Sampler ActorState *appstate.TipSetStateViewer Processor *consensus.DefaultProcessor StatusReporter *chain.StatusReporter Fork fork.IFork CheckPoint block.TipSetKey Drand beacon.Schedule // Wait for confirm message Waiter *cst.Waiter // contains filtered or unexported fields }
ChainSubmodule enhances the `Node` with chain capabilities.
func NewChainSubmodule ¶
func NewChainSubmodule(config chainConfig, repo chainRepo, blockstore *blockstore.BlockstoreSubmodule, verifier ffiwrapper.Verifier, ) (*ChainSubmodule, error)
NewChainSubmodule creates a new chain submodule.
func (*ChainSubmodule) API ¶
func (chain *ChainSubmodule) API() *ChainAPI
func (*ChainSubmodule) Start ¶
func (chain *ChainSubmodule) Start(ctx context.Context) error
Start loads the chain from disk.
func (*ChainSubmodule) Stop ¶
func (chain *ChainSubmodule) Stop(ctx context.Context)
type DbAPI ¶
type DbAPI struct {
// contains filtered or unexported fields
}
func NewDbAPI ¶
func NewDbAPI(chain *ChainSubmodule) DbAPI
func (*DbAPI) ChainExport ¶
ChainExport exports the chain from `head` up to and including the genesis block to `out`
func (*DbAPI) ChainHasObj ¶
type MarketDeal ¶
type MarketDeal struct { Proposal market.DealProposal State market.DealState }
type MinerSectors ¶
type MinerStateAPI ¶
type MinerStateAPI struct {
// contains filtered or unexported fields
}
func NewMinerStateAPI ¶
func NewMinerStateAPI(chain *ChainSubmodule) MinerStateAPI
func (*MinerStateAPI) StateCirculatingSupply ¶
func (minerStateAPI *MinerStateAPI) StateCirculatingSupply(ctx context.Context, tsk block.TipSetKey) (abi.TokenAmount, error)
func (*MinerStateAPI) StateListActors ¶
func (*MinerStateAPI) StateListMiners ¶
func (*MinerStateAPI) StateLookupID ¶
func (*MinerStateAPI) StateMarketBalance ¶
func (minerStateAPI *MinerStateAPI) StateMarketBalance(ctx context.Context, addr address.Address, tsk block.TipSetKey) (MarketBalance, error)
func (*MinerStateAPI) StateMarketDeals ¶
func (minerStateAPI *MinerStateAPI) StateMarketDeals(ctx context.Context, tsk block.TipSetKey) (map[string]pstate.MarketDeal, error)
func (*MinerStateAPI) StateMarketStorageDeal ¶
func (minerStateAPI *MinerStateAPI) StateMarketStorageDeal(ctx context.Context, dealID abi.DealID, tsk block.TipSetKey) (*MarketDeal, error)
func (*MinerStateAPI) StateMinerActiveSectors ¶
func (minerStateAPI *MinerStateAPI) StateMinerActiveSectors(ctx context.Context, maddr address.Address, tsk block.TipSetKey) ([]*miner.SectorOnChainInfo, error)
func (*MinerStateAPI) StateMinerAvailableBalance ¶
func (*MinerStateAPI) StateMinerDeadlines ¶
func (*MinerStateAPI) StateMinerFaults ¶
func (*MinerStateAPI) StateMinerInfo ¶
func (*MinerStateAPI) StateMinerInitialPledgeCollateral ¶
func (minerStateAPI *MinerStateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk block.TipSetKey) (big.Int, error)
func (*MinerStateAPI) StateMinerPartitions ¶
func (*MinerStateAPI) StateMinerPower ¶
func (minerStateAPI *MinerStateAPI) StateMinerPower(ctx context.Context, addr address.Address, tsk block.TipSetKey) (*power.MinerPower, error)
func (*MinerStateAPI) StateMinerPreCommitDepositForPower ¶
func (minerStateAPI *MinerStateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk block.TipSetKey) (big.Int, error)
func (*MinerStateAPI) StateMinerProvingDeadline ¶
func (*MinerStateAPI) StateMinerRecoveries ¶
func (*MinerStateAPI) StateMinerSectorAllocated ¶
func (minerStateAPI *MinerStateAPI) StateMinerSectorAllocated(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk block.TipSetKey) (bool, error)
func (*MinerStateAPI) StateMinerSectorCount ¶
func (minerStateAPI *MinerStateAPI) StateMinerSectorCount(ctx context.Context, addr address.Address, tsk block.TipSetKey) (MinerSectors, error)
func (*MinerStateAPI) StateMinerSectorSize ¶
func (minerStateAPI *MinerStateAPI) StateMinerSectorSize(ctx context.Context, maddr address.Address, tsk block.TipSetKey) (abi.SectorSize, error)
func (*MinerStateAPI) StateMinerSectors ¶
func (minerStateAPI *MinerStateAPI) StateMinerSectors(ctx context.Context, maddr address.Address, sectorNos *bitfield.BitField, tsk block.TipSetKey) ([]*miner.SectorOnChainInfo, error)
func (*MinerStateAPI) StateMinerWorkerAddress ¶
func (*MinerStateAPI) StateSectorExpiration ¶
func (minerStateAPI *MinerStateAPI) StateSectorExpiration(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk block.TipSetKey) (*miner.SectorExpiration, error)
func (*MinerStateAPI) StateSectorGetInfo ¶
func (minerStateAPI *MinerStateAPI) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk block.TipSetKey) (*miner.SectorOnChainInfo, error)
func (*MinerStateAPI) StateSectorPartition ¶
func (minerStateAPI *MinerStateAPI) StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk block.TipSetKey) (*miner.SectorLocation, error)
func (*MinerStateAPI) StateSectorPreCommitInfo ¶
func (minerStateAPI *MinerStateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk block.TipSetKey) (miner.SectorPreCommitOnChainInfo, error)
func (*MinerStateAPI) StateVMCirculatingSupplyInternal ¶
func (minerStateAPI *MinerStateAPI) StateVMCirculatingSupplyInternal(ctx context.Context, tsk block.TipSetKey) (chain.CirculatingSupply, error)
type NetworkName ¶
type NetworkName string
type Partition ¶
type Partition struct { AllSectors bitfield.BitField FaultySectors bitfield.BitField RecoveringSectors bitfield.BitField LiveSectors bitfield.BitField ActiveSectors bitfield.BitField }
type ProtocolParams ¶
type ProtocolParams struct { Network string BlockTime time.Duration SupportedSectors []SectorInfo }
ProtocolParams contains parameters that modify the filecoin nodes protocol
type SectorInfo ¶
type SectorInfo struct { Size abi.SectorSize MaxPieceSize abi.UnpaddedPieceSize }
SectorInfo provides information about a sector construction