...by Daniel Szego
quote
"Simplicity is the ultimate sophistication."
Leonardo da Vinci

Wednesday, October 24, 2018

Fabric composer tips and tricks - importing external javascript library


In Hyperledger Fabric Composer at smart contact development importing external javascript libraries are not really supported at the moment. What you can basically do:

1. use the extra functionality on the client and server side and not directly in the smart contract. Pay attention that the smart contract is executed and evaluated on each endorsement peers of the Hyperledger Fabric architecture. This security guarantee is not always possible for most of the logic. Sometimes you can reconstruct your business logic in a way that the functionality provided by the external javascript library is executed on the client side and only the result is presented on the smart-contract side. 

2. if the code of the external javascript functionality is not huge, you can try to integrate the javascript files as extra files in your business network archive file. The framework references automatically the added javascript files. Certainly, you added files can not have external references.