Error Promise is rejected: when running balance-transfer (hyperledger) with nodejs - node.js

I am following the steps to run the blockchain code from balance-transfer in the sample codes provided by hyperledger.
https://github.com/hyperledger/fabric-samples/tree/release/balance-transfer.
Things work smoothly when I run it with golang but I get the following error when I run it with node.js.
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: error starting container: Failed to generate platform-specific docker build: Error returned from build: 254 "npm WARN example_cc#1.0.0 No repository field.
The error occurs when the chaincode is instantiated on the channel.
I am using node v8.6.0 and npm v5.3.0.
Any idea what is going on?
Thanks in advance.

It turns out the code written in node.js has been removed in their latest release. I guess there was a problem with it.

Related

After writing my smart contract i'm trying to install the chaincode on the default network but I keep receiving an error

I installed minifabric and wrote my own chaincode but when i try to install it on the default channel i get the following error:
non-zero reuturn code
Error: No such container: mysite
My smart contract is the following path: ~/mywork/vars/chaincode/mycc/go

Error While Installing Fabric Chaincode: _lifecycle.syscc: no such file or directory

While trying to install chaincode using Fabric v2.1, I am encountering an error. Does anyone face similar issues? My peer is running fine and able to join the channel as well. I am able to list the channel details as well.
Note: I am doing Native installation without using docker images for running orderer and peer.
Highly appreciate for your support and looking forward to hear from you.
Error:
chaincode install failed with status: 500 - error in simulation: failed to execute transaction 44688cc50afeda03e3f5e7735ae650030952477b6bdfce83064582f42bec6c84: could not launch chaincode _lifecycle.syscc: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package '_lifecycle.syscc': open /home/vagrant/ledger/ORG2/peer1-org2/ledger/chaincodes/_lifecycle.syscc: no such file or directory
I got this error after upgrading from 1.4. In my case the problem was in the old config file for the peer.
Make sure you have next lines in your core.yaml:
chaincode:
...
# enabled system chaincodes
system:
_lifecycle: enable

Convector Framework CLI returns error when installing chaincode

I am very new to the Hyperledger Fabric and Convector Framework and I have followed this tutorial:
https://worldsibu.github.io/convector/modules/getting_started.html
When I try to use the CLI tool and run the command (test is my chaincode name):
npm run cc:start -- test 1
It gives the following errors:
Installing Chaincode test version 1.0 at org1
Error: Error endorsing chaincode: rpc error: code = Unknown desc = access
denied: channel [] creator org [org1MSP]
...
Installing Chaincode test version 1.0 at org2
Error: error getting endorser client for install: endorser client failed to
connect to localhost:7151: failed to create new connection: context deadline
exceeded
I have not changed the configs and MSPs.
What is going wrong and how should I start to resolve the problem? Any guidance is appreciated!
#shole that documentation is now deprecated, you can use http://docs.worldsibu.com/convector for the latest versions.
About your error that usually happens when the environment gets corrupted and keeps cryptographic materials from a previous installation, try re-running npm run env:restart and try again.

Hyperledger Fabric NodeJS client grpc issue

I am trying to send request to hyperledger fabric blockchain network through my NodeJS test client and I always receive the following:
error: [Remote.js]: Error: Failed to connect before the deadline
[hl] Query has completed, checking results
[hl] Query error: Error: Failed to connect before the deadline
at checkState (/opt/hl/test/frontend/node_modules/fabric-client/node_modules/grpc/src/client.js:838:16)
I am trying to find out what is wrong, there is nothing suspicious in peer logs.
I am using the following version:
HL v1.2.0
NodeJS v8.11.4
grpc v1.14.1
EDIT:
The code that is failing:
var channel = fabric_client.newChannel('mychannel');
var peer = fabric_client.newPeer('grpc://localhost:7051');
channel.addPeer(peer);
var order = fabric_client.newOrderer('grpc://localhost:7050')
channel.addOrderer(order);
channel.queryByChaincode(request) <-- ERROR
The hyperledger is running because I am able to query and invoke chaincode functions through Java SDK.
It seems to be a permission issue. When I start the client side with sudo, assigning it root previlige. The issue is resolved.
Still not sure about the root cause.
sudo env "PATH=$PATH" ./fabric.sh start
Try setting a longer timeout and then re-running it export GRPC_WAIT_FOR_READY_TIMEOUT=6000

Hyperledger Fabric Sample Code Error

When I am Trying to run fabcar example in hyperledger fabric I am getting an error
"error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 14 UNAVAILABLE: Connect Failed"
As I am new to hyperledger I am not getting the correct answer Please help me with this
I am using :
Node version : v6.14.1
Npm version : v3.10.10
Thanks in advance

Resources