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

alex@ubuntu: ~/dev/ $ curl -sSL http://bit.ly/2ysbOFE | bash -s
alex@ubuntu: ~/dev/ $ ls
alex@ubuntu: ~/dev/ $ cd fabric-samples/
alex@ubuntu: ~/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


Build
Your
First
Network

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

>_

Start the Sample Network

alex@ubuntu: ~/dev/fabric-samples/ $ cd first-network/
alex@ubuntu: ~/dev/fabric-samples/ $ ./byfn.sh -h
alex@ubuntu: ~/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

alex@ubuntu: ~/dev/fabric-samples/ $ ls channel-artifacts
alex@ubuntu: ~/dev/fabric-samples/ $ ls crypto-config

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

>_

Managing the network

alex@ubuntu: ~/dev/fabric-samples/ $ ./byfn.sh up // Turns on the network
alex@ubuntu: ~/dev/fabric-samples/ $ ./byfn.sh down // Shuts down the network
alex@ubuntu: ~/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!