官术网_书友最值得收藏!

  • Hyperledger Cookbook
  • Xun (Brian) Wu Chuanfeng Zhang Andrew Zhang
  • 169字
  • 2021-06-24 14:59:36

How to do it...

To write your first application, follow these steps:

  1. Set up the development environment:
        $ cd ~
cd fabric-samples/first-network
sudo docker ps
sudo ./byfn.sh down
sudo docker rm -f $(sudo docker ps -aq)
sudo docker network prune
cd ../fabcar && ls

You will notice that there are a few Node.js file present in fabcar folder such as enrollAdmin.js, invoke.js, query.js, registerUser.js, and package.json and all others packaged into one startFabric.sh file.

  1. Install the Fabric client:
        $ sudo npm install -g npm@5.3.0
$ sudo npm update

You will notice from the following screenshot that the Fabric client 1.3.0 and Fabric CA client 1.30 packages are installed:

  1. Execute the following command to launch the network:
        $ sudo ./startFabric.sh node
  1. Open a new Terminal to stream the Docker logs:
        $ sudo docker logs -f ca.example.com

This will open the Docker file, which will look similar to the following screenshot:

Next, we will use the Node.js script to run, query, and update the records on Fabric network.

主站蜘蛛池模板: 兴宁市| 南和县| 白朗县| 当阳市| 西平县| 略阳县| 蓬溪县| 北安市| 泸定县| 彰武县| 丽水市| 永登县| 上饶市| 宁强县| 呼和浩特市| 贵定县| 响水县| 勃利县| 安化县| 洪江市| 铜鼓县| 芦山县| 达州市| 葫芦岛市| 江门市| 乳山市| 颍上县| 霍山县| 耿马| 高淳县| 通河县| 翁牛特旗| 青浦区| 叶城县| 城口县| 平舆县| 崇文区| 渭源县| 贺州市| 宽甸| 富平县|