IBM / blockchainbean2

This code pattern shows how to model a supply-chain network using the IBM Blockchain Platform and is based on a collaboration with Brooklyn Roasting Company. The story, along with the supply-chain documents that were used to model this network, can be found at: https://www.ibm.com/blockchainbean. Note that the 'view the blockchain' button is being migrated''
https://developer.ibm.com/patterns/coffee-supply-chain-network-hyperledger-fabric-blockchain-2/
122 stars 84 forks source link

error: [Network]: _initializeInternalChannel: no suitable peers available to initialize from #15

Open terryfernz opened 4 years ago

terryfernz commented 4 years ago

I get a error message when trying to run node query.js from inside the web-app. The smart contract is instantiated and running inside the Fabric n/w created using VsCode and the IBM Blockchain Extension.

Here is my local localConnection.json

{
    "name": "basic-network",
    "version": "1.0.0",
    "client": {
        "organization": "Org1",
        "connection": {
            "timeout": {
                "peer": {
                    "endorser": "300",
                    "eventHub": "300",
                    "eventReg": "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.org1.example.com"
            ]
        }
    },
    "orderers": {
        "orderer.example.com": {
            "url": "grpc://localhost:17050"
        }
    },
    "peers": {
        "peer0.org1.example.com": {
            "url": "grpc://localhost:17051",
            "eventUrl": "grpc://localhost:17053"
        }
    },
    "certificateAuthorities": {
        "ca.org1.example.com": {
            "url": "http://localhost:17054",
            "caName": "ca.example.com"
        }
    }
}

My cofig.json

{
  "connection_file": "localConnection.json",
  "appAdmin": "admin",
  "appAdminSecret": "adminpw",
  "orgMSPID": "org1msp",
  "caName": "ca.example.com",
  "userName": "user2",
  "gatewayDiscovery": { "enabled": true, "asLocalhost": true }
}

Any help will be much appreciated. Thx you.

terryfernz commented 4 years ago

This is only an issue if the network is started inside the VSCode IBM Blockchain Platform extension v1.0.15. It works perfectly fine with the hyperledger fabric created network.

okedeji commented 4 years ago

I am facing similar issue, anyone with help? Good on the cloud but same error on Local

gemcutterjp commented 4 years ago

I got the same error message. I fixed this by placing the correct keys in the wallet for the user, thought I cannot tell if yours is the same case as mine. The wallet path also must be correctly specified.