Date   

Error When Attempting to First Invoke Chaincode

White, Spencer (S.)
 

Hello,

I am encountering the attached error in the first of my chaincode containers that is being invoked after the chaincode has been installed and instantiated on my peer.

I thought this could possibly be related to a recent update/JIRA ticket for the fabric-shim for node, which moved from the deprecated grpc, to @grpc/grpc-js.

I am using v1.4 of the all the docker images of all the fabric containers, including fabric-ccenv. Is this the issue? Does anyone know the version of node the v1.4 chaincode or fabric-ccenv containers are using?

My host machine node version is LTS v12.16.3 and npm is v6.14.4.

Any input or direction would be appreciated.

Sincerely,

Spencer


Re: Chaincode container is running but query operation gives chaincode instantiation failed #fabric-chaincode

David Enyeart
 

Looks like the client failed to send the results to the ordering service node:
https://github.com/hyperledger/fabric/blob/release-1.4/peer/common/broadcastclient.go#L63
Not sure why grpc returned EOF upon send though...


Dave Enyeart

suresh.appana1---05/19/2020 02:57:43 PM---I was getting timeout error earlier, but as I increased timeout values now I don’t see any timeout e

From: suresh.appana1@...
To: David Enyeart <enyeart@...>
Date: 05/19/2020 02:57 PM
Subject: [EXTERNAL] Private: Re: [Hyperledger Fabric] Chaincode container is running but query operation gives chaincode instantiation failed #fabric-chaincode





I was getting timeout error earlier, but as I increased timeout values now I don’t see any timeout error . Current values of timeouts are: CORE_CHAINCODE_EXECUTETIMEOUT: 60000s and CORE_CHAINCODE_DEPLOYTIMEOUT: 60000s

On the client side I am getting this error for instantiation step: `Error: could not send: EOF`

Snippet is:

