Hyperledger composer TypeError: Cannot create property 'wallet' on string 'resumedevelop'

Hyperledger composer TypeError: Cannot create property 'wallet' on string 'resumedevelop'

我要订阅活动。 所以我做了一个 event.js 文件

event.js

'use strict';


const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const winston = require('winston');
var chalk = require('chalk');
let config = require('config').get('event-app');
let participantId = config.get('participantId');
let participantPwd = config.get('participantPwd');
const LOG = winston.loggers.get('application');

var connection = new BusinessNetworkConnection();
return connection.connect('admin@resumedevelop', 'resumedevelop', 'admin', 'adminpw')
    .then(function (definition) {
        // Retrieved Business Network Definition
        console.log(definition === connection.getBusinessNetwork());  // true
    });

"resumedevelop" 是网络名称

我 运行 一个 BusinessNetwork 并试图 命令 "node event.js"

因此,

(node:28771) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot create property 'wallet' on string 'resumedevelop'

请多多指教.. !

查看 API 对 BusinessNetworkConnection 的引用,我想说的是错误告诉您,当需要一个对象时,您正在将字符串作为第二个参数传递。

但我还会观察到网络名称和凭据(或更可能是证书)是您作为第一个参数提供的业务网络名片的一部分,因此您不需要指定这些额外参数.