I've been asking myself whether there is an easy way of debugging the JavaScript code of the transactions. JS already has mature debuggers, it is only a question of how to easily bind it to the code running in the container. Does anyone have a clue? -- Thx.
相关问题
- chaincode in hyperledger composer vs chaincode in
- How to get timestamp when transaction is committed
- Instantiating Chaincode in Hyperledger Composer wi
- How to deploy Hyperledger Composer to “Azure Hyper
- Hyperledger-Composer: Issuing identity using REST-
相关文章
- Does Composer needs an already built Fabric networ
- Error: Cannot find module './api' (Hyperle
- how to access the 'eventEmitted' field in
- Hyperledger Composer - ACL Rule with function in c
- Get Count of assets in HyperLedger Composer Query?
- Hyperledger composer network install
- Getting timestamps in deterministic way in Hyperle
- is there any size limit for pdf in hyperledger fab
One of the easiest ways to debug your transaction code is to deploy your business network into an embedded fabric which basically means that your code is run as any other NodeJS app is and you can use the node debugger to step through your code or even simple console.log statements if that suffices.
To get an insight into how to achieve this, have a look at the code here: UPDATED LINK https://github.com/hyperledger/composer-sample-networks/blob/master/packages/carauction-network/test/CarAuction.js#L31-L49
This is the beforeEach method of a unit test for the sample network and as you'll see, it deploys the network to the 'embedded' fabric.
The code then goes on to perform tests that include calling the
submitTransaction
API on the embedded businessNetworkConnection which then causes the Transaction script code to be eval'ed by the embedded fabric.So it's all happening within a single Node app and is much easier to debug.
HTH