```
peer chaincode instantiate -o orderer:7050 — tls — cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CHAINCODE_NAME -v $CHAINCODE_VERSION -c '{"Args":["init", "a", "100", "b", "200"]}' -P "AND ('Org1MSP.peer','Org2MSP.peer')"

2020-05-19 15:44:25.628 -03 [viperutil] getKeysRecursively -> DEBU 001 Found map[string]interface{} value for peer.BCCSP
2020-05-19 15:44:25.629 -03 [viperutil] getKeysRecursively -> DEBU 002 Found map[string]interface{} value for peer.BCCSP.SW
2020-05-19 15:44:25.629 -03 [viperutil] unmarshalJSON -> DEBU 003 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2020-05-19 15:44:25.629 -03 [viperutil] getKeysRecursively -> DEBU 004 Found real value for peer.BCCSP.SW.Hash setting to string SHA2
2020-05-19 15:44:25.629 -03 [viperutil] unmarshalJSON -> DEBU 005 Unmarshal JSON: value is not a string: 256
2020-05-19 15:44:25.629 -03 [viperutil] getKeysRecursively -> DEBU 006 Found real value for peer.BCCSP.SW.Security setting to int 256
2020-05-19 15:44:25.630 -03 [viperutil] getKeysRecursively -> DEBU 007 Found map[string]interface{} value for peer.BCCSP.SW.FileKeyStore
2020-05-19 15:44:25.630 -03 [viperutil] unmarshalJSON -> DEBU 008 Unmarshal JSON: value cannot be unmarshalled: unexpected end of JSON input
2020-05-19 15:44:25.630 -03 [viperutil] getKeysRecursively -> DEBU 009 Found real value for peer.BCCSP.SW.FileKeyStore.KeyStore setting to string
2020-05-19 15:44:25.630 -03 [viperutil] getKeysRecursively -> DEBU 00a Found map[string]interface{} value for peer.BCCSP.PKCS11
2020-05-19 15:44:25.630 -03 [viperutil] unmarshalJSON -> DEBU 00b Unmarshal JSON: value is not a string: <nil>
2020-05-19 15:44:25.631 -03 [viperutil] getKeysRecursively -> DEBU 00c Found real value for peer.BCCSP.PKCS11.Label setting to <nil> <nil>
2020-05-19 15:44:25.631 -03 [viperutil] unmarshalJSON -> DEBU 00d Unmarshal JSON: value is not a string: <nil>
2020-05-19 15:44:25.632 -03 [viperutil] getKeysRecursively -> DEBU 00e Found real value for peer.BCCSP.PKCS11.Pin setting to <nil> <nil>
2020-05-19 15:44:25.633 -03 [viperutil] unmarshalJSON -> DEBU 00f Unmarshal JSON: value is not a string: <nil>
2020-05-19 15:44:25.634 -03 [viperutil] getKeysRecursively -> DEBU 010 Found real value for peer.BCCSP.PKCS11.Hash setting to <nil> <nil>
2020-05-19 15:44:25.635 -03 [viperutil] unmarshalJSON -> DEBU 011 Unmarshal JSON: value is not a string: <nil>
2020-05-19 15:44:25.636 -03 [viperutil] getKeysRecursively -> DEBU 012 Found real value for peer.BCCSP.PKCS11.Security setting to <nil> <nil>
2020-05-19 15:44:25.636 -03 [viperutil] getKeysRecursively -> DEBU 013 Found map[string]interface{} value for peer.BCCSP.PKCS11.FileKeyStore
2020-05-19 15:44:25.637 -03 [viperutil] unmarshalJSON -> DEBU 014 Unmarshal JSON: value is not a string: <nil>
2020-05-19 15:44:25.638 -03 [viperutil] getKeysRecursively -> DEBU 015 Found real value for peer.BCCSP.PKCS11.FileKeyStore.KeyStore setting to <nil> <nil>
2020-05-19 15:44:25.640 -03 [viperutil] unmarshalJSON -> DEBU 016 Unmarshal JSON: value is not a string: <nil>
2020-05-19 15:44:25.641 -03 [viperutil] getKeysRecursively -> DEBU 017 Found real value for peer.BCCSP.PKCS11.Library setting to <nil> <nil>
2020-05-19 15:44:25.642 -03 [viperutil] unmarshalJSON -> DEBU 018 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2020-05-19 15:44:25.642 -03 [viperutil] getKeysRecursively -> DEBU 019 Found real value for peer.BCCSP.Default setting to string SW
2020-05-19 15:44:25.642 -03 [viperutil] EnhancedExactUnmarshalKey -> DEBU 01a map[peer.BCCSP:map[SW:map[Hash:SHA2 Security:256 FileKeyStore:map[KeyStore:]] PKCS11:map[Security:<nil> FileKeyStore:map[KeyStore:<nil>] Library:<nil> Label:<nil> Pin:<nil> Hash:<nil>] Default:SW]]
2020-05-19 15:44:25.643 -03 [bccsp_sw] openKeyStore -> DEBU 01b KeyStore opened at [/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@.../msp/keystore]...done
2020-05-19 15:44:25.643 -03 [bccsp] initBCCSP -> DEBU 01c Initialize BCCSP [SW]
2020-05-19 15:44:25.668 -03 [chaincodeCmd] checkChaincodeCmdParams -> INFO 01d Using default escc
2020-05-19 15:44:25.668 -03 [chaincodeCmd] checkChaincodeCmdParams -> INFO 01e Using default vscc
Error: could not send: EOF
```

Thanks,
Suresh




Re: Chaincode container is running but query operation gives chaincode instantiation failed #fabric-chaincode

David Enyeart
 

Your chaincode image build took over 3 minutes which is much longer than normal.
The instantiation request and container start looks like it was ultimately successful, but the instantiation result was never submitted by the client for ordering and commit, hence the error when you attempt a subsequent query.
Most likely your client got a timeout waiting for the instantiation request and therefore did not submit the result for commit.
Exactly what error did the client get on the instantiation request?


Dave Enyeart

suresh.appana1---05/19/2020 01:57:22 PM---Hi, I am trying to setup HLF to run in K8s. I see that peer is starting chaincode container and chai

From: suresh.appana1@...
To: fabric@...
Date: 05/19/2020 01:57 PM
Subject: [EXTERNAL] [Hyperledger Fabric] Chaincode container is running but query operation gives chaincode instantiation failed #fabric-chaincode
Sent by: fabric@...





Hi,

I am trying to setup HLF to run in K8s. I see that peer is starting chaincode container and chaincode container is running succesfully. But instantiation step is exiting with EOF and when I perform a query, its failed with the error message:

Error: endorsement failure during query. response: status:500 message:"make sure the chaincode test_cc has been successfully instantiated and try again: chaincode test_cc not found"

Attached logs of instantiation and query. My setup is peer pod contains: peer container and dind. Chaincode container runs in dind.





Chaincode container is running but query operation gives chaincode instantiation failed #fabric-chaincode

Suresh Appana
 

Hi,

