Class: Orderer

Orderer

The Orderer class represents a peer in the target blockchain network to which HFC sends a block of transactions of endorsed proposals requiring ordering.

new Orderer(url, opts)

Constructs an Orderer given its endpoint configuration settings.
Parameters:
Name Type Description
url string The orderer URL with format of 'grpcs://host:port'.
opts Object The options for the connection to the orderer.
- request-timeout {string} A integer value in milliseconds to be used as node.js based timeout. This will break the request operation if the grpc request has not responded within this timeout period. note: other options will be passed to the grpc connection

Methods


sendBroadcast(envelope)

Send a Broadcast message to the orderer service.
Parameters:
Name Type Description
envelope byte Byte data to be included in the Broadcast
See:
  • the ./proto/orderer/ab.proto
  • the ./proto/orderer/ab.proto
Returns:
A Promise for a BroadcastResponse
Type
Promise

sendDeliver(envelope)

Send a Deliver message to the orderer service.
Parameters:
Name Type Description
envelope byte Byte data to be included in the Deliver
See:
  • the ./proto/orderer/ab.proto
  • the ./proto/orderer/common.proto
Returns:
A Promise for a Block
Type
Promise

toString()

return a printable representation of this object