Skip to content

Commit

Permalink
[FAB-5038] Generate artifacts if they don't exist
Browse files Browse the repository at this point in the history
If you run ./byfn -m up prior to running
./byfn -m generate, things will fail - which
would normally be OK except in the case where
you are running the Docker daemon as root -
which is the default on Linux systems.  The issue
is that the Docker daemon will automatically
generate host paths for volumes if they don't exist
and they will be owned by whoever is running the
Docker process resulting in the error reported
in FAB-5038.

To fix this, simply check for the existence of
the crypto-config folder and if it does not
exist run the equivalent commands as the
generate option

Change-Id: Ic5b48682a527951ac6eab5b5cf2d0fc6dbdaad56
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
  • Loading branch information
mastersingh24 committed Jun 30, 2017
1 parent 957a1ff commit f9c2954
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions first-network/byfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ function removeUnwantedImages() {

# Generate the needed certificates, the genesis block and start the network.
function networkUp () {
# generate artifacts if they don't exist
if [ ! -d "crypto-config" ]; then
generateCerts
replacePrivateKey
generateChannelArtifacts
fi
CHANNEL_NAME=$CHANNEL_NAME TIMEOUT=$CLI_TIMEOUT docker-compose -f $COMPOSE_FILE up -d 2>&1
if [ $? -ne 0 ]; then
echo "ERROR !!!! Unable to start network"
Expand Down

0 comments on commit f9c2954

Please sign in to comment.