Skip to content

Instantly share code, notes, and snippets.

@mtnieto
Last active October 23, 2018 13:00
Show Gist options
  • Save mtnieto/406dab86d767bd2f66e9c710804c9308 to your computer and use it in GitHub Desktop.
Save mtnieto/406dab86d767bd2f66e9c710804c9308 to your computer and use it in GitHub Desktop.
function generateChannelArtifacts(){
if [ ! -d ./channel-artifacts ]; then
mkdir channel-artifacts
fi
if [ ! -f $GOPATH/bin/configtxgen ]; then
go get github.com/hyperledger/fabric/common/configtx/tool/configtxgen
fi
echo
echo "#################################################################"
echo "### Generating channel configuration transaction 'channel.tx' ###"
echo "#################################################################"
$GOPATH/bin/configtxgen -profile SeriesOrdererGenesis -channelID syschain -outputBlock ./channel-artifacts/genesis.block
$GOPATH/bin/configtxgen -profile serieschannel -outputCreateChannelTx ./channel-artifacts/serieschannel.tx -channelID "serieschannel"
echo
echo "#################################################################"
echo "####### Generating anchor peer update for netflixMSP ##########"
echo "#################################################################"
$GOPATH/bin/configtxgen -profile serieschannel -outputAnchorPeersUpdate ./channel-artifacts/netflixMSPanchors.tx -channelID "serieschannel" -asOrg netflixMSP
echo
echo "#################################################################"
echo "####### Generating anchor peer update for hboMSP ##########"
echo "#################################################################"
$GOPATH/bin/configtxgen -profile serieschannel -outputAnchorPeersUpdate ./channel-artifacts/hboMSPanchors.tx -channelID "serieschannel" -asOrg hboMSP
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment