Closed robelkebede closed 5 years ago
There could be multiple issues::
@vishal3152 thank you for the answer but i am a new to fabric how to read the emitted block
This is one of the way :-
var startBlockListener = async function () {
const client = await Client.loadFromConfig("<file path>");
const channel = client.getChannel("<channelName>");
var eh = channel.getChannelEventHubsForOrg()[0];// read from network-config.json
var block_reg = eh.registerBlockEvent((block) => {
console.log('New block received: ' + block.number);
// read block here
}
eh.connect();
}
startBlockListener().then(() => {});
const Fabric_Client = require('fabric-client');
var Client = new Fabric_Client();
var startBlockListener = async function () {
const client = await Client.loadFromConfig("
TypeError: Client.loadFromConfig is not a function
Successfully committed the change to the ledger by the peer but it is not upadating the ledger what is the problem Thank you.