Class: Fabric::Orderer

Inherits:
ClientStub show all
Defined in:
lib/fabric/orderer.rb

Constant Summary

Constants inherited from ClientStub

ClientStub::VALID_OPTIONS_KEYS

Instance Attribute Summary

Attributes inherited from ClientStub

#creds, #host, #logger, #options

Instance Method Summary collapse

Methods inherited from ClientStub

#initialize

Constructor Details

This class inherits a constructor from Fabric::ClientStub

Instance Method Details

#clientObject



5
6
7
# File 'lib/fabric/orderer.rb', line 5

def client
  @client ||= ::Orderer::AtomicBroadcast::Stub.new host, creds, options
end

#send_broadcast(envelope) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fabric/orderer.rb', line 9

def send_broadcast(envelope)
  logging :send_broadcast_request, envelope.to_h

  client.broadcast([envelope]).each do |response|
    logging :send_broadcast_response, response.to_h

    raise OrdererError response.message unless response.status == :SUCCESS

    yield response if block_given?
  end
end