diff --git a/test-network-nano-bash/configtx.yaml b/test-network-nano-bash/configtx.yaml index 98d9e8c7d9..74fe9a7649 100644 --- a/test-network-nano-bash/configtx.yaml +++ b/test-network-nano-bash/configtx.yaml @@ -297,8 +297,7 @@ Channel: &ChannelDefaults # ################################################################################ Profiles: - - TwoOrgsOrdererGenesis: + TwoOrgsChannel: <<: *ChannelDefaults Orderer: <<: *OrdererDefaults @@ -327,36 +326,10 @@ Profiles: HeartbeatTick: 1 MaxInflightBlocks: 5 SnapshotIntervalSize: 16 MB - Consortiums: - SampleConsortium: - Organizations: - - *Org1 - - *Org2 - TwoOrgsChannel: - Consortium: SampleConsortium - <<: *ChannelDefaults - Application: - <<: *ApplicationDefaults - Organizations: - - *Org1 - - *Org2 - Capabilities: - <<: *ApplicationCapabilities - Org1Channel: - Consortium: SampleConsortium - <<: *ChannelDefaults Application: <<: *ApplicationDefaults Organizations: - *Org1 - Capabilities: - <<: *ApplicationCapabilities - Org2Channel: - Consortium: SampleConsortium - <<: *ChannelDefaults - Application: - <<: *ApplicationDefaults - Organizations: - *Org2 Capabilities: <<: *ApplicationCapabilities @@ -385,7 +358,7 @@ Profiles: CollectTimeout: 1s RequestBatchMaxBytes: 10485760 IncomingMessageBufferSize: 200 - RequestPoolSize: 400 + RequestPoolSize: 100000 LeaderHeartbeatCount: 10 ConsenterMapping: - ID: 1 diff --git a/test-network-nano-bash/generate_artifacts.sh b/test-network-nano-bash/generate_artifacts.sh index 1c534a5719..b8c60852fd 100755 --- a/test-network-nano-bash/generate_artifacts.sh +++ b/test-network-nano-bash/generate_artifacts.sh @@ -18,17 +18,16 @@ 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 +ordererType="etcdraft" +if [ $# -gt 0 ] && [ "$1" = "BFT" ] +then + profile="BFTTwoOrgsApplicationGenesis" + ordererType="BFT" +else + profile="TwoOrgsChannel" +fi -echo "Generating channel create config transaction" -configtxgen -channelID mychannel -outputCreateChannelTx channel-artifacts/mychannel.tx -profile TwoOrgsChannel +echo "Generating application channel genesis block with ${ordererType} consensus" +configtxgen -profile ${profile} -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel -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 - -echo "Generating application channel genesis block with BFT consensus" -configtxgen -profile BFTTwoOrgsApplicationGenesis -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel diff --git a/test-network-nano-bash/network.sh b/test-network-nano-bash/network.sh index ddd93d9c87..31b17bdf40 100755 --- a/test-network-nano-bash/network.sh +++ b/test-network-nano-bash/network.sh @@ -57,7 +57,7 @@ networkStart() { CREATE_CHANNEL=false else echo "Generating artifacts..." - ./generate_artifacts.sh + ./generate_artifacts.sh ${ORDERER_TYPE} CREATE_CHANNEL=true fi @@ -69,8 +69,8 @@ networkStart() { ./orderer2.sh ${ORDERER_TYPE} > ./logs/orderer2.log 2>&1 & ./orderer3.sh ${ORDERER_TYPE} > ./logs/orderer3.log 2>&1 & - # start one additional orderer for smartbft consensus - if [ "$ORDERER_TYPE" = "smartbft" ]; then + # start one additional orderer for BFT consensus + if [ "$ORDERER_TYPE" = "BFT" ]; then ./orderer4.sh ${ORDERER_TYPE} > ./logs/orderer4.log 2>&1 & fi @@ -87,25 +87,25 @@ networkStart() { sleep ${CLI_DELAY} if [ "${CREATE_CHANNEL}" = "true" ]; then - if [ "$ORDERER_TYPE" = "smartbft" ]; then - echo "Joining orderers to channel..." - ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9443 - ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9444 - ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9445 + echo "Joining orderers to channel..." + ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9443 + ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9444 + ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9445 + if [ "$ORDERER_TYPE" = "BFT" ]; then ../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9446 - else - echo "Creating channel (peer1)..." - . ./peer1admin.sh && ./create_channel.sh + fi - echo "Joining channel (peer2)..." - . ./peer2admin.sh && ./join_channel.sh + echo "Creating channel (peer1)..." + . ./peer1admin.sh && ./join_channel.sh - echo "Joining channel (peer3)..." - . ./peer3admin.sh && ./join_channel.sh + echo "Joining channel (peer2)..." + . ./peer2admin.sh && ./join_channel.sh - echo "Joining channel (peer4)..." - . ./peer4admin.sh && ./join_channel.sh - fi + echo "Joining channel (peer3)..." + . ./peer3admin.sh && ./join_channel.sh + + echo "Joining channel (peer4)..." + . ./peer4admin.sh && ./join_channel.sh fi echo "Fabric network running. Use Ctrl-C to stop." diff --git a/test-network-nano-bash/orderer1.sh b/test-network-nano-bash/orderer1.sh index b4adb7ce47..1176b6cd27 100755 --- a/test-network-nano-bash/orderer1.sh +++ b/test-network-nano-bash/orderer1.sh @@ -17,17 +17,20 @@ export ORDERER_GENERAL_TLS_PRIVATEKEY="${PWD}"/crypto-config/ordererOrganization export ORDERER_GENERAL_TLS_CERTIFICATE="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt # following setting is not really needed at runtime since channel config has ca root certs, but we need to override the default in orderer.yaml export ORDERER_GENERAL_TLS_ROOTCAS="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt -if [ $# -gt 0 ] && [ "$1" = "smartbft" ] +export ORDERER_GENERAL_BOOTSTRAPMETHOD=none +export ORDERER_CHANNELPARTICIPATION_ENABLED=true +export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer +if [ $# -gt 0 ] then - export ORDERER_GENERAL_BOOTSTRAPMETHOD=none - export ORDERER_CHANNELPARTICIPATION_ENABLED=true -else - export ORDERER_GENERAL_BOOTSTRAPMETHOD=file - export ORDERER_GENERAL_BOOTSTRAPFILE="${PWD}"/channel-artifacts/genesis.block + if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ] + then + echo "Unsupported input consensus type ${1}" + exit 1 + fi + export ORDERER_CONSENSUS_TYPE=${1} fi -export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer -export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer/etcdraft/wal -export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer/etcdraft/wal +export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer/consensus/wal +export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer/consensus/snap export ORDERER_OPERATIONS_LISTENADDRESS=127.0.0.1:8443 export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9443 diff --git a/test-network-nano-bash/orderer2.sh b/test-network-nano-bash/orderer2.sh index 24932c24e8..c360477b49 100755 --- a/test-network-nano-bash/orderer2.sh +++ b/test-network-nano-bash/orderer2.sh @@ -17,17 +17,20 @@ export ORDERER_GENERAL_TLS_PRIVATEKEY="${PWD}"/crypto-config/ordererOrganization export ORDERER_GENERAL_TLS_CERTIFICATE="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt # following setting is not really needed at runtime since channel config has ca root certs, but we need to override the default in orderer.yaml export ORDERER_GENERAL_TLS_ROOTCAS="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/ca.crt -if [ $# -gt 0 ] && [ "$1" = "smartbft" ] +export ORDERER_GENERAL_BOOTSTRAPMETHOD=none +export ORDERER_CHANNELPARTICIPATION_ENABLED=true +export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer2 +if [ $# -gt 0 ] then - export ORDERER_GENERAL_BOOTSTRAPMETHOD=none - export ORDERER_CHANNELPARTICIPATION_ENABLED=true -else - export ORDERER_GENERAL_BOOTSTRAPMETHOD=file - export ORDERER_GENERAL_BOOTSTRAPFILE="${PWD}"/channel-artifacts/genesis.block + if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ] + then + echo "Unsupported input consensus type ${1}" + exit 1 + fi + export ORDERER_CONSENSUS_TYPE=${1} fi -export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer2 -export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer2/etcdraft/wal -export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer2/etcdraft/wal +export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer2/consensus/wal +export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer2/consensus/snap export ORDERER_OPERATIONS_LISTENADDRESS=127.0.0.1:8444 export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9444 diff --git a/test-network-nano-bash/orderer3.sh b/test-network-nano-bash/orderer3.sh index 74ab828c60..5151ee4d14 100755 --- a/test-network-nano-bash/orderer3.sh +++ b/test-network-nano-bash/orderer3.sh @@ -17,17 +17,20 @@ export ORDERER_GENERAL_TLS_PRIVATEKEY="${PWD}"/crypto-config/ordererOrganization export ORDERER_GENERAL_TLS_CERTIFICATE="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt # following setting is not really needed at runtime since channel config has ca root certs, but we need to override the default in orderer.yaml export ORDERER_GENERAL_TLS_ROOTCAS="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/ca.crt -if [ $# -gt 0 ] && [ "$1" = "smartbft" ] +export ORDERER_GENERAL_BOOTSTRAPMETHOD=none +export ORDERER_CHANNELPARTICIPATION_ENABLED=true +export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer3 +if [ $# -gt 0 ] then - export ORDERER_GENERAL_BOOTSTRAPMETHOD=none - export ORDERER_CHANNELPARTICIPATION_ENABLED=true -else - export ORDERER_GENERAL_BOOTSTRAPMETHOD=file - export ORDERER_GENERAL_BOOTSTRAPFILE="${PWD}"/channel-artifacts/genesis.block + if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ] + then + echo "Unsupported input consensus type ${1}" + exit 1 + fi + export ORDERER_CONSENSUS_TYPE=${1} fi -export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer3 -export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer3/etcdraft/wal -export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer3/etcdraft/wal +export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer3/consensus/wal +export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer3/consensus/snap export ORDERER_OPERATIONS_LISTENADDRESS=127.0.0.1:8445 export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9445 diff --git a/test-network-nano-bash/orderer4.sh b/test-network-nano-bash/orderer4.sh index 19fdee9d37..0a118c67e9 100755 --- a/test-network-nano-bash/orderer4.sh +++ b/test-network-nano-bash/orderer4.sh @@ -17,17 +17,20 @@ export ORDERER_GENERAL_TLS_PRIVATEKEY="${PWD}"/crypto-config/ordererOrganization export ORDERER_GENERAL_TLS_CERTIFICATE="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer4.example.com/tls/server.crt # following setting is not really needed at runtime since channel config has ca root certs, but we need to override the default in orderer.yaml export ORDERER_GENERAL_TLS_ROOTCAS="${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer4.example.com/tls/ca.crt -if [ $# -gt 0 ] && [ "$1" = "smartbft" ] +export ORDERER_GENERAL_BOOTSTRAPMETHOD=none +export ORDERER_CHANNELPARTICIPATION_ENABLED=true +export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer4 +if [ $# -gt 0 ] then - export ORDERER_GENERAL_BOOTSTRAPMETHOD=none - export ORDERER_CHANNELPARTICIPATION_ENABLED=true -else - export ORDERER_GENERAL_BOOTSTRAPMETHOD=file - export ORDERER_GENERAL_BOOTSTRAPFILE="${PWD}"/channel-artifacts/genesis.block + if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ] + then + echo "Unsupported input consensus type ${1}" + exit 1 + fi + export ORDERER_CONSENSUS_TYPE=${1} fi -export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer4 -export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer4/etcdraft/wal -export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer4/etcdraft/wal +export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer4/consensus/wal +export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer4/consensus/snap export ORDERER_OPERATIONS_LISTENADDRESS=127.0.0.1:8450 export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9446