I am trying to setup HLF to run in K8s. I see that peer is starting chaincode container and chaincode container is running succesfully. But instantiation step is exiting with EOF and when I perform a query, its failed with the error message:

Error: endorsement failure during query. response: status:500 message:"make sure the chaincode test_cc has been successfully instantiated and try again: chaincode test_cc not found"

Attached logs of instantiation and query. My setup is peer pod contains: peer container and dind. Chaincode container runs in dind.

 

 


Re: ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found #fabric-sdk-node

Ry Jones
 


On Tue, May 19, 2020 at 9:12 AM Magno A. Cavalcante <magnocav@...> wrote:
On Tue, May 19, 2020 at 10:16 AM, Matthew White wrote:
>
> Hello - the module is `fabric-contract-api`  rather than chaincode-api:-)
> Regards, Matthew.
> *Matthew B White* *IBM Blockchain Solutions Architect*
>

Thanks Matthew!
I changed the source code of my "package.json" as Matthew indicated, and my chaincode was successfully instantiated.

Explanation:
(1) I wrote my package.json with reference to the packages described in the URL "https://hyperledger.github.io/fabric-chaincode-node/master/api/tutorial-using-contractinterface.html". And in this page there is the code "dependencies": { "fabric-chaincode-api": "^1.4.0", "fabric-shim": "^1.4.0" }. So I believe that this code snippet has some inconsistency.

(2) Please, I ask the team that makes the "fabric-sdk-node" documentation to correct the content of the page at the above URL, to avoid that other professionals from getting into the same problem.

The correct source code of my "package.json" (which is working) is:
// -------------------
{
    "name": "democontract",
    "version": "1.0.0",
    "description": "Document Contract",
    "main": "index.js",
    "engines": {
                "node": ">=8.4.0",
                "npm": ">=5.3.0"
    },
    "scripts": {
        "lint": "eslint .",
        "pretest": "npm run lint",
        "start": "fabric-chaincode-node start",
        "mocha": "mocha test --recursive"
    },
    "engine-strict": true,
    "license": "Apache-2.0",
    "private": true,
    "dependencies": {
        "mkdirp": ">=0.5.5",
        "openpgp": "^4.10.0",
        "fabric-contract-api": "^1.4.3",
        "fabric-shim": "^1.4.3"
    },
    "devDependencies": {
        "chai": "^4.1.2",
        "chai-as-promised": "^7.1.1",
        "eslint": "^4.19.1",
        "mocha": "^5.2.0",
        "nyc": "^12.0.2",
        "sinon": "^6.0.0",
        "sinon-chai": "^3.2.0"
    }
}
// -------------------

---
Regards,
Magno A. Cavalcante





--
Ry Jones
Community Architect, Hyperledger


Re: ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found #fabric-sdk-node

Magno Alves Cavalcante
 

On Tue, May 19, 2020 at 10:16 AM, Matthew White wrote:

Hello - the module is `fabric-contract-api`  rather than chaincode-api:-)
Regards, Matthew.
*Matthew B White* *IBM Blockchain Solutions Architect*
Thanks Matthew!
I changed the source code of my "package.json" as Matthew indicated, and my chaincode was successfully instantiated.

Explanation:
(1) I wrote my package.json with reference to the packages described in the URL "https://hyperledger.github.io/fabric-chaincode-node/master/api/tutorial-using-contractinterface.html". And in this page there is the code "dependencies": { "fabric-chaincode-api": "^1.4.0", "fabric-shim": "^1.4.0" }. So I believe that this code snippet has some inconsistency.

(2) Please, I ask the team that makes the "fabric-sdk-node" documentation to correct the content of the page at the above URL, to avoid that other professionals from getting into the same problem.

The correct source code of my "package.json" (which is working) is:
// -------------------
{
"name": "democontract",
"version": "1.0.0",
"description": "Document Contract",
"main": "index.js",
"engines": {
"node": ">=8.4.0",
"npm": ">=5.3.0"
},
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"start": "fabric-chaincode-node start",
"mocha": "mocha test --recursive"
},
"engine-strict": true,
"license": "Apache-2.0",
"private": true,
"dependencies": {
"mkdirp": ">=0.5.5",
"openpgp": "^4.10.0",
"fabric-contract-api": "^1.4.3",
"fabric-shim": "^1.4.3"
},
"devDependencies": {
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"eslint": "^4.19.1",
"mocha": "^5.2.0",
"nyc": "^12.0.2",
"sinon": "^6.0.0",
"sinon-chai": "^3.2.0"
}
}
// -------------------

---
Regards,
Magno A. Cavalcante


