Skip to content

Instantly share code, notes, and snippets.

@jt-nti
Last active May 18, 2018 13:15
Show Gist options
  • Save jt-nti/6e751a1f6f8f3c97e4a6452ecb79c5d8 to your computer and use it in GitHub Desktop.
Save jt-nti/6e751a1f6f8f3c97e4a6452ecb79c5d8 to your computer and use it in GitHub Desktop.
IBM Blockchain Platform notes

Starter plan

Trying to get starter plan to work using the Composer playgound...

  1. Eventually found this bit of doc which seems like a start: https://console.bluemix.net/docs/services/blockchain/develop_starter.html#deploying-a-business-network

  2. Viewing the raw JSON and creating a business network card in the playground should work

  3. Fail! Going to need to actually follow the very long instructions and use the cli to create a card! (Just give me a button!)

  4. So, using containers is 'fun'...

docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 composer-volume

docker run -it --rm -v composer-volume:/home/composer/.composer -v ${PWD}:/tmp/hostdir composer-cli card create -f /tmp/hostdir/ca.card -p /tmp/hostdir/starter.json -u admin -s <enroll>

  1. Funky named volumes didn't actually work to keep the card data between runs. Maybe tmpfs is too temporary. Plan B...

docker run -it --rm -v ${PWD}/composer-data:/home/composer/.composer -v ${PWD}:/home/composer/hostdir composer-cli card import -f ./hostdir/ca.card -c ca

docker run -it --rm -v ${PWD}/composer-data:/home/composer/.composer -v ${PWD}:/home/composer/hostdir composer-cli card list

docker run -it --rm -v ${PWD}/composer-data:/home/composer/.composer -v ${PWD}:/home/composer/hostdir composer-cli identity request --card ca --path ./hostdir/credentials -u admin -s <enroll>

docker run -it --rm -v ${PWD}/composer-data:/home/composer/.composer -v ${PWD}:/home/composer/hostdir composer-cli card create -f ./hostdir/adminCard.card -p ./hostdir/starter.json -u admin -c ./hostdir/credentials/admin-pub.pem -k ./hostdir/credentials/admin-priv.pem --role PeerAdmin --role ChannelAdmin

  1. That should be enough to import in to the playground and deploy a new business network. In theory you would bind the new business network admin to an identity certificate and private key but: a) that doesn't work and b) the Starter Plan Fabric allows multiple enrollments (i.e. use the admin/secret from the downloaded connection profile json)!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment