Fabric has great document for it.
See https://hyperledger-fabric.readthedocs.io/en/release-1.2/build_network.html#

But, once you try you own network from scratch, you will face lots of unexpected obstacles.
So, in addition to this guide, I would like to mention some more information. If you are not familiar with docker and docker-compose, you may confuse what is exactly happending inside of byfn(Build Your First Network). Therefore, before staring building your network, please understand what is docker and docker-compose.

One important thing regarding docker-compose is, by default docker-compose uses user-defined bridge network mode. And, instantiation CC means running docker-container. Problem is, container for CC also should join to network in where peer is joined.

Environment variable CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE is for it!

You should NOT forget this!
Without this, container cannot connect to peer nodes!

블로그 이미지


In case of promise is NOT fullfilled forever, mocha doens't give any information about this.
See test below.

    describe('test', function () {
        it('test', async () => {
            await new Promise((r, j) => {});

This gives only following result in terminal

Waiting for the debugger to disconnect...

No more informations!

블로그 이미지


Tag mocha, test

Environment: Hyperledger Fabric v1.2

Fabric uses 'npm install --production' to build chaincode docker image.

And run CC by using 'npm start -- --peer.address'

So, only following files are needed to be released

  • javascript files
  • package.json
  • package-lock.json

In case of NodeJs, javascript files should be deployed to peer nodes. So, usually uglifying and optimization is required.
And webpack is most popular tool for this requirements.
And in case that all source codes are bundled to one file - bundle.js - then, releasing only three files are enough!

  • bundle.js
  • package.json
  • package-lock.json

And 'npm start' may look like 'node bundle.js'.

블로그 이미지