Re: ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found #fabric-sdk-node

Matthew White
 

Hello - the module is `fabric-contract-api`  rather than chaincode-api:-)
 
 
Regards, Matthew.
Matthew B White  IBM Blockchain Solutions Architect
 
Email me at WHITEMAT@...
Find me on StackOverflow, and generally at  calanais.me.uk
 
Note: restricted availability for meetings 14:30 to 17:00 UK Tuesday 
IBM United Kingdom Limited, Hursley Park, Winchester, Hampshire, SO21 2JN

"The wrong answers are the ones you go looking for when the right answers stare you in the face"
 
 
 
----- Original message -----
From: "Magno A. Cavalcante" <magnocav@...>
Sent by: fabric@...
To: fabric@...
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found #fabric-sdk-node
Date: Mon, May 18, 2020 9:31 PM
 
Hello All!

I wrote my chaincode using Node.js API, and now I'm trying to instantiate.

image: hyperledger/fabric-peer:1.4.5

My package.json has the follow source:
// -------------------
{
    "name": "democontract",
    "version": "1.0.0",
    "description": "Document Contract",
    "main": "index.js",
    "engines": {
"node": ">=8.4.0",
"npm": ">=5.3.0"
    },
    "scripts": {
        "lint": "eslint .",
        "pretest": "npm run lint",
        "start": "fabric-chaincode-node start",
        "mocha": "mocha test --recursive"
    },
    "engine-strict": true,
    "license": "Apache-2.0",
    "private": true,
    "dependencies": {
        "mkdirp": ">=0.5.5",
        "openpgp": "^4.10.0",
        "fabric-chaincode-api": "^1.4.0",
        "fabric-shim": "^1.4.0"
    },
    "devDependencies": {
        "chai": "^4.1.2",
        "chai-as-promised": "^7.1.1",
        "eslint": "^4.19.1",
        "mocha": "^5.2.0",
        "nyc": "^12.0.2",
        "sinon": "^6.0.0",
        "sinon-chai": "^3.2.0"
    }
}
// -------------------

But when I call in CLI container to instantiate the chaincode (democontract):
// -------------------
peer chaincode instantiate -C $CHANNELNAME -n $CHCODENAME -v $CHCODEVERSION -o $ORDERERNAME \
    -c '{"Args":["ContractDocument:instantiate"]}' \
    -P "OR('OrdererMSP.admin','Org1MSP.admin','Org1MSP.peer','Org1MSP.member')" \
    --tls --cafile $ORDERER_TLSCACERT --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE
// -------------------

I'm receing the follow ERROR at PEER container, and chaincode failed to instantiate.

I don't know how to get out of this error condition.
Please, may you help me?

// -------------------
[endorser] SimulateProposal -> ERRO 050 [devchannel][bef25398] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated 
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated 
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api  - Not found
npm ERR! 404
npm ERR! 404  'fabric-chaincode-api@^1.4.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'output'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-05-18T19_31_20_461Z-debug.log
"
error starting container
error starting container
// -------------------

---
Regards,
Magno A. Cavalcante


 
 
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


Re: Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric

Gari Singh <garis@...>
 

The desired solution for this is to allow peers to join channels starting from the latest config block rather than requiring starting from the genesis block.
The checkpoint/archive feature will also help here as well as a peer will be able to start from the latest state and checkpoint as well.

In the interim, we did look at modifying the JoinChannel API to allow passing in the "orderer override" information but at the time deemed it a bit too invasive and did not want to invest in hacking the current JoinChannel API implementation as we plan to move away from the system chaincode approach currently being used. Additionally, you actually need to persist the override information in the case where you decide to rebuild the ledger for a given channel. Simply passing overrides as part of the API is not enough; we'd also have to persist this override information as well.

-----------------------------------------
Gari Singh
Distinguished Engineer, CTO - IBM Blockchain
IBM Middleware
550 King St
Littleton, MA 01460
Cell: 978-846-7499
garis@...
-----------------------------------------

-----fabric@... wrote: -----
To: fabric@...
From: chintanr97@...
Sent by: fabric@...
Date: 05/19/2020 12:37AM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric

@Yacov, I would like to highlight that why aren't we making using of peer CLI command for this? I mean to say that in "peer channel join" command we have an option of specifying the orderer endpoint, right? We should just extend that to be used in the scenario where peer cannot pull blocks from genesis block orderers. Specifying "-o" argument should make the peer pull channel blocks from the specified endpoint instead of looking into config block.

