https://github.com/hyperledger/fabric-samples In the file app.js in director asset-transfer-basic->application-javascript when I insert the code of server to listen on a port and try to call the contract it gives out the error as follows. enter image description here
connection.write(data.toString());
console.log('Sent response to client');
connection.end();
console.log('Disconnected the client.');
});
});
server.listen(port, function () {
console.log('server is listening');
});
console.log('\n--> Evaluate Transaction: GetSignedRank, function returns signed rank');
var result = await contract.evaluateTransaction('GetSignedRank', '123');
console.log(result.toString());
//console.log(`*** Result: ${prettyJSONString(result.toString())}`);
} finally {
// Disconnect from the gateway when the application is closing
// This will close all connections to the network
gateway.disconnect();
}
} catch (error) {
console.error(`******** FAILED to run the application: ${error}`);
}
}
the problem is in this line var result = await contract.evaluateTransaction('GetSignedRank', '123');