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

  • 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.

主站蜘蛛池模板: 界首市| 兴海县| 思茅市| 德格县| 紫阳县| 诸暨市| 巩义市| 绥江县| 云霄县| 民县| 班戈县| 罗江县| 平遥县| 莱芜市| 饶平县| 邢台市| 华阴市| 合肥市| 枝江市| 吴川市| 临洮县| 尼玛县| 上林县| 邢台县| 永康市| 五寨县| 抚松县| 兴安县| 汶川县| 平定县| 白银市| 靖安县| 景东| 康马县| 齐河县| 枣庄市| 岗巴县| 昂仁县| 龙山县| 屏东县| 永城市|