You can run the peer channel join command like follows:
peer channel join -b mychannel.block -o orderer4.example.com --tls --cafile <ordererTLSCAFile>

The benefit would be:
The change in core.yaml is permanent like you explained on my JIRA. This feature would be dynamic in nature.
Already running peers could join newer channels dynamically.
Currently, I tried implementing above feature but peer node does respect the "-o" argument (and yet we have it in the "peer" binary commands). If we are using it in other operations like "invoke" then we should allow this command to run parallel to that, giving a more dynamic nature, instead of making using of core.yaml.

Please let me know your thoughts on this.


Re: Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric

Yacov
 

I replied in the JIRA, I agree with your analysis that adding these parameters to configure the peer's channel joining might be useful.



From:        chintanr97@...
To:        fabric@...
Date:        05/19/2020 07:36 AM
Subject:        [EXTERNAL] Re: [Hyperledger Fabric] Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric
Sent by:        fabric@...




@Yacov, I would like to highlight that why aren't we making using of peer CLI command for this? I mean to say that in "peer channel join" command we have an option of specifying the orderer endpoint, right? We should just extend that to be used in the scenario where peer cannot pull blocks from genesis block orderers. Specifying "-o" argument should make the peer pull channel blocks from the specified endpoint instead of looking into config block.

You can run the peer channel join command like follows:
peer channel join -b mychannel.block -o orderer4.example.com --tls --cafile <ordererTLSCAFile>

The benefit would be:
1.        The change in core.yaml is permanent like you explained on my JIRA. This feature would be dynamic in nature.
2.        Already running peers could join newer channels dynamically.
Currently, I tried implementing above feature but peer node does respect the "-o" argument (and yet we have it in the "peer" binary commands). If we are using it in other operations like "invoke" then we should allow this command to run parallel to that, giving a more dynamic nature, instead of making using of core.yaml.

Please let me know your thoughts on this.




Newly added peer getting online/offline messages along with old non-anchor peers #hyperledger-fabric #grpc #tls

chintanr97@...
 

I am encountering the following scenario: 
  1. I am running a network on multiple hosts.
  2. The network has one Orderer Organization (3 orderers in RAFT mode) and 1 Peer organization (2 Peers). Both having different Fabric CA instances.
  3. The application channel is created using all the orderers. Peer organization is added to consortium and the application channel. 
  4. Both the peers join the channel. I have configured Peer1.PeerOrg to be an anchor peer. 
  5. I install and instantiate chaincode. Invoke and query them multiple times.
  6. Create a new peer node MSP with PeerOrg CA.
  7. Start the new peer node and join the channel.
  8. Upon successful sync with the channel, the new peer node keeps getting logs that state "Membership view changed. Peers went online/offline". 
The following warning messages are accompanied by ERR message: "TLS handshake failed with error remote error: tls: bad certificate server=PeerServer".
The same set of ERR and WARN messages flood the logs of this new peer as well as of Peer2.PeerOrg (the non-anchor peer). 

So, now I switched anchor peer endpoint in application channel to Peer2.PeerOrg endpoint. Now again the new peer and Peer1.PeerOrg logs are flooded by above messages. 

At this stage, I remove anchor peers completely. Restart the peer nodes: Peer3.PeerOrg and Peer1.PeerOrg. No ERR or WARN messages occur now.

NOTE: All peers can communicate through one another by external endpoints. TLS certificates of all the peer nodes have been validated and are configured with correct DNS Alt Names. 

Can anyone please tell why this issue occurs?


Re: Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric

chintanr97@...
 

@Yacov, I would like to highlight that why aren't we making using of peer CLI command for this? I mean to say that in "peer channel join" command we have an option of specifying the orderer endpoint, right? We should just extend that to be used in the scenario where peer cannot pull blocks from genesis block orderers. Specifying "-o" argument should make the peer pull channel blocks from the specified endpoint instead of looking into config block.

You can run the peer channel join command like follows:
peer channel join -b mychannel.block -o orderer4.example.com --tls --cafile <ordererTLSCAFile>

The benefit would be: 
  1. The change in core.yaml is permanent like you explained on my JIRA. This feature would be dynamic in nature.
  2. Already running peers could join newer channels dynamically. 
Currently, I tried implementing above feature but peer node does respect the "-o" argument (and yet we have it in the "peer" binary commands). If we are using it in other operations like "invoke" then we should allow this command to run parallel to that, giving a more dynamic nature, instead of making using of core.yaml. 

