Skip to content

Commit 76a4c8c

Browse files
authored
Fix: Restart Explorer once channels are created (#615)
1 parent f55628b commit 76a4c8c

8 files changed

+22
-1
lines changed

e2e-network/docker/test-02-v2-raft-2orgs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ waitForContainer "peer1.org1.example.com" "Membership view has changed. peers we
8383
waitForContainer "db.explorer.example.com" "database system is ready to accept connections" "200"
8484
# // the next check is not working because explorer needs needs to be restarted first
8585
# // see the issue: https://github.com/hyperledger-labs/fablo/issues/604
86-
# waitForContainer "explorer.example.com" "Successfully created channel event hub for \[my-channel1\]" "200"
86+
waitForContainer "explorer.example.com" "Successfully created channel event hub for \[my-channel1\]" "200"
8787

8888
# check if org2 is ready
8989
waitForContainer "ca.org2.example.com" "Listening on https://0.0.0.0:7054"

e2e/__snapshots__/fablo-config-hlf2-1org-1chaincode.json.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,7 @@ installChannels() {
17341734
17351735
printItalics "Joining 'my-channel1' on Org1/peer1" "U1F638"
17361736
docker exec -i cli.org1.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoin 'my-channel1' 'Org1MSP' 'peer1.org1.example.com:7042' 'crypto/users/[email protected]/msp' 'orderer0.group1.orderer.example.com:7030';"
1737+
17371738
}
17381739
17391740
installChaincodes() {

e2e/__snapshots__/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,6 +2471,7 @@ installChannels() {
24712471
docker exec -i cli.org1.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoin 'my-channel1' 'Org1MSP' 'peer1.org1.example.com:7042' 'crypto/users/[email protected]/msp' 'orderer0.group1.orderer.example.com:7030';"
24722472
printItalics "Joining 'my-channel1' on Org2/peer0" "U1F638"
24732473
docker exec -i cli.org2.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoin 'my-channel1' 'Org2MSP' 'peer0.org2.example.com:7061' 'crypto/users/[email protected]/msp' 'orderer0.group1.orderer.example.com:7030';"
2474+
24742475
}
24752476
24762477
installChaincodes() {

e2e/__snapshots__/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4038,6 +4038,9 @@ installChannels() {
40384038
docker exec -i cli.org2.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoinTls 'my-channel3' 'Org2MSP' 'peer0.org2.example.com:7081' 'crypto/users/[email protected]/msp' 'crypto/users/[email protected]/tls' 'crypto-orderer/tlsca.orderer2.com-cert.pem' 'orderer0.group2.orderer2.com:7050';"
40394039
printItalics "Joining 'my-channel3' on Org2/peer1" "U1F638"
40404040
docker exec -i cli.org2.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoinTls 'my-channel3' 'Org2MSP' 'peer1.org2.example.com:7082' 'crypto/users/[email protected]/msp' 'crypto/users/[email protected]/tls' 'crypto-orderer/tlsca.orderer2.com-cert.pem' 'orderer0.group2.orderer2.com:7050';"
4041+
4042+
echo "Restarting global Explorer: explorer.example.com"
4043+
docker restart explorer.example.com || true
40414044
}
40424045
40434046
installChaincodes() {

e2e/__snapshots__/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,6 +4474,9 @@ installChannels() {
44744474
docker exec -i cli.org2.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoinTls 'my-channel3' 'Org2MSP' 'peer0.org2.example.com:7061' 'crypto/users/[email protected]/msp' 'crypto/users/[email protected]/tls' 'crypto-orderer/tlsca.orderer.example.com-cert.pem' 'orderer0.group1.orderer.example.com:7030';"
44754475
printItalics "Joining 'my-channel3' on Org2/peer1" "U1F638"
44764476
docker exec -i cli.org2.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoinTls 'my-channel3' 'Org2MSP' 'peer1.org2.example.com:7062' 'crypto/users/[email protected]/msp' 'crypto/users/[email protected]/tls' 'crypto-orderer/tlsca.orderer.example.com-cert.pem' 'orderer0.group1.orderer.example.com:7030';"
4477+
4478+
echo "Restarting global Explorer: explorer.example.com"
4479+
docker restart explorer.example.com || true
44774480
}
44784481
44794482
installChaincodes() {

e2e/__snapshots__/fablo-config-hlf3-1orgs-1chaincode.json.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,7 @@ installChannels() {
19471947
19481948
printItalics "Joining 'my-channel1' on Org1/peer1" "U1F638"
19491949
docker exec -i cli.org1.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoinTls 'my-channel1' 'Org1MSP' 'peer1.org1.example.com:7042' 'crypto/users/[email protected]/msp' 'crypto/users/[email protected]/tls' 'crypto-orderer/tlsca.orderer.example.com-cert.pem' 'orderer0.group1.orderer.example.com:7030';"
1950+
19501951
}
19511952
19521953
installChaincodes() {

e2e/__snapshots__/fablo-config-hlf3-bft-1orgs-1chaincode.json.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,7 @@ installChannels() {
19711971
19721972
printItalics "Joining 'my-channel1' on Org1/peer1" "U1F638"
19731973
docker exec -i cli.org1.example.com bash -c "source scripts/channel_fns.sh; fetchChannelAndJoinTls 'my-channel1' 'Org1MSP' 'peer1.org1.example.com:7042' 'crypto/users/[email protected]/msp' 'crypto/users/[email protected]/tls' 'crypto-orderer/tlsca.orderer.example.com-cert.pem' 'orderer0.group1.orderer.example.com:7030';"
1974+
19741975
}
19751976
19761977
installChaincodes() {

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ installChannels() {
106106
<% }) -%>
107107
<% }) -%>
108108
<% } -%>
109+
110+
<% if (global.tools.explorer) { -%>
111+
echo "Restarting global Explorer: <%= global.tools.explorer.address %>"
112+
docker restart <%= global.tools.explorer.address %> || true
113+
<% } -%>
114+
<% orgs.forEach((org) => { -%>
115+
<% if (org.tools.explorer && !global.tools.explorer) { -%>
116+
echo "Restarting org Explorer: <%= org.tools.explorer.address %>"
117+
docker restart <%= org.tools.explorer.address %> || true
118+
<% } -%>
119+
<% }) -%>
109120
}
110121
111122
installChaincodes() {

0 commit comments

Comments
 (0)