我想从客户端调用链代码命令,我得到Error processing transaction. Error: PEM encoded certificate is required
这是我用来连接到结构网络并调用链代码的客户端代码。我可以从对等 cli 调用和执行链代码命令,但为什么我不能从客户端执行它。我认为它可能与 tls 参数或其他东西有关。谁能告诉我我错过了什么。谢谢
`
'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');}