Please let me know your thoughts on this.


ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found #fabric-sdk-node

Magno Alves Cavalcante
 

Hello All!

I wrote my chaincode using Node.js API, and now I'm trying to instantiate.

image: hyperledger/fabric-peer:1.4.5

My package.json has the follow source:
// -------------------
{
"name": "democontract",
"version": "1.0.0",
"description": "Document Contract",
"main": "index.js",
"engines": {
"node": ">=8.4.0",
"npm": ">=5.3.0"
},
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"start": "fabric-chaincode-node start",
"mocha": "mocha test --recursive"
},
"engine-strict": true,
"license": "Apache-2.0",
"private": true,
"dependencies": {
"mkdirp": ">=0.5.5",
"openpgp": "^4.10.0",
"fabric-chaincode-api": "^1.4.0",
"fabric-shim": "^1.4.0"
},
"devDependencies": {
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"eslint": "^4.19.1",
"mocha": "^5.2.0",
"nyc": "^12.0.2",
"sinon": "^6.0.0",
"sinon-chai": "^3.2.0"
}
}
// -------------------

But when I call in CLI container to instantiate the chaincode (democontract):
// -------------------
peer chaincode instantiate -C $CHANNELNAME -n $CHCODENAME -v $CHCODEVERSION -o $ORDERERNAME \
-c '{"Args":["ContractDocument:instantiate"]}' \
-P "OR('OrdererMSP.admin','Org1MSP.admin','Org1MSP.peer','Org1MSP.member')" \
--tls --cafile $ORDERER_TLSCACERT --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE
// -------------------

I'm receing the follow ERROR at PEER container, and chaincode failed to instantiate.

I don't know how to get out of this error condition.
Please, may you help me?

// -------------------
[endorser] SimulateProposal -> ERRO 050 [devchannel][bef25398] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found
npm ERR! 404
npm ERR! 404 'fabric-chaincode-api@^1.4.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'output'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-05-18T19_31_20_461Z-debug.log
"
error starting container
error starting container
// -------------------

---
Regards,
Magno A. Cavalcante


Re: Confusion related to env variable ORDERER_TLS_CA

Gari Singh <garis@...>
 

You are really asking two separate questions here.



1. ORDERER_GENERAL_TLS_ROOTCAS

Strictly speaking, you don't necessarily have to set this at all. This config parameter is used by the orderer to determine which certificates to trust when acting as a client communicating with TLS enabled endpoints. It's really not needed as the orderer also gets this same information from channel config blocks as well.


2. "So while TLSing via Peer ..."

I assume here you are really talking about the various peer CLI commands which happen to communicate with ordering nodes (as well as peer nodes). Commands such as "peer channel create|fetch|update ..." and "peer chaincode instantiate|invoke|query" not only communicate with peers, but they also directly communicate with ordering nodes. In this case, the "peer" command is actually acting as a client. If TLS is enabled, you need to tell the peer CLI which certificates to "trust". You specify this via the "--cafile" flag when using the various peer CLI commands mentioned previously.

When the peer is running as a "server" process (meaning as a real peer), it actually uses information from channel config blocks to figure out which TLS certificates to trust.





-----------------------------------------
Gari Singh
Distinguished Engineer, CTO - IBM Blockchain
IBM Middleware
550 King St
Littleton, MA 01460
Cell: 978-846-7499
garis@...
-----------------------------------------

-----fabric@... wrote: -----
To: "Abhijeet Bhowmik"<abhijeet@...>
From: jongkwon.lee@...
Sent by: fabric@...
Date: 05/18/2020 03:37AM
Cc: <fabric@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Confusion related to env variable ORDERER_TLS_CA

You can find the basics of gPRC TLS authentication here: https://blog.gopheracademy.com/advent-2019/go-grps-and-tls/
The article does not cover the usage of multiple CAs, but we could suppose it would handle the intermediate CAs.

I'd like to add that peers do not connect to orderers in general use cases. Client apps connect to orderers to submit transactions. Clients may need to know the ca cert file, but you also can use service discovery instead of setting the ca cert path manually.

​-----Original Message-----
From: "Abhijeet Bhowmik"<abhijeet@...>
To: <fabric@...>;
Cc:
Sent: 2020. 5. 15. (금) 15:57 (GMT+09:00)
Subject: [Hyperledger Fabric] Confusion related to env variable ORDERER_TLS_CA


Hello wonderful people,

I hope all are doing well. As a beginner, I have a confusion that came to me while writing docker-compose files to build my own network. There is an env variable in the orderer section
'
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/tls/orderer/ca.crt]'

