Я собираюсь подключить свой локальный IBM fabri c против расширения кода смарт-контракт к nodeJS. он успешно подключен и данные успешно добавлены. Но в терминале я показываю эту ошибку
error: [Orderer.js]: sendBroadcast - on error: "Error: 14 UNAVAILABLE: Trying to connect an http1.x server\n at Object.exports.createStatusError
Я использую последнюю версию расширение и docker images версия 1.4.4 .
вот мое локальное соединение файл:
{
"name": "basic-network",
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
},
"orderer": "300"
}
}
},
"channels": {
"mychannel": {
"orderers": [
"orderer.example.com"
],
"peers": {
"peer0.org1.example.com": {}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com"
],
"certificateAuthorities": [
"ca.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpc://localhost:17055"
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpc://localhost:17051"
}
},
"certificateAuthorities": {
"ca.example.com": {
"url": "http://localhost:17050",
"caName": "ca.org1.example.com"
}
}
}
А вот узел функция:
async function main(){
try {
let response;
const userExists = await wallet.exists(userName);
if (!userExists) {
console.log('An identity for the user ' + userName + ' does not exist in the wallet');
console.log('Run the registerUser.js application before retrying');
response.error = 'An identity for the user ' + userName + ' does not exist in the wallet. Register ' + userName + ' first';
}
// Create a new gateway for connecting to our peer node.
await gateway.connect(ccp, { wallet, identity: userName, discovery: gatewayDiscovery });
console.log('Connected to Fabric gateway.');
// Connect to our local fabric
const network = await gateway.getNetwork('mychannel');
console.log('Connected to mychannel. ');
contract = await network.getContract('mycontract');
// return callback ( contract );
await await contract.submitTransaction('product_register', '6','medical','new');
console.log('Transaction has been submitted');
// Disconnect from the gateway.
await gateway.disconnect();
}
catch (error) {
console.log(`Error processing transaction. ${error}`);
console.log(error.stack);
return callback ( error.stack );
}
}
Может кто-нибудь отобрать у меня эту ошибку?
Спасибо.