Documentation ¶
Overview ¶
nolint
Index ¶
- func ActivationTxFromBytes(data []byte) (*types.ActivationTx, error)
- func ActivationTxFromWireV1(atx *ActivationTxV1) *types.ActivationTx
- func NIPostChallengeFromWireV1(ch NIPostChallengeV1) *types.NIPostChallenge
- type ATXMetadataV1
- type ActivationTxV1
- type InnerActivationTxV1
- type MerkleProofV1
- type NIPostChallengeV1
- type NIPostV1
- type PostMetadataV1
- type PostV1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivationTxFromBytes ¶
func ActivationTxFromBytes(data []byte) (*types.ActivationTx, error)
Decode ActivationTx from bytes. In future it should decide which version of ActivationTx to decode based on the publish epoch.
func ActivationTxFromWireV1 ¶
func ActivationTxFromWireV1(atx *ActivationTxV1) *types.ActivationTx
func NIPostChallengeFromWireV1 ¶
func NIPostChallengeFromWireV1(ch NIPostChallengeV1) *types.NIPostChallenge
Types ¶
type ATXMetadataV1 ¶
func (*ATXMetadataV1) DecodeScale ¶
func (t *ATXMetadataV1) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*ATXMetadataV1) EncodeScale ¶
func (t *ATXMetadataV1) EncodeScale(enc *scale.Encoder) (total int, err error)
type ActivationTxV1 ¶
type ActivationTxV1 struct { InnerActivationTxV1 SmesherID types.NodeID Signature types.EdSignature }
func ActivationTxToWireV1 ¶
func ActivationTxToWireV1(a *types.ActivationTx) *ActivationTxV1
func (*ActivationTxV1) DecodeScale ¶
func (t *ActivationTxV1) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*ActivationTxV1) EncodeScale ¶
func (t *ActivationTxV1) EncodeScale(enc *scale.Encoder) (total int, err error)
func (*ActivationTxV1) HashInnerBytes ¶
func (atx *ActivationTxV1) HashInnerBytes() (result types.Hash32)
func (*ActivationTxV1) SignedBytes ¶
func (atx *ActivationTxV1) SignedBytes() []byte
type InnerActivationTxV1 ¶
type InnerActivationTxV1 struct { NIPostChallengeV1 Coinbase types.Address NumUnits uint32 NIPost *NIPostV1 NodeID *types.NodeID // only present in initial ATX to make hash of the first InnerActivationTxV2 unique VRFNonce *uint64 // only present when the nonce changed (or initial ATX) }
InnerActivationTxV1 is a set of all of an ATX's fields, except the signature. To generate the ATX signature, this structure is serialized and signed.
func (*InnerActivationTxV1) DecodeScale ¶
func (t *InnerActivationTxV1) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*InnerActivationTxV1) EncodeScale ¶
func (t *InnerActivationTxV1) EncodeScale(enc *scale.Encoder) (total int, err error)
type MerkleProofV1 ¶
type MerkleProofV1 struct { // Nodes on path from leaf to root (not including leaf) Nodes []types.Hash32 `scale:"max=32"` LeafIndex uint64 }
func (*MerkleProofV1) DecodeScale ¶
func (t *MerkleProofV1) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*MerkleProofV1) EncodeScale ¶
func (t *MerkleProofV1) EncodeScale(enc *scale.Encoder) (total int, err error)
type NIPostChallengeV1 ¶
type NIPostChallengeV1 struct { Publish types.EpochID // Sequence number counts the number of ancestors of the ATX. It sequentially increases for each ATX in the chain. // Two ATXs with the same sequence number from the same miner can be used as the proof of malfeasance against // that miner. Sequence uint64 // the previous ATX's ID (for all but the first in the sequence) PrevATXID types.ATXID PositioningATX types.ATXID // CommitmentATX is the ATX used in the commitment for initializing the PoST of the node. CommitmentATX *types.ATXID InitialPost *PostV1 }
func NIPostChallengeToWireV1 ¶
func NIPostChallengeToWireV1(c *types.NIPostChallenge) *NIPostChallengeV1
func (*NIPostChallengeV1) DecodeScale ¶
func (t *NIPostChallengeV1) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*NIPostChallengeV1) EncodeScale ¶
func (t *NIPostChallengeV1) EncodeScale(enc *scale.Encoder) (total int, err error)
func (*NIPostChallengeV1) Hash ¶
func (challenge *NIPostChallengeV1) Hash() types.Hash32
Hash serializes the NIPostChallenge and returns its hash. The serialized challenge is first prepended with a byte 0x00, and then hashed for second preimage resistance of poet membership merkle tree.
type NIPostV1 ¶
type NIPostV1 struct { // Membership proves that the challenge for the PoET, which is // constructed from fields in the activation transaction, // is a member of the poet's proof. // Proof.Root must match the Poet's POSW statement. Membership MerkleProofV1 // Post is the proof that the prover data is still stored (or was recomputed) at // the time he learned the challenge constructed from the PoET. Post *PostV1 // PostMetadata is the Post metadata, associated with the proof. // The proof should be verified upon the metadata during the syntactic validation, // while the metadata should be verified during the contextual validation. PostMetadata *PostMetadataV1 }
func (*NIPostV1) DecodeScale ¶
func (*NIPostV1) EncodeScale ¶
type PostMetadataV1 ¶
func (*PostMetadataV1) DecodeScale ¶
func (t *PostMetadataV1) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*PostMetadataV1) EncodeScale ¶
func (t *PostMetadataV1) EncodeScale(enc *scale.Encoder) (total int, err error)
Click to show internal directories.
Click to hide internal directories.