-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(connector-fabric-socketio): migrate to fabric-all-in-one fro…
…m fabric14-fabcar-testnet Remove obsolete fabric fabric14-fabcar-testnet fabric14-testnet, use only fabric-all-in-one for all purposes for all test / sample app purposes. Add helper scripts from fabric-sample that are used during cartrade setup phase (I've decided it's better to keep them in repo than increasing the size of fabric-all-in-one image). Upgrade of fabcar network (from 1.4.1 to 1.4.8) triggered multiple changes in fabric-socketio validator, since fabcar nodes (peers, orderer) use TLS and require different setup, additionaly done some refactors and fixes in the validator. Update the cartrade and discounted-cartrade sample apps to work with the new setup, refreshed scripts can be used to ease up the setup process. Closes: #1753 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Loading branch information
Showing
124 changed files
with
773 additions
and
2,369 deletions.
There are no files selected for viewing
This file contains 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,10 @@ | ||
|
||
# Fabric TLSCA local dir | ||
crypto-config/ | ||
|
||
# BLP artifacts | ||
TransactionInfo.json | ||
wallet/ | ||
|
||
# don't commit package-lock | ||
package-lock.json |
This file contains 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 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 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 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 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,23 +1,22 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020-2021 Hyperledger Cactus Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cd ../.. | ||
|
||
## Build validator for Fabric | ||
cd ./packages/cactus-plugin-ledger-connector-fabric-socketio | ||
./script-build-validator.sh | ||
cp -a ../../examples/cartrade/build/wallet ./dist/connector | ||
cd ../.. | ||
|
||
## build validator for Ethereum | ||
cd ./packages/cactus-plugin-ledger-connector-go-ethereum-socketio | ||
./script-build-validator.sh | ||
cd ../.. | ||
|
||
## build packages | ||
cd ./packages/cactus-plugin-ledger-connector-fabric-socketio | ||
./script-build-packages.sh | ||
cd ../.. | ||
|
||
## build cartrade apps | ||
cd ./examples/cartrade | ||
./script-build-cartrade.sh | ||
./script-build-cartrade.sh | ||
|
||
## build getter apps | ||
./script-build-get-app.sh |
This file contains 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,6 +1,11 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020-2021 Hyperledger Cactus Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
## Build a cartrade app | ||
echo "[process] Build a cartrade app" | ||
rm -fr ./crypto-config | ||
rm -fr ./wallet | ||
rm -fr ../../dist/node_modules | ||
npm install | ||
npm run build | ||
npm run build |
This file contains 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,9 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020-2021 Hyperledger Cactus Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
## Build a getting app | ||
|
||
## Build ethereum app | ||
echo "[process] Build an app for getting Balance on Ethereum" | ||
cd script-test-getFunctions/go-ethereum | ||
pushd script-test-getFunctions/go-ethereum | ||
npm install | ||
popd | ||
|
||
## Build fabric app | ||
echo "[process] Build an app for getting ownership on Fabcar" | ||
cd ../fabric | ||
npm install | ||
pushd ../../tools/docker/fabric-all-in-one/fabcar-cli-1.4 | ||
npm install | ||
popd |
This file contains 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,9 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020-2021 Hyperledger Cactus Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
## Execute a getting app | ||
echo "[process] Execute an app for getting Balance on Ethereum" | ||
cd script-test-getFunctions/go-ethereum | ||
pushd script-test-getFunctions/go-ethereum | ||
node getBalance.js | ||
popd | ||
|
||
echo "[process] Execute an app for getting ownership on Fabcar" | ||
cd ../fabric | ||
node queryCar.js CAR1 | ||
pushd ../../tools/docker/fabric-all-in-one/fabcar-cli-1.4 | ||
./setup.sh >/dev/null | ||
node query.js | ||
popd |
This file contains 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,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020-2021 Hyperledger Cactus Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
curl localhost:5034/api/v1/bl/trades/ -XPOST -H "Content-Type: application/json" -d '{"businessLogicID":"guks32pf","tradeParams":["0x06fc56347d91c6ad2dae0c3ba38eb12ab0d72e97", "0x9d624f7995e8bd70251f8265f2f9f2b49f169c55", "Brad", "Cathy", 50, "CAR1"],"authParams":["none"]}' | ||
|
||
curl localhost:5034/api/v1/bl/trades/ -XPOST -H "Content-Type: application/json" -d '{"businessLogicID":"guks32pf","tradeParams":["0x06fc56347d91c6ad2dae0c3ba38eb12ab0d72e97", "0x9d624f7995e8bd70251f8265f2f9f2b49f169c55", "Brad", "Cathy", 50, "CAR1"],"authParams":["none"]}' |
This file was deleted.
Oops, something went wrong.
This file contains 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,12 +1,36 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020-2021 Hyperledger Cactus Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
cd ../.. | ||
|
||
## Start docker environment for Go-Ethereum testnet | ||
cd ./tools/docker/geth-testnet | ||
# Exit on error | ||
set -e | ||
|
||
FABRIC_CONTAINER_NAME=fabcar14_sample_setup | ||
|
||
pushd ../.. | ||
|
||
## Run Go-Ethereum Ledger | ||
pushd ./tools/docker/geth-testnet | ||
./script-start-docker.sh | ||
cd ../../.. | ||
popd | ||
|
||
## RunFabric Ledger | ||
pushd ./tools/docker/fabric-all-in-one | ||
./script-run-docker-1.4.sh | ||
popd | ||
|
||
popd | ||
|
||
# Copy TLSCAs to connect peer and orderer | ||
mkdir -p ./crypto-config/ | ||
rm -fr ./crypto-config/* | ||
docker cp ${FABRIC_CONTAINER_NAME}:/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem ./crypto-config/ | ||
docker cp ${FABRIC_CONTAINER_NAME}:/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem ./crypto-config/ | ||
|
||
# Enroll users and copy wallet | ||
pushd ../../tools/docker/fabric-all-in-one/fabcar-cli-1.4 | ||
./setup.sh | ||
popd | ||
cp -ar ../../tools/docker/fabric-all-in-one/fabcar-cli-1.4/wallet . | ||
|
||
## Start docker environment for Fabric testnet | ||
cd ./tools/docker/fabric14-fabcar-testnet | ||
./script-start-docker.sh | ||
echo "All Done." |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
examples/cartrade/script-test-getFunctions/fabric/config/connection.json
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
examples/cartrade/script-test-getFunctions/fabric/package.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.