Class: BlockDecoder

BlockDecoder

Utility class to convert a grpc protobuf encoded byte array into a pure JSON object representing a hyperledger fabric `Block`.

new BlockDecoder()

Methods


<static> decode(block_bytes)

Constructs a JSON object containing all decoded values from the grpc encoded `Block` bytes
Parameters:
Name Type Description
block_bytes Array.<byte> The encode bytes of a hyperledger fabric message Block
See:
  • /protos/common/common.proto
Returns:
The JSON representation of the Protobuf common.Block
Type
Block

<static> decodeBlock(block)

Constructs a JSON object containing all decoded values from the grpc encoded `Block` object
Parameters:
Name Type Description
block Object a Protobuf common.Block object
See:
  • /protos/common/common.proto
Returns:
The JSON representation of the Protobuf common.Block
Type
Block

<static> decodeTransaction(processed_transaction_bytes)

Constructs a JSON object containing all decoded values from the grpc encoded `Transaction` bytes
Parameters:
Name Type Description
processed_transaction_bytes Array.<byte> The encode bytes of a hyperledger fabric message ProcessedTransaction
See:
  • /protos/peer/transaction.proto
Returns:
The JSON representation of the Protobuf transaction.ProcessedTransaction
Type
Object