I have a Java SDK based client for the Hyperledger fabric and am able to connect and send transaction proposal requests, create entries in the ledger and query the ledger.
I am struggling with registering and listening to BLOCK and CHAINCODE events. I want to start a separate thread on the client that is dedicated to listening and processing these events.
What I found so far:
HFClient client = HFClient.createNewInstance();
Channel channel = client.newChannel("channel01");
EventHub eventHub = client.newEventHub("eh01", "grpc://abc.xyz.us:7053");
channel.addEventHub(eventHub);
Beyond this I am lost. Can someone please post a sample of how to do this?