NKN Docs

NKN Docs

  • Docs
  • 文档
  • GitHub
  • NKN
  • Help

block

block.Block

  • Variables
VariableDescription
Headerheader of block
Transactionstransactions in block
IsHeaderCheckedwhether the header has been checked
IsTxnsCheckedwhether the transactions have been checked
  • Methods

    • FromMsgBlock(msgBlock *pb.Block) // get from pb.Block
    • FromTrimmedData(r io.Reader) : error // get from trimmed data
    • GetInfo() : []byte, error // get readable Json format of block
    • GetMessage() : []byte // get byte slice of serialized unsigned block
    • GetProgramHashes() : []Uint160, error // get code hash of block
    • GetPrograms() : []*pb.Program // get codes of block
    • GetSigner() : []byte, []byte, error // get signer
    • GetTxsSize() : int // get size of all transactions in this block
    • Hash() : Uint256 // get hash value of block
    • Marshal() : []byte, error // serialize block
    • RebuildMerkleRoot() : error // recalculate merkle root of this block
    • SerializeUnsigned(w io.Writer) : error // serialize unsigned block
    • SetPrograms(prog []*pb.Program) // set codes to block
    • ToArray() : []byte // get byte slice of serialized block
    • ToMsgBlock() : *pb.Block // converse to pb.Block
    • Trim(w io.Writer) : error // get trimmed block
    • Unmarshal(buf []byte) : error // deserialization block
    • Verify() : error // verify signature of block

pb.Block

  • Variables
VariableDescription
Headerheader of block
Transactionstransactions in block
  • Methods
    • Generated by protobuf
  • block.Block
  • pb.Block
BowlerNKNTwitterGitHubForum
Copyright © 2025 NKN | All rights reserved