Skip to content

Instantly share code, notes, and snippets.

@ceccode
Last active April 21, 2019 16:43
Show Gist options
  • Save ceccode/ade5b798af2f9d78f9da032e72f29004 to your computer and use it in GitHub Desktop.
Save ceccode/ade5b798af2f9d78f9da032e72f29004 to your computer and use it in GitHub Desktop.
HyperLedger Fabric cheat sheet

HyperLedger Fabric cheat sheet

Install

mkdir ~/fabric-dev-servers && cd ~/fabric-dev-servers
curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz
tar -xvf fabric-dev-servers.tar.gz

Set version

cd ~/fabric-dev-servers
export FABRIC_VERSION=hlfv12

Starting and stopping Hyperledger Fabric

Start Hyperledger Fabric

~/fabric-dev-servers/startFabric.sh

Stop Hyperledger Fabric

~/fabric-dev-servers/stopFabric.sh

Starting and stopping without losing data

The startFabric.sh removes existing Fabric Containers and recreates new Containers from the Docker Images. You'll lose all your data and your Business Network.

To ensure that you do not lose data you should use docker commands to stop and start the containers:

Stop

 docker stop $(docker ps -q)

Start

 docker start $(docker ps -aq)

Note: This will stop and start all Docker containers. Use docker ps to find fabric-related containers and than start and stop only thosecontainers.

Create Peer Admin card

~/fabric-dev-servers/createPeerAdminCard.sh

Get details of a specific card

composer card list --card <Card Name>

Teardown Fabric

Remove also the Peer Admin card.

~/fabric-dev-servers/teardownFabric.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment