mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
Update to use channel participation api
Signed-off-by: Parameswaran Selvam <parselva@in.ibm.com>
This commit is contained in:
parent
fd3cf67a49
commit
aa33bd6f25
7 changed files with 88 additions and 104 deletions
|
|
@ -297,8 +297,7 @@ Channel: &ChannelDefaults
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
Profiles:
|
Profiles:
|
||||||
|
TwoOrgsChannel:
|
||||||
TwoOrgsOrdererGenesis:
|
|
||||||
<<: *ChannelDefaults
|
<<: *ChannelDefaults
|
||||||
Orderer:
|
Orderer:
|
||||||
<<: *OrdererDefaults
|
<<: *OrdererDefaults
|
||||||
|
|
@ -327,14 +326,6 @@ Profiles:
|
||||||
HeartbeatTick: 1
|
HeartbeatTick: 1
|
||||||
MaxInflightBlocks: 5
|
MaxInflightBlocks: 5
|
||||||
SnapshotIntervalSize: 16 MB
|
SnapshotIntervalSize: 16 MB
|
||||||
Consortiums:
|
|
||||||
SampleConsortium:
|
|
||||||
Organizations:
|
|
||||||
- *Org1
|
|
||||||
- *Org2
|
|
||||||
TwoOrgsChannel:
|
|
||||||
Consortium: SampleConsortium
|
|
||||||
<<: *ChannelDefaults
|
|
||||||
Application:
|
Application:
|
||||||
<<: *ApplicationDefaults
|
<<: *ApplicationDefaults
|
||||||
Organizations:
|
Organizations:
|
||||||
|
|
@ -342,24 +333,6 @@ Profiles:
|
||||||
- *Org2
|
- *Org2
|
||||||
Capabilities:
|
Capabilities:
|
||||||
<<: *ApplicationCapabilities
|
<<: *ApplicationCapabilities
|
||||||
Org1Channel:
|
|
||||||
Consortium: SampleConsortium
|
|
||||||
<<: *ChannelDefaults
|
|
||||||
Application:
|
|
||||||
<<: *ApplicationDefaults
|
|
||||||
Organizations:
|
|
||||||
- *Org1
|
|
||||||
Capabilities:
|
|
||||||
<<: *ApplicationCapabilities
|
|
||||||
Org2Channel:
|
|
||||||
Consortium: SampleConsortium
|
|
||||||
<<: *ChannelDefaults
|
|
||||||
Application:
|
|
||||||
<<: *ApplicationDefaults
|
|
||||||
Organizations:
|
|
||||||
- *Org2
|
|
||||||
Capabilities:
|
|
||||||
<<: *ApplicationCapabilities
|
|
||||||
BFTTwoOrgsApplicationGenesis:
|
BFTTwoOrgsApplicationGenesis:
|
||||||
<<: *ChannelDefaults
|
<<: *ChannelDefaults
|
||||||
Orderer:
|
Orderer:
|
||||||
|
|
@ -385,7 +358,7 @@ Profiles:
|
||||||
CollectTimeout: 1s
|
CollectTimeout: 1s
|
||||||
RequestBatchMaxBytes: 10485760
|
RequestBatchMaxBytes: 10485760
|
||||||
IncomingMessageBufferSize: 200
|
IncomingMessageBufferSize: 200
|
||||||
RequestPoolSize: 400
|
RequestPoolSize: 100000
|
||||||
LeaderHeartbeatCount: 10
|
LeaderHeartbeatCount: 10
|
||||||
ConsenterMapping:
|
ConsenterMapping:
|
||||||
- ID: 1
|
- ID: 1
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,16 @@ cryptogen generate --config="${PWD}"/crypto-config.yaml
|
||||||
# set FABRIC_CFG_PATH to configtx.yaml directory that contains the profiles
|
# set FABRIC_CFG_PATH to configtx.yaml directory that contains the profiles
|
||||||
export FABRIC_CFG_PATH="${PWD}"
|
export FABRIC_CFG_PATH="${PWD}"
|
||||||
|
|
||||||
echo "Generating orderer genesis block"
|
ordererType="etcdraft"
|
||||||
configtxgen -profile TwoOrgsOrdererGenesis -channelID test-system-channel-name -outputBlock channel-artifacts/genesis.block
|
if [ $# -gt 0 ] && [ "$1" = "BFT" ]
|
||||||
|
then
|
||||||
|
profile="BFTTwoOrgsApplicationGenesis"
|
||||||
|
ordererType="BFT"
|
||||||
|
else
|
||||||
|
profile="TwoOrgsChannel"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Generating channel create config transaction"
|
echo "Generating application channel genesis block with ${ordererType} consensus"
|
||||||
configtxgen -channelID mychannel -outputCreateChannelTx channel-artifacts/mychannel.tx -profile TwoOrgsChannel
|
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
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ networkStart() {
|
||||||
CREATE_CHANNEL=false
|
CREATE_CHANNEL=false
|
||||||
else
|
else
|
||||||
echo "Generating artifacts..."
|
echo "Generating artifacts..."
|
||||||
./generate_artifacts.sh
|
./generate_artifacts.sh "${ORDERER_TYPE}"
|
||||||
CREATE_CHANNEL=true
|
CREATE_CHANNEL=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -65,13 +65,13 @@ networkStart() {
|
||||||
mkdir -p "${PWD}"/logs
|
mkdir -p "${PWD}"/logs
|
||||||
|
|
||||||
echo "Starting orderers..."
|
echo "Starting orderers..."
|
||||||
./orderer1.sh ${ORDERER_TYPE} > ./logs/orderer1.log 2>&1 &
|
./orderer1.sh "${ORDERER_TYPE}" > ./logs/orderer1.log 2>&1 &
|
||||||
./orderer2.sh ${ORDERER_TYPE} > ./logs/orderer2.log 2>&1 &
|
./orderer2.sh "${ORDERER_TYPE}" > ./logs/orderer2.log 2>&1 &
|
||||||
./orderer3.sh ${ORDERER_TYPE} > ./logs/orderer3.log 2>&1 &
|
./orderer3.sh "${ORDERER_TYPE}" > ./logs/orderer3.log 2>&1 &
|
||||||
|
|
||||||
# start one additional orderer for smartbft consensus
|
# start one additional orderer for BFT consensus
|
||||||
if [ "$ORDERER_TYPE" = "smartbft" ]; then
|
if [ "$ORDERER_TYPE" = "BFT" ]; then
|
||||||
./orderer4.sh ${ORDERER_TYPE} > ./logs/orderer4.log 2>&1 &
|
./orderer4.sh "${ORDERER_TYPE}" > ./logs/orderer4.log 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting ${CLI_DELAY}s..."
|
echo "Waiting ${CLI_DELAY}s..."
|
||||||
|
|
@ -87,25 +87,25 @@ networkStart() {
|
||||||
sleep ${CLI_DELAY}
|
sleep ${CLI_DELAY}
|
||||||
|
|
||||||
if [ "${CREATE_CHANNEL}" = "true" ]; then
|
if [ "${CREATE_CHANNEL}" = "true" ]; then
|
||||||
if [ "$ORDERER_TYPE" = "smartbft" ]; then
|
echo "Joining orderers to channel..."
|
||||||
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: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:9444
|
../bin/osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:9445
|
||||||
../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
|
../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
|
|
||||||
|
|
||||||
echo "Joining channel (peer2)..."
|
|
||||||
. ./peer2admin.sh && ./join_channel.sh
|
|
||||||
|
|
||||||
echo "Joining channel (peer3)..."
|
|
||||||
. ./peer3admin.sh && ./join_channel.sh
|
|
||||||
|
|
||||||
echo "Joining channel (peer4)..."
|
|
||||||
. ./peer4admin.sh && ./join_channel.sh
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Creating channel (peer1)..."
|
||||||
|
. ./peer1admin.sh && ./join_channel.sh
|
||||||
|
|
||||||
|
echo "Joining channel (peer2)..."
|
||||||
|
. ./peer2admin.sh && ./join_channel.sh
|
||||||
|
|
||||||
|
echo "Joining channel (peer3)..."
|
||||||
|
. ./peer3admin.sh && ./join_channel.sh
|
||||||
|
|
||||||
|
echo "Joining channel (peer4)..."
|
||||||
|
. ./peer4admin.sh && ./join_channel.sh
|
||||||
fi
|
fi
|
||||||
echo "Fabric network running. Use Ctrl-C to stop."
|
echo "Fabric network running. Use Ctrl-C to stop."
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
# 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
|
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
|
||||||
then
|
export ORDERER_CHANNELPARTICIPATION_ENABLED=true
|
||||||
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
|
|
||||||
fi
|
|
||||||
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer
|
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer
|
||||||
export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer/etcdraft/wal
|
if [ $# -gt 0 ]
|
||||||
export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer/etcdraft/wal
|
then
|
||||||
|
if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ]
|
||||||
|
then
|
||||||
|
echo "Unsupported input consensus type ${1}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export ORDERER_CONSENSUS_TYPE=${1}
|
||||||
|
fi
|
||||||
|
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_OPERATIONS_LISTENADDRESS=127.0.0.1:8443
|
||||||
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9443
|
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9443
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
# 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
|
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
|
||||||
then
|
export ORDERER_CHANNELPARTICIPATION_ENABLED=true
|
||||||
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
|
|
||||||
fi
|
|
||||||
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer2
|
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer2
|
||||||
export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer2/etcdraft/wal
|
if [ $# -gt 0 ]
|
||||||
export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer2/etcdraft/wal
|
then
|
||||||
|
if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ]
|
||||||
|
then
|
||||||
|
echo "Unsupported input consensus type ${1}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export ORDERER_CONSENSUS_TYPE=${1}
|
||||||
|
fi
|
||||||
|
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_OPERATIONS_LISTENADDRESS=127.0.0.1:8444
|
||||||
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9444
|
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9444
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
# 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
|
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
|
||||||
then
|
export ORDERER_CHANNELPARTICIPATION_ENABLED=true
|
||||||
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
|
|
||||||
fi
|
|
||||||
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer3
|
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer3
|
||||||
export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer3/etcdraft/wal
|
if [ $# -gt 0 ]
|
||||||
export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer3/etcdraft/wal
|
then
|
||||||
|
if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ]
|
||||||
|
then
|
||||||
|
echo "Unsupported input consensus type ${1}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export ORDERER_CONSENSUS_TYPE=${1}
|
||||||
|
fi
|
||||||
|
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_OPERATIONS_LISTENADDRESS=127.0.0.1:8445
|
||||||
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9445
|
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9445
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
# 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
|
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
|
||||||
then
|
export ORDERER_CHANNELPARTICIPATION_ENABLED=true
|
||||||
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
|
|
||||||
fi
|
|
||||||
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer4
|
export ORDERER_FILELEDGER_LOCATION="${PWD}"/data/orderer4
|
||||||
export ORDERER_CONSENSUS_WALDIR="${PWD}"/data/orderer4/etcdraft/wal
|
if [ $# -gt 0 ]
|
||||||
export ORDERER_CONSENSUS_SNAPDIR="${PWD}"/data/orderer4/etcdraft/wal
|
then
|
||||||
|
if [ "$1" != "BFT" ] && [ "$1" != "etcdraft" ]
|
||||||
|
then
|
||||||
|
echo "Unsupported input consensus type ${1}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export ORDERER_CONSENSUS_TYPE=${1}
|
||||||
|
fi
|
||||||
|
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_OPERATIONS_LISTENADDRESS=127.0.0.1:8450
|
||||||
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9446
|
export ORDERER_ADMIN_LISTENADDRESS=127.0.0.1:9446
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue