-
Notifications
You must be signed in to change notification settings - Fork 93
Upgrade to version3 #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Sanket-0510
wants to merge
36
commits into
hyperledger-labs:main
from
Sanket-0510:upgrade_to_version3
Closed
Upgrade to version3 #497
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
15f7ec6
version 3 changes initiated
Sanket-0510 5758c56
added the tests
Sanket-0510 a99c65e
added the samples
Sanket-0510 bb1d407
updated some conditions
Sanket-0510 c399ca8
updated the templates, now version 3 is supported
Sanket-0510 16c2f02
Successfully pass the tests
Sanket-0510 7db1c55
updated testCases.md
Sanket-0510 e98306f
done with initial configuration for BFT, updated the templates for th…
Sanket-0510 4b3e785
updated the permission
Sanket-0510 a711deb
version 3 completed heading towards adding BFT support
Sanket-0510 e0aefc2
Use proper createChannelAndJoinTls with certs
dzikowski cdb3203
Enable TLS for admin endpoints
dzikowski d788ef8
Reorder and fix docker compose variable for orderer
dzikowski f2add14
Fix identity which remove NOT_FOUND error while fetching the channel
dzikowski 5c8f780
Remove unnecessary sleep
dzikowski a7315ce
Fix docker compose variables for RAFT
dzikowski 0b3828c
Some polishing and cleanup
dzikowski b57deb6
increased the number of instances for the orderers
Sanket-0510 b46833b
minor changes
Sanket-0510 6cfdd01
Update src/setup-docker/templates/fabric-docker/docker-compose.yaml
Sanket-0510 f953b52
Merge pull request #1 from dzikowski/fix-bft
Sanket-0510 658e041
merged BFT support with version 3
Sanket-0510 e4062c3
updated the snapshots
Sanket-0510 c313bf2
changed the log check message in BFT test file
Sanket-0510 93a3a75
Update src/setup-docker/index.ts
Sanket-0510 dda9873
minor changes
Sanket-0510 a5ac2b3
Update e2e-network/docker/test-05-version3-BFT.sh
Sanket-0510 da49380
Update e2e-network/docker/test-05-version3.sh
Sanket-0510 cbf301f
minor fixes after the review
Sanket-0510 711f7f0
updated the snapshots
Sanket-0510 439c5a7
added the tests in the CI pipeline of fablo
Sanket-0510 8586cc7
updated testCases.md
Sanket-0510 bee292a
fixes in docker-compose
Sanket-0510 d0b6a9f
some linting and other fixes
Sanket-0510 9530918
updated the workflow file
Sanket-0510 16ee7b0
final fixes
Sanket-0510 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,22 @@ | ||
| # Test cases | ||
|
|
||
| | Test case | 01-simple | 02-raft | 03-private | 04-snapshot | | ||
| | ------------------------- |:---------------:|:-----------:|:----------:|:------------------------:| | ||
| | Fabric versions | 2.4.7 | 2.3.2 | 2.4.7 | 2.3.3/2.4.2 | | ||
| | TLS | no | yes | no | yes | | ||
| | Channel capabilities | v2 | v2 | v2_5 | v2 | | ||
| | Consensus | solo | RAFT | solo | RAFT | | ||
| | Orderer nodes | 1 | 3 | 1 | 1 | | ||
| | Organizations | 1 | 2 | 2 | 1 | | ||
| | CA database | SQLite | SQLite | SQLite | Postgres | | ||
| | Peer database | LevelDB | LevelDB | LevelDB | CouchDB | | ||
| | Peer count | 2 | 2, 2 | 2, 1 | 2 | | ||
| | Channels | 1 | 2 | 1 | 1 | | ||
| | Node chaincode | yes | yes | yes | yes | | ||
| | Node chaincode upgrade | no | yes | no | no | | ||
| | Node chaincode endorsement| OR | OR | OR, AND | default | | ||
| | Private data | no | no | yes | yes | | ||
| | Java chaincode | no | yes | no | no | | ||
| | Go chaincode | no | no | no | no | | ||
| | Tools | channel scripts | Fablo REST | - | Fablo REST, Explorer | | ||
| | Other Fablo commands | init, reset | stop, start | - | snapshot, prune, restore | | ||
| | Test case | 01-simple | 02-raft | 03-private | 04-snapshot | test-05-version3 | | ||
| | ------------------------- |:---------------:|:-----------:|:----------:|:------------------------:|:------------------:| | ||
| | Fabric versions | 2.4.7 | 2.3.2 | 2.4.7 | 2.3.3/2.4.2 | 3.0.0-beta | | ||
| | TLS | no | yes | no | yes | yes | | ||
| | Channel capabilities | v2 | v2 | v2_5 | v2 | v3_0 | | ||
| | Consensus | solo | RAFT | solo | RAFT | RAFT | | ||
| | Orderer nodes | 1 | 3 | 1 | 1 | 1 | | ||
| | Organizations | 1 | 2 | 2 | 1 | 1 | | ||
| | CA database | SQLite | SQLite | SQLite | Postgres | Postgres | | ||
| | Peer database | LevelDB | LevelDB | LevelDB | CouchDB | CouchDB | | ||
| | Peer count | 2 | 2, 2 | 2, 1 | 2 | 2 | | ||
| | Channels | 1 | 2 | 1 | 1 | 1 | | ||
| | Node chaincode | yes | yes | yes | yes | yes | | ||
| | Node chaincode upgrade | no | yes | no | no | no | | ||
| | Node chaincode endorsement| OR | OR | OR, AND | default | OR | | ||
| | Private data | no | no | yes | yes | no | | ||
| | Java chaincode | no | yes | no | no | no | | ||
| | Go chaincode | no | no | no | no | no | | ||
| | Tools | channel scripts | Fablo REST | - | Fablo REST, Explorer | channel scripts | | ||
| | Other Fablo commands | init, reset | stop, start | - | snapshot, prune, restore | init, reset | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eux | ||
|
|
||
| TEST_TMP="$(rm -rf "$0.tmpdir" && mkdir -p "$0.tmpdir" && (cd "$0.tmpdir" && pwd))" | ||
| TEST_LOGS="$(mkdir -p "$0.logs" && (cd "$0.logs" && pwd))" | ||
| FABLO_HOME="$TEST_TMP/../../.." | ||
|
|
||
| export FABLO_HOME | ||
|
|
||
| CONFIG="$FABLO_HOME/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json" | ||
|
|
||
| networkUp() { | ||
| "$FABLO_HOME/fablo-build.sh" | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" generate "$CONFIG") | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" up) | ||
| } | ||
|
|
||
| dumpLogs() { | ||
| echo "Saving logs of $1 to $TEST_LOGS/$1.log" | ||
| mkdir -p "$TEST_LOGS" | ||
| docker logs "$1" >"$TEST_LOGS/$1.log" 2>&1 | ||
| } | ||
|
|
||
| networkDown() { | ||
| rm -rf "$TEST_LOGS" | ||
| (for name in $(docker ps --format '{{.Names}}'); do dumpLogs "$name"; done) | ||
| dumpLogs orderer0.group1.orderer.example.com | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" down) | ||
| } | ||
|
|
||
| waitForContainer() { | ||
| sh "$TEST_TMP/../wait-for-container.sh" "$1" "$2" | ||
| } | ||
|
|
||
| waitForChaincode() { | ||
| (cd "$TEST_TMP" && sh ../wait-for-chaincode.sh "$1" "$2" "$3" "$4") | ||
| } | ||
|
|
||
| expectInvoke() { | ||
| (cd "$TEST_TMP" && sh ../expect-invoke-cli.sh "$1" "$2" "$3" "$4" "$5" "") | ||
| } | ||
|
|
||
| expectCommand() { | ||
| sh "$TEST_TMP/../expect-command.sh" "$1" "$2" | ||
| } | ||
|
|
||
| trap networkDown EXIT | ||
| trap 'networkDown ; echo "Test failed" ; exit 1' ERR SIGINT | ||
|
|
||
| # start the network | ||
| networkUp | ||
|
|
||
| waitForContainer "orderer0.group1.orderer.example.com" "Channel created" | ||
| waitForContainer "orderer1.group1.orderer.example.com" "Channel created" | ||
| waitForContainer "orderer2.group1.orderer.example.com" "Channel created" | ||
| waitForContainer "orderer3.group1.orderer.example.com" "Channel created" | ||
| waitForContainer "ca.org1.example.com" "Listening on https://0.0.0.0:7054" | ||
| waitForContainer "peer0.org1.example.com" "Joining gossip network of channel my-channel1 with 1 organizations" | ||
| waitForContainer "peer1.org1.example.com" "Joining gossip network of channel my-channel1 with 1 organizations" | ||
| waitForContainer "peer0.org1.example.com" "Learning about the configured anchor peers of Org1MSP for channel my-channel1" | ||
| waitForContainer "peer0.org1.example.com" "Anchor peer.*with same endpoint, skipping connecting to myself" | ||
| waitForContainer "peer0.org1.example.com" "Membership view has changed. peers went online:.*peer1.org1.example.com:7042" | ||
| waitForContainer "peer1.org1.example.com" "Learning about the configured anchor peers of Org1MSP for channel my-channel1" | ||
| waitForContainer "peer1.org1.example.com" "Membership view has changed. peers went online:.*peer0.org1.example.com:7041" | ||
|
|
||
| # Test simple chaincode | ||
| expectInvoke "peer0.org1.example.com" "my-channel1" "chaincode1" \ | ||
| '{"Args":["KVContract:put", "name", "Willy Wonka"]}' \ | ||
| '{\"success\":\"OK\"}' | ||
| expectInvoke "peer1.org1.example.com" "my-channel1" "chaincode1" \ | ||
| '{"Args":["KVContract:get", "name"]}' \ | ||
| '{\"success\":\"Willy Wonka\"}' | ||
|
|
||
| # Verify channel query scripts | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch newest my-channel1 org1 peer1) | ||
| expectCommand "cat \"$TEST_TMP/newest.block\"" "KVContract:get" | ||
|
|
||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch 3 my-channel1 org1 peer1 "another.block") | ||
| expectCommand "cat \"$TEST_TMP/another.block\"" "KVContract:put" | ||
|
|
||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch config my-channel1 org1 peer1 "channel-config.json") | ||
| expectCommand "cat \"$TEST_TMP/channel-config.json\"" "\"mod_policy\": \"Admins\"," | ||
|
|
||
| expectCommand "(cd \"$TEST_TMP\" && \"$FABLO_HOME/fablo.sh\" channel getinfo my-channel1 org1 peer1)" "\"height\":5" | ||
|
|
||
| echo "🎉 Test passed! 🎉" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eux | ||
Sanket-0510 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| TEST_TMP="$(rm -rf "$0.tmpdir" && mkdir -p "$0.tmpdir" && (cd "$0.tmpdir" && pwd))" | ||
| TEST_LOGS="$(mkdir -p "$0.logs" && (cd "$0.logs" && pwd))" | ||
| FABLO_HOME="$TEST_TMP/../../.." | ||
|
|
||
| export FABLO_HOME | ||
|
|
||
| CONFIG="$FABLO_HOME/samples/fablo-config-hlf3-1orgs-1chaincode.json" | ||
|
|
||
| networkUp() { | ||
| "$FABLO_HOME/fablo-build.sh" | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" generate "$CONFIG") | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" up) | ||
| } | ||
|
|
||
| dumpLogs() { | ||
| echo "Saving logs of $1 to $TEST_LOGS/$1.log" | ||
| mkdir -p "$TEST_LOGS" | ||
| docker logs "$1" >"$TEST_LOGS/$1.log" 2>&1 | ||
| } | ||
|
|
||
| networkDown() { | ||
| rm -rf "$TEST_LOGS" | ||
| (for name in $(docker ps --format '{{.Names}}'); do dumpLogs "$name"; done) | ||
| dumpLogs orderer0.group1.orderer.example.com | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" down) | ||
| } | ||
|
|
||
| waitForContainer() { | ||
| sh "$TEST_TMP/../wait-for-container.sh" "$1" "$2" | ||
| } | ||
|
|
||
| waitForChaincode() { | ||
| (cd "$TEST_TMP" && sh ../wait-for-chaincode.sh "$1" "$2" "$3" "$4") | ||
| } | ||
|
|
||
| expectInvoke() { | ||
| (cd "$TEST_TMP" && sh ../expect-invoke-cli.sh "$1" "$2" "$3" "$4" "$5" "") | ||
| } | ||
|
|
||
| expectCommand() { | ||
| sh "$TEST_TMP/../expect-command.sh" "$1" "$2" | ||
| } | ||
|
|
||
| trap networkDown EXIT | ||
| trap 'networkDown ; echo "Test failed" ; exit 1' ERR SIGINT | ||
|
|
||
| # start the network | ||
| networkUp | ||
|
|
||
| waitForContainer "orderer0.group1.orderer.example.com" "Starting raft node as part of a new channel channel=my-channel1" | ||
| waitForContainer "ca.org1.example.com" "Listening on https://0.0.0.0:7054" | ||
| waitForContainer "peer0.org1.example.com" "Joining gossip network of channel my-channel1 with 1 organizations" | ||
| waitForContainer "peer1.org1.example.com" "Joining gossip network of channel my-channel1 with 1 organizations" | ||
| waitForContainer "peer0.org1.example.com" "Learning about the configured anchor peers of Org1MSP for channel my-channel1" | ||
| waitForContainer "peer0.org1.example.com" "Anchor peer.*with same endpoint, skipping connecting to myself" | ||
| waitForContainer "peer0.org1.example.com" "Membership view has changed. peers went online:.*peer1.org1.example.com:7042" | ||
| waitForContainer "peer1.org1.example.com" "Learning about the configured anchor peers of Org1MSP for channel my-channel1" | ||
| waitForContainer "peer1.org1.example.com" "Membership view has changed. peers went online:.*peer0.org1.example.com:7041" | ||
|
|
||
| # Test simple chaincode | ||
| expectInvoke "peer0.org1.example.com" "my-channel1" "chaincode1" \ | ||
| '{"Args":["KVContract:put", "name", "Willy Wonka"]}' \ | ||
| '{\"success\":\"OK\"}' | ||
| expectInvoke "peer1.org1.example.com" "my-channel1" "chaincode1" \ | ||
| '{"Args":["KVContract:get", "name"]}' \ | ||
| '{\"success\":\"Willy Wonka\"}' | ||
|
|
||
| # Verify channel query scripts | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch newest my-channel1 org1 peer1) | ||
| expectCommand "cat \"$TEST_TMP/newest.block\"" "KVContract:get" | ||
|
|
||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch 3 my-channel1 org1 peer1 "another.block") | ||
| expectCommand "cat \"$TEST_TMP/another.block\"" "KVContract:put" | ||
|
|
||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch config my-channel1 org1 peer1 "channel-config.json") | ||
| expectCommand "cat \"$TEST_TMP/channel-config.json\"" "\"mod_policy\": \"Admins\"," | ||
|
|
||
| expectCommand "(cd \"$TEST_TMP\" && \"$FABLO_HOME/fablo.sh\" channel getinfo my-channel1 org1 peer1)" "\"height\":5" | ||
|
|
||
| echo "🎉 Test passed! 🎉" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.