So while TLSing via Peer, I have been told to use orderer's /tls/ca.crt. That's where my confusion lies. If anyways we are gonna use orderer's tls/ca.crt, what's the purpose of having value of ORDERER_GENERAL_TLS_ROOTCAS as array. What other values could I mention there. And what will be their significance? Ideally while TLSing between Server-client, Server presents it's certificate (with public key) during the request and the client doesn't have it pre hand. So if we go by that scenario, maybe either the orderer should present it's cert during the request or else there must be a way that we can use peer side artifacts to do the TLS. I see no point in copying orderer's tls/ca.crt to every peer manually.

Definitely I could be wrong. I will be more than happy if someone throws some light on this. Looking forward to it.

Thanks and Regards
Abhijeet Bhowmik


Re: Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric

Yacov
 

Read this JIRA https://jira.hyperledger.org/browse/FAB-5288



From:        chintanr97@...
To:        fabric@...
Date:        05/18/2020 09:37 AM
Subject:        [EXTERNAL] [Hyperledger Fabric] Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric
Sent by:        fabric@...




The peer fails to join the channel in the following scenario:
1.        A channel was created by the Orderer Organization (running 3 orderers in RAFT mode).
2.        A peer organization was added (let's say with 3 peers). Chaincodes were installed, instantiated and invoked several times.
3.        Over channel lifetime, the orderer nodes in channel were modified to the extent that no channel genesis block orderers existed in the channel any longer.
4.        A requirement occurred to add a new peer node in the channel. On giving, channel genesis block, it kept trying to fetch next blocks (starting from 1) by reaching out to orderer defined in the block 0 of the channel.
As expected, the new peer could not fetch any block after block 0! Because all the orderers defined in the channel at the time of its creation were swapped over by different orderers over channel lifetime.

What if instead of swapping the nodes, I need to rotate the TLS certificates of the different consenters in the application channel, such that in  channel lifetime, at some point every consenter has a TLS certificate different from the one present in the channel genesis block. This would again stop the newly added peer nodes to join the channel by blocking them to sync any blocks after the block 0 of the application channel!

I tried looking online if this issue was officially addressed by the community. But could not find any proposed solution for this. Is this a bug and taken into consideration for development? Or is this addressed already?





Re: Confusion related to env variable ORDERER_TLS_CA

conanoc
 

You can find the basics of gPRC TLS authentication here: https://blog.gopheracademy.com/advent-2019/go-grps-and-tls/
The article does not cover the usage of multiple CAs, but we could suppose it would handle the intermediate CAs.
I'd like to add that peers do not connect to orderers in general use cases. Client apps connect to orderers to submit transactions. Clients may need to know the ca cert file, but you also can use service discovery instead of setting the ca cert path manually.

-----Original Message-----
From: "Abhijeet Bhowmik"<abhijeet@...>
To: <fabric@...>;
Cc:
Sent: 2020. 5. 15. (금) 15:57 (GMT+09:00)
Subject: [Hyperledger Fabric] Confusion related to env variable ORDERER_TLS_CA
 

Hello wonderful people,
 
I hope all are doing well. As a beginner, I have a confusion that came to me while writing docker-compose files to build my own network. There is an env variable in the orderer section 
'
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/tls/orderer/ca.crt]
'  
 
So while TLSing via Peer, I have been told to use orderer's /tls/ca.crt. That's where my confusion lies. If anyways we are gonna use orderer's tls/ca.crt, what's the purpose of having value of ORDERER_GENERAL_TLS_ROOTCAS as array. What other values could I mention there. And what will be their significance? Ideally while TLSing between Server-client, Server presents it's certificate (with public key) during the request and the client doesn't have it pre hand. So if we go by that scenario, maybe either the orderer should present it's cert during the request or else there must be a way that we can use peer side artifacts to do the TLS. I see no point in copying orderer's tls/ca.crt to every peer manually.
 
Definitely I could be wrong. I will be more than happy if someone throws some light on this. Looking forward to it.
 
Thanks and Regards 
Abhijeet Bhowmik 


Adding a peer node when no genesis block orderer exist in the channel #fabric-orderer #raft #hyperledger-fabric

chintanr97@...
 

