Intro to Private Blockchains

Deploying your First Network

DOWNLOAD THE EXAMPLE FILES


Starting from an appropriate directory, download the sample files and enter the /bin/ subfolder.

>_

Download the Sample Project

[email protected]: ~/dev/ $ curl -sSL http://bit.ly/2ysbOFE | bash -s
[email protected]: ~/dev/ $ ls
[email protected]: ~/dev/ $ cd fabric-samples/
[email protected]: ~/dev/ $ cd bin

DEPLOY THE EXAMPLE


This folder contains some example launch scripts to help you set up a hyperledger network. The scripts will automatically launch several docker containers, which will simulate a network with multiple independant nodes.

BYFN.sh

The Hyperledger team has compiled this script to help us easily set up a whole network at once. It will deploy our chain code to a number of Docker containers, and help us simulate a network!
~ Build
~ Your
~ First
~ Network

Let’s try running the starter script, and we can explore how it generates the network.

>_

Start the Sample Network

[email protected]: ~/dev/fabric-samples/ $ cd first-network/
[email protected]: ~/dev/fabric-samples/ $ ./byfn.sh -h
[email protected]: ~/dev/fabric-samples/ $ ./byfn.sh generate

Now that we have the network up and running, let’s see what files were generated.

If the dependency installs aren’t set properly then you’ll need to spin down the network, verify all dependencies, and then spin up the network again
>_

Finding the

[email protected]: ~/dev/fabric-samples/ $ ls channel-artifacts
[email protected]: ~/dev/fabric-samples/ $ ls crypto-config

There are a few commands available from the network launch script.

>_

Managing the network

[email protected]: ~/dev/fabric-samples/ $ ./byfn.sh up // Turns on the network
[email protected]: ~/dev/fabric-samples/ $ ./byfn.sh down // Shuts down the network
[email protected]: ~/dev/fabric-samples/ $ ./byfn.sh generate // Generates a new network

Once the install is complete, you’ll see a nice ascii art printout of the word END, which means everything worked!