Launch the WYFA Network

Q

How to Launch the Hyperledger Fabric Network to run the WYFA (Writing Your First Application) tutorial?

✍: FYIcenter.com

A

You can follow these steps to Launch the Hyperledger Fabric Network to run the WYFA (Writing Your First Application) tutorial.

1. Run the startFabric.sh script to spin up a blockchain network, create a channel and deploy a chaincode:

$ cd ~/hyperledger-binaries/fabric-samples/fabcar

$ ./startFabric.sh  javascript

# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1

docker-compose -f docker-compose.yml down
Removing network net_basic
WARNING: Network net_basic not found.

docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com \
   peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Creating orderer.example.com ... done
Creating couchdb             ... done
Creating ca.example.com      ... done
Creating peer0.org1.example.com ... done

export FABRIC_START_TIMEOUT=10
sleep ${FABRIC_START_TIMEOUT}

# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" ...\
   peer channel create -o orderer.example.com:7050 \
   -c mychannel -f /etc/hyperledger/configtx/channel.tx

[channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
[cli.common] readBlock -> INFO 002 Received block: 0

# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" ...\
   peer channel join -b mychannel.block

[channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
[channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
Creating cli ... done

[chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
[chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
[chaincodeCmd] submitInstallProposal -> INFO 003 Installed remotely: response:<status:200 payload:"OK" >
[chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
[chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

Error: could not assemble transaction, err proposal response was not 
successful, error code 500, msg error starting container: error starting 
container: Failed to generate platform-specific docker build: Failed to 
pull hyperledger/fabric-nodeenv:latest: API error (404): manifest for 
hyperledger/fabric-nodeenv:latest not found

The script failed late in the process. So the WYFA network is almost running.

2. Verify Docker containers running for the WYFA network:

$ docker ps -a

IMAGE                       STATUS         NAMES

hyperledger/fabric-tools    Up 15 minutes  cli
hyperledger/fabric-peer     Up 15 minutes  peer0.org1.example.com
hyperledger/fabric-ca       Up 15 minutes  ca.example.com
hyperledger/fabric-couchdb  Up 15 minutes  couchdb
hyperledger/fabric-orderer  Up 15 minutes  orderer.example.com

 

Verify the WYFA Network

Clean Up Docker Engine for WYFA

WYFA (Writing Your First Application)

⇑⇑ Hyperledger Tutorials

2020-02-29, 353👍, 0💬