Using different version of Node for Fabric peer to run chaincode #fabric-peer #fabric #fabric-questions

Harsh Sharma

Hello everyone,
I'm from the Blockchain Carbon Accounting Hyperledger Lab ( Our chaincode is written in TypeScript. We are trying to access an OrbitDB ( database using the IPFS HTTP API through our chaincode. However, OrbitDB requires Node >=v16 in order to function. We were able to compile the TypeScript chaincode and then package it using the peer chaincode lifecycle method, and then subsequently install it on the peers as well. We are running our peers in development mode, so dev-peer containers are created to execute the chaincode.

However, since the peers run Node v12.16 (since some Fabric packages require this version of Node), they are unable to execute the chaincode, and throw errors on contract invocation. Is there a way to configure the version of Node to be installed on the peer? Or is there a workaround using which we can get our chaincode to run with the correct version of Node?

Thank you for your help.

Matthew White


So for Fabric v2.4 - the node version used for the nodeenv container was updated to v16 (

If you use the very latest chaincode-node it will work with node 16, in fact, I've used earlier versions without issue.  The main problem encountered when moving up node levels was the code, but some of the testing tools didn't work with the later node versions.

On the subject of the chaincode calling out, general advice would be to not make a call out for two reasons.
- The time this could take, could hit the transaction timeout
- Depending on the endorsement policy multiple chaincode instances will need to make the same call. 3rd party dependencies can increase the risk of non-determinism.  

However, if you can take this into account, it's not prohibited at all. 

I will certainly look at the lab :-)


Thanks Matthew