Documentation ¶
Index ¶
- Constants
- Variables
- func BigCmp(a, b BigInt) int
- func CidArrsEqual(a, b []cid.Cid) bool
- func ElectionPostChallengeCount(sectors uint64, faults uint64) uint64
- func IsTicketWinner(partialTicket []byte, ssizeI uint64, snum uint64, totpow BigInt) bool
- func WrapStorage(s Storage) amt.Blocks
- type Actor
- type BigInt
- func (bi BigInt) Equals(o BigInt) bool
- func (bi BigInt) GreaterThan(o BigInt) bool
- func (bi *BigInt) IsZero() bool
- func (bi BigInt) LessThan(o BigInt) bool
- func (bi *BigInt) MarshalCBOR(w io.Writer) error
- func (bi *BigInt) MarshalJSON() ([]byte, error)
- func (bi BigInt) Nil() bool
- func (bi *BigInt) Scan(value interface{}) error
- func (bi BigInt) SizeStr() string
- func (bi *BigInt) UnmarshalCBOR(br io.Reader) error
- func (bi *BigInt) UnmarshalJSON(b []byte) error
- type BitField
- type BlockHeader
- func (blk *BlockHeader) CheckBlockSignature(ctx context.Context, worker address.Address) error
- func (b *BlockHeader) Cid() cid.Cid
- func (blk *BlockHeader) LastTicket() *Ticket
- func (t *BlockHeader) MarshalCBOR(w io.Writer) error
- func (blk *BlockHeader) Serialize() ([]byte, error)
- func (blk *BlockHeader) SigningBytes() ([]byte, error)
- func (b *BlockHeader) ToStorageBlock() (block.Block, error)
- func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error
- type BlockMsg
- type EPostProof
- type EPostTicket
- type ExpTipSet
- type FIL
- type FullBlock
- type InvokeRet
- type KeyInfo
- type KeyStore
- type LogCids
- type Merge
- type Message
- func (m *Message) Cid() cid.Cid
- func (m *Message) Equals(o *Message) bool
- func (t *Message) MarshalCBOR(w io.Writer) error
- func (m *Message) RequiredFunds() BigInt
- func (m *Message) Serialize() ([]byte, error)
- func (m *Message) ToStorageBlock() (block.Block, error)
- func (t *Message) UnmarshalCBOR(r io.Reader) error
- func (m *Message) VMMessage() *Message
- type MessageReceipt
- type ModVerifyParams
- type MsgMeta
- type Signature
- type SignedMessage
- func (m *SignedMessage) Cid() cid.Cid
- func (t *SignedMessage) MarshalCBOR(w io.Writer) error
- func (sm *SignedMessage) Serialize() ([]byte, error)
- func (sm *SignedMessage) Size() int
- func (m *SignedMessage) ToStorageBlock() (block.Block, error)
- func (t *SignedMessage) UnmarshalCBOR(r io.Reader) error
- func (sm *SignedMessage) VMMessage() *Message
- type SignedStorageAsk
- type SignedVoucher
- type StateTree
- type Storage
- type StorageAsk
- type Ticket
- type TipSet
- func (ts *TipSet) Blocks() []*BlockHeader
- func (ts *TipSet) Cids() []cid.Cid
- func (ts *TipSet) Contains(oc cid.Cid) bool
- func (ts *TipSet) Equals(ots *TipSet) bool
- func (ts *TipSet) Height() uint64
- func (ts *TipSet) Key() TipSetKey
- func (ts *TipSet) MarshalCBOR(w io.Writer) error
- func (ts *TipSet) MarshalJSON() ([]byte, error)
- func (ts *TipSet) MinTicket() *Ticket
- func (ts *TipSet) MinTicketBlock() *BlockHeader
- func (ts *TipSet) MinTimestamp() uint64
- func (ts *TipSet) ParentState() cid.Cid
- func (ts *TipSet) ParentWeight() BigInt
- func (ts *TipSet) Parents() TipSetKey
- func (ts *TipSet) UnmarshalCBOR(r io.Reader) error
- func (ts *TipSet) UnmarshalJSON(b []byte) error
- type TipSetKey
- type VMContext
- type VMSyscalls
Constants ¶
View Source
const ( KTSecp256k1 = "secp256k1" KTBLS = "bls" )
View Source
const ( IKTUnknown = -1 IKTSecp256k1 = iota IKTBLS )
View Source
const BigIntMaxSerializedLen = 128 // is this big enough? or too big?
View Source
const SignatureMaxLength = 200
Variables ¶
View Source
var ( ErrKeyInfoNotFound = fmt.Errorf("key info not found") ErrKeyExists = fmt.Errorf("key already exists") )
View Source
var EmptyInt = BigInt{}
View Source
var ErrActorNotFound = fmt.Errorf("actor not found")
View Source
var ErrBitFieldTooMany = errors.New("to many items in RLE")
View Source
var TotalFilecoinInt = FromFil(build.TotalFilecoin)
Functions ¶
func CidArrsEqual ¶
func CidArrsEqual(a, b []cid.Cid) bool
func IsTicketWinner ¶
func WrapStorage ¶
func WrapStorage(s Storage) amt.Blocks
Types ¶
type BigInt ¶
func BigFromBytes ¶
func BigFromString ¶
func (BigInt) GreaterThan ¶
GreaterThan returns true if bi > o
func (*BigInt) MarshalJSON ¶
func (*BigInt) UnmarshalJSON ¶
type BitField ¶
type BitField struct {
// contains filtered or unexported fields
}
func BitFieldFromSet ¶
func MergeBitFields ¶
func NewBitField ¶
func NewBitField() BitField
func NewBitFieldFromBytes ¶ added in v0.2.1
type BlockHeader ¶
type BlockHeader struct { Miner address.Address Ticket *Ticket EPostProof EPostProof Parents []cid.Cid ParentWeight BigInt Height uint64 ParentStateRoot cid.Cid ParentMessageReceipts cid.Cid Messages cid.Cid BLSAggregate Signature Timestamp uint64 BlockSig *Signature ForkSignaling uint64 }
func DecodeBlock ¶
func DecodeBlock(b []byte) (*BlockHeader, error)
func (*BlockHeader) CheckBlockSignature ¶
func (blk *BlockHeader) CheckBlockSignature(ctx context.Context, worker address.Address) error
func (*BlockHeader) Cid ¶
func (b *BlockHeader) Cid() cid.Cid
func (*BlockHeader) LastTicket ¶
func (blk *BlockHeader) LastTicket() *Ticket
func (*BlockHeader) MarshalCBOR ¶
func (t *BlockHeader) MarshalCBOR(w io.Writer) error
func (*BlockHeader) Serialize ¶
func (blk *BlockHeader) Serialize() ([]byte, error)
func (*BlockHeader) SigningBytes ¶
func (blk *BlockHeader) SigningBytes() ([]byte, error)
func (*BlockHeader) ToStorageBlock ¶
func (b *BlockHeader) ToStorageBlock() (block.Block, error)
func (*BlockHeader) UnmarshalCBOR ¶
func (t *BlockHeader) UnmarshalCBOR(r io.Reader) error
type BlockMsg ¶
type BlockMsg struct { Header *BlockHeader BlsMessages []cid.Cid SecpkMessages []cid.Cid }
func DecodeBlockMsg ¶
type EPostProof ¶
type EPostProof struct { Proof []byte PostRand []byte Candidates []EPostTicket }
func (*EPostProof) MarshalCBOR ¶
func (t *EPostProof) MarshalCBOR(w io.Writer) error
func (*EPostProof) UnmarshalCBOR ¶
func (t *EPostProof) UnmarshalCBOR(r io.Reader) error
type EPostTicket ¶
func (*EPostTicket) MarshalCBOR ¶
func (t *EPostTicket) MarshalCBOR(w io.Writer) error
func (*EPostTicket) UnmarshalCBOR ¶
func (t *EPostTicket) UnmarshalCBOR(r io.Reader) error
type ExpTipSet ¶
type ExpTipSet struct { Cids []cid.Cid Blocks []*BlockHeader Height uint64 }
why didnt i just export the fields? Because the struct has methods with the same names already
type FullBlock ¶
type FullBlock struct { Header *BlockHeader BlsMessages []*Message SecpkMessages []*SignedMessage }
type KeyStore ¶
type KeyStore interface { // List lists all the keys stored in the KeyStore List() ([]string, error) // Get gets a key out of keystore and returns KeyInfo corresponding to named key Get(string) (KeyInfo, error) // Put saves a key info under given name Put(string, KeyInfo) error // Delete removes a key from keystore Delete(string) error }
KeyStore is used for storing secret keys
type LogCids ¶
type LogCids []cid.Cid
func (LogCids) MarshalLogArray ¶
func (cids LogCids) MarshalLogArray(ae zapcore.ArrayEncoder) error
type Message ¶
type Message struct { To address.Address From address.Address Nonce uint64 Value BigInt GasPrice BigInt GasLimit BigInt Method uint64 Params []byte }
func DecodeMessage ¶
func (*Message) RequiredFunds ¶
type MessageReceipt ¶
func (*MessageReceipt) Equals ¶
func (mr *MessageReceipt) Equals(o *MessageReceipt) bool
func (*MessageReceipt) MarshalCBOR ¶
func (t *MessageReceipt) MarshalCBOR(w io.Writer) error
func (*MessageReceipt) UnmarshalCBOR ¶
func (t *MessageReceipt) UnmarshalCBOR(r io.Reader) error
type ModVerifyParams ¶
func (*ModVerifyParams) MarshalCBOR ¶
func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error
func (*ModVerifyParams) UnmarshalCBOR ¶
func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) error
type Signature ¶
func SignatureFromBytes ¶
type SignedMessage ¶
func DecodeSignedMessage ¶
func DecodeSignedMessage(data []byte) (*SignedMessage, error)
func (*SignedMessage) Cid ¶
func (m *SignedMessage) Cid() cid.Cid
func (*SignedMessage) MarshalCBOR ¶
func (t *SignedMessage) MarshalCBOR(w io.Writer) error
func (*SignedMessage) Serialize ¶
func (sm *SignedMessage) Serialize() ([]byte, error)
func (*SignedMessage) Size ¶
func (sm *SignedMessage) Size() int
func (*SignedMessage) ToStorageBlock ¶
func (m *SignedMessage) ToStorageBlock() (block.Block, error)
func (*SignedMessage) UnmarshalCBOR ¶
func (t *SignedMessage) UnmarshalCBOR(r io.Reader) error
func (*SignedMessage) VMMessage ¶
func (sm *SignedMessage) VMMessage() *Message
type SignedStorageAsk ¶
type SignedStorageAsk struct { Ask *StorageAsk Signature *Signature }
func (*SignedStorageAsk) MarshalCBOR ¶
func (t *SignedStorageAsk) MarshalCBOR(w io.Writer) error
func (*SignedStorageAsk) UnmarshalCBOR ¶
func (t *SignedStorageAsk) UnmarshalCBOR(r io.Reader) error
type SignedVoucher ¶
type SignedVoucher struct { TimeLock uint64 SecretPreimage []byte Extra *ModVerifyParams Lane uint64 Nonce uint64 Amount BigInt MinCloseHeight uint64 Merges []Merge Signature *Signature }
func DecodeSignedVoucher ¶
func DecodeSignedVoucher(s string) (*SignedVoucher, error)
func (*SignedVoucher) EncodedString ¶
func (sv *SignedVoucher) EncodedString() (string, error)
func (*SignedVoucher) Equals ¶
func (sv *SignedVoucher) Equals(other *SignedVoucher) bool
func (*SignedVoucher) MarshalCBOR ¶
func (t *SignedVoucher) MarshalCBOR(w io.Writer) error
func (*SignedVoucher) SigningBytes ¶
func (sv *SignedVoucher) SigningBytes() ([]byte, error)
func (*SignedVoucher) UnmarshalCBOR ¶
func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) error
type Storage ¶
type Storage interface { Put(cbg.CBORMarshaler) (cid.Cid, aerrors.ActorError) Get(cid.Cid, cbg.CBORUnmarshaler) aerrors.ActorError GetHead() cid.Cid // Commit sets the new head of the actors state as long as the current // state matches 'oldh' Commit(oldh cid.Cid, newh cid.Cid) aerrors.ActorError }
type StorageAsk ¶
type StorageAsk struct { // Price per GiB / Epoch Price BigInt MinPieceSize uint64 Miner address.Address Timestamp uint64 Expiry uint64 SeqNo uint64 }
func (*StorageAsk) MarshalCBOR ¶
func (t *StorageAsk) MarshalCBOR(w io.Writer) error
func (*StorageAsk) UnmarshalCBOR ¶
func (t *StorageAsk) UnmarshalCBOR(r io.Reader) error
type TipSet ¶
type TipSet struct {
// contains filtered or unexported fields
}
func NewTipSet ¶
func NewTipSet(blks []*BlockHeader) (*TipSet, error)
func (*TipSet) Blocks ¶
func (ts *TipSet) Blocks() []*BlockHeader
func (*TipSet) MarshalJSON ¶
func (*TipSet) MinTicketBlock ¶
func (ts *TipSet) MinTicketBlock() *BlockHeader
func (*TipSet) MinTimestamp ¶
func (*TipSet) ParentState ¶
func (ts *TipSet) ParentState() cid.Cid
func (*TipSet) ParentWeight ¶
func (*TipSet) UnmarshalJSON ¶
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 ¶
TipSetKeyFromBytes wraps an encoded key, validating correct decoding.
func (TipSetKey) Cids ¶
func (k TipSetKey) Cids() []cid.Cid
Cids returns a slice of the CIDs comprising this key.
func (TipSetKey) MarshalJSON ¶
func (*TipSetKey) UnmarshalJSON ¶
type VMContext ¶
type VMContext interface { Message() *Message Origin() address.Address Ipld() *hamt.CborIpldStore Send(to address.Address, method uint64, value BigInt, params []byte) ([]byte, aerrors.ActorError) BlockHeight() uint64 GasUsed() BigInt Storage() Storage StateTree() (StateTree, aerrors.ActorError) VerifySignature(sig *Signature, from address.Address, data []byte) aerrors.ActorError ChargeGas(uint64) aerrors.ActorError GetRandomness(height uint64) ([]byte, aerrors.ActorError) GetBalance(address.Address) (BigInt, aerrors.ActorError) Sys() *VMSyscalls Context() context.Context }
type VMSyscalls ¶
type VMSyscalls struct { ValidatePoRep func(context.Context, address.Address, uint64, []byte, []byte, []byte, []byte, []byte, uint64) (bool, aerrors.ActorError) VerifyFallbackPost func(ctx context.Context, sectorSize uint64, sectorInfo sectorbuilder.SortedPublicSectorInfo, challengeSeed []byte, proof []byte, candidates []sectorbuilder.EPostCandidate, proverID address.Address, faults uint64) (bool, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.