Skip to content

Commit a711deb

Browse files
committed
version 3 completed heading towards adding BFT support
Signed-off-by: Sanket <[email protected]>
1 parent 4b3e785 commit a711deb

File tree

5 files changed

+38
-24
lines changed

5 files changed

+38
-24
lines changed

e2e-network/docker/test-05-version3-BFT.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FABLO_HOME="$TEST_TMP/../../.."
88

99
export FABLO_HOME
1010

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

1313
networkUp() {
1414
"$FABLO_HOME/fablo-build.sh"

samples/fablo-config-hlf3-1orgs-1chaincode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"orderers": [
1717
{
1818
"groupName": "group1",
19-
"type": "BFT",
19+
"type": "raft",
2020
"instances": 4
2121
}
2222
]

src/setup-docker/templates/fabric-config/configtx-raft-template.yaml.ejs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,20 @@
88
<% })} -%>
99

1010
<% if (ordererGroup.consensus == "BFT") { %>
11-
smartBFT:
11+
SmartBFT:
12+
RequestBatchMaxCount: 100
13+
RequestBatchMaxInterval: 50ms
14+
RequestForwardTimeout: 2s
15+
RequestComplainTimeout: 20s
16+
RequestAutoRemoveTimeout: 3m0s
17+
ViewChangeResendInterval: 5s
18+
ViewChangeTimeout: 20s
19+
LeaderHeartbeatTimeout: 1m0s
20+
CollectTimeout: 1s
21+
RequestBatchMaxBytes: 10485760
22+
IncomingMessageBufferSize: 200
23+
RequestPoolSize: 100000
24+
LeaderHeartbeatCount: 10
1225
ConsenterMapping:<% ordererGroup.orderers.forEach(function(orderer, index) { %>
1326
- ID: <%= index+1 %>
1427
Host: <%= orderer.address %>

src/setup-docker/templates/fabric-docker/commands-generated.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,26 @@ generateChannelsArtifacts() {
4444
}
4545
4646
installChannels() {
47+
set -x
4748
<% if (!channels || !channels.length) { -%>
49+
4850
echo "No channels"
4951
<% } else if (global.capabilities.isV3) { -%>
5052
<% channels.forEach((channel) => { -%>
53+
<% channel.ordererGroup.orderers.forEach((orderer) => { -%>
54+
<% const org = orgs.find((org) => org.name === orderer.orgName); -%>
55+
docker exec -i <%= org.cli.address %> bash -c <% -%>
56+
"source scripts/channel_fns.sh; createChannelAndJoinTls '<%= channel.name %>' '<%= orderer.orgMspName %>' 'example.com' 'crypto/users/Admin@test/msp' '<%= orderer.address %>:<%= orderer.adminPort %>';"
57+
<% }) -%>
58+
sleep 8
5159
<% channel.orgs.forEach((org, orgNo) => { -%>
5260
<% org.peers.forEach((peer, peerNo) => { -%>
5361
<% if (orgNo == 0 && peerNo == 0) { -%>
5462
printHeadline "Creating '<%= channel.name %>' on <%= org.name %>/<%= peer.name %>" "U1F63B"
5563
<% if (!global.tls) { -%>
56-
docker exec -i <%= org.cli.address %> bash -c <% -%>
57-
"source scripts/channel_fns.sh; createChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.address %>:<%= channel.ordererHead.adminPort %>';"
58-
sleep 5
5964
docker exec -i <%= org.cli.address %> bash -c <% -%>
6065
"source scripts/channel_fns.sh; fetchChannelAndJoin '<%= channel.name %>' '<%= org.mspName %>' '<%= peer.fullAddress %>' 'crypto/users/Admin@<%= org.domain %>/msp' '<%= channel.ordererHead.fullAddress %>';"
6166
<% } else { -%>
62-
docker exec -i <%= org.cli.address %> bash -c <% -%>
63-
"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 %>';"
64-
sleep 5
6567
docker exec -i <%= org.cli.address %> bash -c <% -%>
6668
"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 %>';"
6769
<% } %>
@@ -107,7 +109,6 @@ installChannels() {
107109
<% } -%>
108110
}
109111
110-
111112
installChaincodes() {
112113
<% if (!chaincodes || !chaincodes.length) { -%>
113114
echo "No chaincodes"

src/setup-docker/templates/fabric-docker/scripts/cli/channel_fns-v3.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ createChannelAndJoinTls() {
3333

3434
local CORE_PEER_LOCALMSPID=$2
3535
local CORE_PEER_ADDRESS=$3
36-
local CORE_PEER_MSPCONFIGPATH=$(realpath "$4")
37-
local CORE_PEER_TLS_MSPCONFIGPATH=$(realpath "$5")
38-
local TLS_CA_CERT_PATH=$(realpath "$6")
39-
local ORDERER_URL=$7
36+
# local CORE_PEER_MSPCONFIGPATH=$(realpath "$4")
37+
# local CORE_PEER_TLS_MSPCONFIGPATH=$(realpath "$5")
38+
# local TLS_CA_CERT_PATH=$(realpath "$6")
39+
local ORDERER_URL=$5
4040

41-
local CORE_PEER_TLS_CERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.crt
42-
local CORE_PEER_TLS_KEY_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.key
43-
local CORE_PEER_TLS_ROOTCERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/ca.crt
41+
# local CORE_PEER_TLS_CERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.crt
42+
# local CORE_PEER_TLS_KEY_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/client.key
43+
# local CORE_PEER_TLS_ROOTCERT_FILE=$CORE_PEER_TLS_MSPCONFIGPATH/ca.crt
4444

45-
local DIR_NAME=step-createChannelAndJoinTls-$CHANNEL_NAME-$CORE_PEER_ADDRESS
45+
local DIR_NAME=step-createChannelAndJoinTls-$CHANNEL_NAME-$CORE_PEER_LOCALMSPID
4646

4747
echo "Creating channel with name (TLS): ${CHANNEL_NAME}"
4848
echo " Orderer: $ORDERER_URL"
4949
echo " CORE_PEER_LOCALMSPID: $CORE_PEER_LOCALMSPID"
50-
echo " CORE_PEER_ADDRESS: $CORE_PEER_ADDRESS"
51-
echo " CORE_PEER_MSPCONFIGPATH: $CORE_PEER_MSPCONFIGPATH"
52-
echo " TLS_CA_CERT_PATH is: $TLS_CA_CERT_PATH"
53-
echo " CORE_PEER_TLS_CERT_FILE: $CORE_PEER_TLS_CERT_FILE"
54-
echo " CORE_PEER_TLS_KEY_FILE: $CORE_PEER_TLS_KEY_FILE"
55-
echo " CORE_PEER_TLS_ROOTCERT_FILE: $CORE_PEER_TLS_ROOTCERT_FILE"
50+
# echo " CORE_PEER_ADDRESS: $CORE_PEER_ADDRESS"
51+
# echo " CORE_PEER_MSPCONFIGPATH: $CORE_PEER_MSPCONFIGPATH"
52+
# echo " TLS_CA_CERT_PATH is: $TLS_CA_CERT_PATH"
53+
# echo " CORE_PEER_TLS_CERT_FILE: $CORE_PEER_TLS_CERT_FILE"
54+
# echo " CORE_PEER_TLS_KEY_FILE: $CORE_PEER_TLS_KEY_FILE"
55+
# echo " CORE_PEER_TLS_ROOTCERT_FILE: $CORE_PEER_TLS_ROOTCERT_FILE"
5656

5757
mkdir "$DIR_NAME" && cd "$DIR_NAME"
5858

0 commit comments

Comments
 (0)