The peer fails to join the channel in the following scenario:

  1. A channel was created by the Orderer Organization (running 3 orderers in RAFT mode).
  2. A peer organization was added (let's say with 3 peers). Chaincodes were installed, instantiated and invoked several times.
  3. Over channel lifetime, the orderer nodes in channel were modified to the extent that no channel genesis block orderers existed in the channel any longer.
  4. A requirement occurred to add a new peer node in the channel. On giving, channel genesis block, it kept trying to fetch next blocks (starting from 1) by reaching out to orderer defined in the block 0 of the channel.

As expected, the new peer could not fetch any block after block 0! Because all the orderers defined in the channel at the time of its creation were swapped over by different orderers over channel lifetime.

What if instead of swapping the nodes, I need to rotate the TLS certificates of the different consenters in the application channel, such that in  channel lifetime, at some point every consenter has a TLS certificate different from the one present in the channel genesis block. This would again stop the newly added peer nodes to join the channel by blocking them to sync any blocks after the block 0 of the application channel!

I tried looking online if this issue was officially addressed by the community. But could not find any proposed solution for this. Is this a bug and taken into consideration for development? Or is this addressed already?


Re: How can I check which hash function is being used to create block hash in hyperledger fabric.

Gari Singh <garis@...>
 

There is a config value for each channel named "HashingAlgorithm".
This is not currently configurable and it set to SHA256.

-----------------------------------------
Gari Singh
Distinguished Engineer, CTO - IBM Blockchain
IBM Middleware
550 King St
Littleton, MA 01460
Cell: 978-846-7499
garis@...
-----------------------------------------

-----fabric@... wrote: -----
To: fabric@...
From: "qwert limframe"
Sent by: fabric@...
Date: 05/16/2020 07:43AM
Subject: [EXTERNAL] [Hyperledger Fabric] How can I check which hash function is being used to create block hash in hyperledger fabric.

Can you please tell me How I can check which hash function is being used to create block hash in hyperledger fabric while the network is running.


Re: Error: Enrollment information does not exist

Chris Gabriel <alaskadd@...>
 

Hi Cristina,

Posting the resolution here for the benefit of the community:

Resolution to issue fabric-ca-client identity list command is as follows:
1. start the network with the CA option ./network.sh up -ca
2. after the network is up, navigate to (assumes you are already in the test-network directory): cd organizations/peerOrganizations/org1.example.com
3. export cert path using this command: export FABRIC_CA_CLIENT_TLS_CERTFILES=$PWD/ca/ca.org1.example.com-cert.pem
4. export fabric-ca-client home using this command: export FABRIC_CA_CLIENT_HOME=$PWD
5. issue the following command: fabric-ca-client identity list

You should see a list of all the identities registered with the org1 CA.  You can repeat the process by changing the pathing for Org2 and the Orderer Org.


On May 14, 2020, at 1:44 PM, Gmail <alaskadd@...> wrote:

You are not in the client binary directory when issuing the command. You can fix this by exporting the FABRIC_CA_CLIENT_HOME variable and run the command again. This used to get me too, so we updated the CA docs with better instructions.


On May 14, 2020, at 1:35 PM, cridev@... wrote:

Hi all.

I am trying to interact with Fabric through the "fabric-ca-client" binary. I have launched the fabcar, compiled the javascript and node enrollAdmin and node registerUser without errors. However, when I try to launch fabric-ca-client identity list to query the identities that were enrolled and registered by the fabcar (through test-network) this fails and I get a:

ERROR] Enrollment check failed: Idemix enrollment information does not exist
Error: Enrollment information does not exist. Please execute enroll command first. Example:
 fabric-ca-client enroll -u http://user:userpw@serverAddr:serverPort

Note that from the logs I had seen the same exact comment had already went through.

fabric-ca-client enroll -u https://admin:adminpw@localhost:7054 --caname ca-org1 --tls.certfiles /path/to/fabric-ca/org1/tls-cert.pem

Am I missing something obvious here?


How can I check which hash function is being used to create block hash in hyperledger fabric.

qwert limframe
 

Can you please tell me How I can check which hash function is being used to create block hash in hyperledger fabric while the network is running.


Re. Testing, Scalability and Performance - In the context of private data collections usage with a persistant/durable versioned object storage [like couchdb]

Bharg Pvr <pvrbharg@...>
 

Dear team,

Looking for some guidance - has any performance and scalability testing on PDC - in the context of HLF with volumes of 10-20 million records to 100-200 million records. PDC is in play due to regulations, compliance and need to know basis information sharing. The use case also needs long term retention of information. About 10% volume can be a target for queries. We are assuming couchdb or other supported persistent/durable versioned object stores. Please let us know. Thanks

3221 - 3240 of 11527