3

I am trying to run fabcar sample using javascript chaincode,it fails with the following error while instantiating the chaincode

error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/fabric-shim failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

please help me regarding this... It is happenning for all fabric samples whenever i try to run in javascript/typescript thanks in advance

Srivatsan
  • 66
  • 1
  • 9
  • i have tried those solutions it is not working – Srivatsan Mar 05 '19 at 10:27
  • Have you tried with --dns ? like described in here: https://stackoverflow.com/a/28004946/2336650 , please explain what you have tried already so we don't answer with what wont work for you – Mostafa Hussein Mar 05 '19 at 10:30
  • this is how it looks when i try to find my dns using the command `systemctl status docker` **25138 /usr/bin/dockerd -H fd:// ├─25554 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port ├─25579 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port ├─25595 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port ├─25930 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port └─25941 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port –** – Srivatsan Mar 05 '19 at 10:45

1 Answers1

1

When you instantiate a Javascript Smart Contract the Fabric creates a chaincode container and installs your Javascript contract (or sample) AND all the npm dependencies. This means that an npm registry with those modules must be accessible.

I suspect that you are behind a corporate proxy/firewall, or working in a region where there is no direct access to npm. On your host machine you probably have a .npmrc file which helps with the proxy, and you need to replicate that for the chaincode.

I think you need to place the .npmrc file in the root folder of your Smart Contract project - i.e. in the same folder as the package.json file.

R Thatcher
  • 5,550
  • 1
  • 7
  • 15
  • I have been provided with a open access network without any proxies and I can access npm install commands with my terminal and also my npm config proxy is net to null...can you please help me?what can i do next? – Srivatsan Mar 05 '19 at 10:47