Putting it all together

The sequence of steps described previously can be run in one go through a suitably coded script. As mentioned earlier, createTradeApp.js contains such a script, which results in the creation of tradechannel, the joining of the four peers to that channel, the installation of the trade_workflow chaincode on all four peers, and its subsequent instantiation on the channel, which finally concludes with the creation of a trade request from the importer to the exporter and a follow-up querying the request status. You can run the following command and see the various steps being conducted on your console:

node createTradeApp.js

Just as an exercise, and to test out both the middleware library functions and the chaincode, you can complete the trade scenario that the createTradeApp.js script began by starting with a trade request acceptance by an exporter and culminating with full payment made to the exporter by the importer for a successfully delivered shipment. To view this in operation, run the following:

node runTradeScenarioApp.js
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.139.8