Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Hyperledger Fabric build the first Network

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you Hyperledger Fabric how to build the first network, I hope you will learn something after reading this article, let's discuss it together!

precondition

Operating system

Ubuntu or MacOS is recommended, but windows is not recommended

Curl

Download the latest version of the curl tool installation (if not already installed)

Docker and Docker Compose

Docker version 17.06.2-ce or later.

Docker Compose version 1.14.0 or later.

The following command checks the version of the installed Docker:

Docker-version

The following command checks the version of the installed Docker Compose:

Docker-compose-version

Go

Hyperledger Fabric uses the Go programming language 1.11.x for many of its components

The environment variable sets GOPATH to:

Export GOPATH=$HOME/go

Add GOPATH/bin to the PATH:

Export PATH = $PATH:$ GOPATH / bin

Node.js and NPM

To develop Hyperledger Fabric applications with Hyperledger Fabric SDK for Node.js, you need to install version 8.9.x of Node.js.

Installing Node.js also installs NPM, but it is recommended that the command upgrade the tool:

Npm install npm@5.6.0-g

Git

Download and install Git

Build the first network

1. Clone hyperledger/fabric-samples

Git clone https://github.com/hyperledger/fabric-samples.git

two。 Switch to the fabric-samples folder

Cd fabric-samples

3. Install the specified version of Hyperledger Fabric platform-specific binaries and configuration files into the bin folder and config folder in the root directory of the fabric-samples repository, and download the specified version of the Hyperledger Fabric docker image

. / scripts/bootstrap.sh [version] [ca version] [thirdparty_version]

4. Build the first network

(1) use first-network samples

Cd first-network

(2) help text of byfn.sh script

Usage: byfn.sh [- c] [- t] [- d] [- f] [- s] [- l] [- I] [- v]-one of 'up',' down', 'restart' 'generate' or' upgrade'-'up'-bring up the network with docker-compose up -' down'-clear the network with docker-compose down-'restart'-restart the network -' generate'-generate required certificates and genesis block-'upgrade'-upgrade the network from v1.0.x to v1.1-c-channel name to use (defaults to "mychannel")-t- CLI timeout duration in seconds (defaults to 10)-d-delay duration in seconds (defaults to 3)-f-specify which docker-compose file use (defaults to docker-compose-cli.yaml)-s-the database backend to use: goleveldb (default) or couchdb-l-the chaincode language: golang (default) Node or java-I-the tag to be used to launch the network (defaults to "latest")-v-verbose mode byfn.sh-h (print this message) Typically, one would first generate the required certificates andgenesis block, then bring up the network. E.g.: byfn.sh generate-c mychannel byfn.sh up-c mychannel-s couchdb byfn.sh up-c mychannel-s couchdb-I 1.1.0-alpha byfn.sh up-l node byfn.sh down-c mychannel byfn.sh upgrade-c mychannelTaking all defaults: byfn.sh generate byfn.sh up byfn.sh down

(3) generate the msp certificate key file with a brief description. Press enter to continue.

. / byfn.sh generate

Log output

(4) start the network

. / byfn.sh up

The log will see from start

At this point, the first alliance chain was successfully built by an automated script, and the next chapter will analyze the details.

(5) terminate the network, terminate the container, delete the encrypted material and four artifacts, and delete the code image on the chain.

. / byfn.sh down after reading this article, I believe you have a certain understanding of "how to build the first network of Hyperledger Fabric". If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report