i am tring to invoke chaincode command from client by i get Error processing transaction. Error: PEM encoded certificate is required
this is my client code i am using to connect to the fabric network and invoke the chaincode.
i can invoke and execute chaincode commands from the peer cli but why can't i do it from a client. i think it might have to do something with tls parameter or something. can anyone tell me what i'm missing.
thanks
`
'use strict';
const fs = require('fs');
const yaml = require('js-yaml');
const { FileSystemWallet, Gateway } = require('fabric-network');
const CommercialPaper = require('../chaincode/lib/paper');
// A wallet stores a collection of identities for use
const wallet = new FileSystemWallet('../identity/user/isabella/wallet');
async function main() {
const gateway = new Gateway();
try {
const userName = 'User1@org1.bionic.com';
// Load connection profile; will be used to locate a gateway
let connectionProfile =
yaml.safeLoad(fs.readFileSync('../gateway/networkConnection.yaml', 'utf8')
);
// Set connection options; identity and wallet
let connectionOptions = {
identity: userName,
wallet: wallet,
discovery: { enabled: false, asLocalhost: true }
};
await gateway.connect(connectionProfile, connectionOptions);
const network = await gateway.getNetwork('bionicchannel');
console.error('error occured');
// Get addressability to commercial paper contract
const contract = await network.getContract('papercontract');
const issueResponse = await contract.submitTransaction(
'issue',
'BionicSoftware',
'00001',
'2020-05-31',
'2020-11-30',
'5000000');}