mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Test network Nano bash provides a set of minimal bash scripts to run a Fabric network on your local machine. The network is functionally equivalent to the docker-based Test Network, you can therefore run all the tutorials and samples that target the Test Network. The Fabric release binaries are utilized rather than using docker containers to avoid all unnecessary layers. Only the chaincode and chaincode builder runs in a docker container behind the scenes. Using the Fabric binaries also makes it simple for Fabric developers to iteratively and quickly modify Fabric code and test a Fabric network as a user. Signed-off-by: David Enyeart <enyeart@us.ibm.com>
28 lines
1.3 KiB
Bash
Executable file
28 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# remove existing artifacts, or proceed on if the directories don't exist
|
|
rm -r "${PWD}"/channel-artifacts || true
|
|
rm -r "${PWD}"/crypto-config || true
|
|
rm -r "${PWD}"/data || true
|
|
|
|
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
|
|
|
echo "Generating MSP certificates using cryptogen tool"
|
|
cryptogen generate --config="${PWD}"/crypto-config.yaml
|
|
|
|
# set FABRIC_CFG_PATH to configtx.yaml directory that contains the profiles
|
|
export FABRIC_CFG_PATH="${PWD}"
|
|
|
|
echo "Generating orderer genesis block"
|
|
configtxgen -profile TwoOrgsOrdererGenesis -channelID test-system-channel-name -outputBlock channel-artifacts/genesis.block
|
|
|
|
echo "Generating channel create config transaction"
|
|
configtxgen -channelID mychannel -outputCreateChannelTx channel-artifacts/mychannel.tx -profile TwoOrgsChannel
|
|
|
|
echo "Generating anchor peer update transaction for Org1"
|
|
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
|
|
|
|
echo "Generating anchor peer update transaction for Org2"
|
|
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
|