filclient

package
v0.0.0-...-d0a0e58 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyTSK = TipSetKey{}

Functions

This section is empty.

Types

type DealProposal

type DealProposal struct {
	PieceCID             cid.Cid
	PieceSize            abi.PaddedPieceSize
	VerifiedDeal         bool
	Client               address.Address
	Provider             address.Address
	Label                string
	StartEpoch           abi.ChainEpoch
	EndEpoch             abi.ChainEpoch
	StoragePricePerEpoch abi.TokenAmount
	ProviderCollateral   abi.TokenAmount
	ClientCollateral     abi.TokenAmount
}

type DealState

type DealState struct {
	SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
	LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
	SlashEpoch       abi.ChainEpoch // -1 if deal never slashed
}

type FilClient

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

func NewFileClient

func NewFileClient(filecoinApi string) *FilClient

func (*FilClient) ChainGetTipSetByHeight

func (fc *FilClient) ChainGetTipSetByHeight(ctx context.Context, height abi.ChainEpoch, tsk TipSetKey) (ts *TipSet, err 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 (*FilClient) ChainHead

func (fc *FilClient) ChainHead(ctx context.Context) (ts *TipSet, err error)

ChainHead returns the current head of the chain.

func (*FilClient) StateAccountKey

func (fc *FilClient) StateAccountKey(ctx context.Context, addressId address.Address, tsk TipSetKey) (addr address.Address, err error)

StateAccountKey returns the public key address of the given ID address

func (*FilClient) StateLookupID

func (fc *FilClient) StateLookupID(ctx context.Context, addr address.Address, tsk TipSetKey) (addressId address.Address, err error)

StateLookupID retrieves the ID address of the given address

func (*FilClient) StateMarketStorageDeal

func (fc *FilClient) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk TipSetKey) (deal *MarketDeal, err error)

StateMarketStorageDeal returns information about the indicated deal

func (*FilClient) StateMinerInfo

func (fc *FilClient) StateMinerInfo(ctx context.Context, miner address.Address, tsk TipSetKey) (data *MinerInfo, err error)

StateMinerInfo returns info about the indicated miner

func (*FilClient) StateVerifiedClientStatus

func (fc *FilClient) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk TipSetKey) (dataCap *abi.StoragePower, err error)

StateVerifiedClientStatus returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address.

func (*FilClient) WalletVerify

func (fc *FilClient) WalletVerify(ctx context.Context, addr address.Address, msg []byte, sig *crypto.Signature) (valid bool, err error)

WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet.

type MarketDeal

type MarketDeal struct {
	Proposal DealProposal
	State    DealState
}

type MinerInfo

type MinerInfo struct {
	Owner address.Address // Must be an ID-address.
}

type TipSet

type TipSet struct {
	Cids   []cid.Cid
	Height abi.ChainEpoch
}

func (*TipSet) Key

func (ts *TipSet) Key() TipSetKey

type TipSetKey

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

A TipSetKey is an immutable collection of CIDs forming a unique key for a tipset. The CIDs are assumed to be distinct and in canonical order. Two keys with the same CIDs in a different order are not considered equal. TipSetKey is a lightweight value type, and may be compared for equality with ==.

func NewTipSetKey

func NewTipSetKey(cids ...cid.Cid) TipSetKey

NewTipSetKey builds a new key from a slice of CIDs. The CIDs are assumed to be ordered correctly.

func TipSetKeyFromBytes

func TipSetKeyFromBytes(encoded []byte) (TipSetKey, error)

TipSetKeyFromBytes wraps an encoded key, validating correct decoding.

func (TipSetKey) Bytes

func (k TipSetKey) Bytes() []byte

Bytes() returns a binary representation of the key.

func (TipSetKey) Cids

func (k TipSetKey) Cids() []cid.Cid

Cids returns a slice of the CIDs comprising this key.

func (TipSetKey) IsEmpty

func (k TipSetKey) IsEmpty() bool

func (TipSetKey) MarshalJSON

func (k TipSetKey) MarshalJSON() ([]byte, error)

func (TipSetKey) String

func (k TipSetKey) String() string

String() returns a human-readable representation of the key.

func (*TipSetKey) UnmarshalJSON

func (k *TipSetKey) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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