Skip to content

Commit

Permalink
version 3 completed heading towards adding BFT support
Browse files Browse the repository at this point in the history
Signed-off-by: Sanket <[email protected]>
  • Loading branch information
Sanket-0510 committed Nov 22, 2024
1 parent 4b3e785 commit a711deb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
2 changes: 1 addition & 1 deletion e2e-network/docker/test-05-version3-BFT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FABLO_HOME="$TEST_TMP/../../.."

export FABLO_HOME

CONFIG="$FABLO_HOME/fablo-config-hlf3-bft-1orgs-1chaincode.json"
CONFIG="$FABLO_HOME/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json"

networkUp() {
"$FABLO_HOME/fablo-build.sh"
Expand Down
2 changes: 1 addition & 1 deletion samples/fablo-config-hlf3-1orgs-1chaincode.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"orderers": [
{
"groupName": "group1",
"type": "BFT",
"type": "raft",
"instances": 4
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@
<% })} -%>

<% if (ordererGroup.consensus == "BFT") { %>
smartBFT:
SmartBFT:
RequestBatchMaxCount: 100
RequestBatchMaxInterval: 50ms
RequestForwardTimeout: 2s
RequestComplainTimeout: 20s
RequestAutoRemoveTimeout: 3m0s
ViewChangeResendInterval: 5s
ViewChangeTimeout: 20s
LeaderHeartbeatTimeout: 1m0s
CollectTimeout: 1s
RequestBatchMaxBytes: 10485760
IncomingMessageBufferSize: 200
RequestPoolSize: 100000
LeaderHeartbeatCount: 10
ConsenterMapping:<% ordererGroup.orderers.forEach(function(orderer, index) { %>
- ID: <%= index+1 %>
Host: <%= orderer.address %>
Expand Down
15 changes: 8 additions & 7 deletions src/setup-docker/templates/fabric-docker/commands-generated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,26 @@ generateChannelsArtifacts() {
}
installChannels() {
set -x
<% if (!channels || !channels.length) { -%>
echo "No channels"
<% } else if (global.capabilities.isV3) { -%>
<% channels.forEach((channel) => { -%>
<% channel.ordererGroup.orderers.forEach((orderer) => { -%>
<% const org = orgs.find((org) => org.name === orderer.orgName); -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; createChannelAndJoinTls '<%= channel.name %>' '<%= orderer.orgMspName %>' 'example.com' 'crypto/users/Admin@test/msp' '<%= orderer.address %>:<%= orderer.adminPort %>';"
<% }) -%>
sleep 8
<% channel.orgs.forEach((org, orgNo) => { -%>
<% org.peers.forEach((peer, peerNo) => { -%>
<% if (orgNo == 0 && peerNo == 0) { -%>
printHeadline "Creating '<%= channel.name %>' on <%= org.name %>/<%= peer.name %>" "U1F63B"
<% if (!global.tls) { -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; createChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.address %>:<%= channel.ordererHead.adminPort %>';"
sleep 5
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; fetchChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.fullAddress %>';"
<% } else { -%>
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; createChannelAndJoinTls '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' 'crypto/users/Admin@<%= org.domain %>/tls' 'crypto-orderer/tlsca.<%= channel.ordererHead.domain %>-cert.pem' '<%= channel.ordererHead.address %>:<%= channel.ordererHead.adminPort %>';"
sleep 5
docker exec -i <%= org.cli.address %> bash -c <% -%>
"source scripts/channel_fns.sh; fetchChannelAndJoinTls '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' 'crypto/users/Admin@<%= org.domain %>/tls' 'crypto-orderer/tlsca.<%= channel.ordererHead.domain %>-cert.pem' '<%= channel.ordererHead.fullAddress %>';"
<% } %>
Expand Down Expand Up @@ -107,7 +109,6 @@ installChannels() {
<% } -%>
}
installChaincodes() {
<% if (!chaincodes || !chaincodes.length) { -%>
echo "No chaincodes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@ createChannelAndJoinTls() {

local CORE_PEER_LOCALMSPID=$2
local CORE_PEER_ADDRESS=$3
local CORE_PEER_MSPCONFIGPATH=$(realpath "$4")
local CORE_PEER_TLS_MSPCONFIGPATH=$(realpath "$5")
local TLS_CA_CERT_PATH=$(realpath "$6")
local ORDERER_URL=$7
# local CORE_PEER_MSPCONFIGPATH=$(realpath "$4")
# local CORE_PEER_TLS_MSPCONFIGPATH=$(realpath "$5")
# local TLS_CA_CERT_PATH=$(realpath "$6")
local ORDERER_URL=$5

local CORE_PEER_TLS_CERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.crt
local CORE_PEER_TLS_KEY_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.key
local CORE_PEER_TLS_ROOTCERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/ca.crt
# local CORE_PEER_TLS_CERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.crt
# local CORE_PEER_TLS_KEY_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.key
# local CORE_PEER_TLS_ROOTCERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/ca.crt

local DIR_NAME=step-createChannelAndJoinTls-$CHANNEL_NAME-$CORE_PEER_ADDRESS
local DIR_NAME=step-createChannelAndJoinTls-$CHANNEL_NAME-$CORE_PEER_LOCALMSPID

echo "Creating channel with name (TLS): ${CHANNEL_NAME}"
echo " Orderer: $ORDERER_URL"
echo " CORE_PEER_LOCALMSPID: $CORE_PEER_LOCALMSPID"
echo " CORE_PEER_ADDRESS: $CORE_PEER_ADDRESS"
echo " CORE_PEER_MSPCONFIGPATH: $CORE_PEER_MSPCONFIGPATH"
echo " TLS_CA_CERT_PATH is: $TLS_CA_CERT_PATH"
echo " CORE_PEER_TLS_CERT_FILE: $CORE_PEER_TLS_CERT_FILE"
echo " CORE_PEER_TLS_KEY_FILE: $CORE_PEER_TLS_KEY_FILE"
echo " CORE_PEER_TLS_ROOTCERT_FILE: $CORE_PEER_TLS_ROOTCERT_FILE"
# echo " CORE_PEER_ADDRESS: $CORE_PEER_ADDRESS"
# echo " CORE_PEER_MSPCONFIGPATH: $CORE_PEER_MSPCONFIGPATH"
# echo " TLS_CA_CERT_PATH is: $TLS_CA_CERT_PATH"
# echo " CORE_PEER_TLS_CERT_FILE: $CORE_PEER_TLS_CERT_FILE"
# echo " CORE_PEER_TLS_KEY_FILE: $CORE_PEER_TLS_KEY_FILE"
# echo " CORE_PEER_TLS_ROOTCERT_FILE: $CORE_PEER_TLS_ROOTCERT_FILE"

mkdir "$DIR_NAME" && cd "$DIR_NAME"

Expand Down

0 comments on commit a711deb

Please sign in to comment.