Skip to content
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

feat(weaver): upgrade to corda 4.12 and jvm 17 #3479

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/test_weaver-asset-exchange-corda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

# CORDA NETWORK
Expand Down Expand Up @@ -144,10 +144,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Build Java Protos
Expand Down Expand Up @@ -248,10 +248,10 @@ jobs:
- './weaver/**'
- '.github/workflows/test_weaver-asset-exchange-corda.yaml'

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

# CORDA NETWORK
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/test_weaver-asset-transfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -85,9 +85,7 @@ jobs:
working-directory: weaver/tests/network-setups/corda

- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start &> corda-net.out &
run: make start &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -695,10 +693,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -789,9 +787,7 @@ jobs:

# CORDA NETWORK
- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start-local &> corda-net.out &
run: make start-local &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_weaver-corda-interop-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Build Protos (Local)
Expand Down
64 changes: 36 additions & 28 deletions .github/workflows/test_weaver-data-sharing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -85,9 +85,7 @@ jobs:
working-directory: weaver/tests/network-setups/corda

- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start &> corda-net.out &
run: make start &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -244,11 +242,11 @@ jobs:
# CORDA2-CORDA

NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

# CORDA - FABRIC1
Expand Down Expand Up @@ -340,11 +338,11 @@ jobs:
cp chaincode.json.template chaincode.json
sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json
./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true &> tmp.out
tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out
tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out


Expand Down Expand Up @@ -409,7 +407,17 @@ jobs:
data-sharing-docker-local:
needs: check_code_changed
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true'
# if: ${{ false }}
env:
FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false
CONFIGURE_DISABLED: true
TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true
CUSTOM_CHECKS_DISABLED: true
JEST_TEST_RUNNER_DISABLED: true
TAPE_TEST_RUNNER_DISABLED: true
DUMP_DISK_USAGE_INFO_DISABLED: true
FULL_BUILD_DISABLED: true
CHECK_WORK_TREE_STATUS_DISABLED: true

# The type of runner that the job will run on
runs-on: ubuntu-22.04

Expand All @@ -426,10 +434,10 @@ jobs:
- './weaver/**'
- '.github/workflows/test_weaver-data-sharing.yaml'

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand All @@ -446,9 +454,13 @@ jobs:
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
rm -rf protoc-3.15.6-linux-x86_64.zip
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

- name: CI script for cleanup
run: ./tools/ci.sh

# PROTOS
- name: Build GO Protos
run: |
Expand Down Expand Up @@ -505,9 +517,7 @@ jobs:
working-directory: weaver/core/identity-management/iin-agent

- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start-local &> corda-net.out &
run: make start-local &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -669,11 +679,11 @@ jobs:
# CORDA2-CORDA

NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

# CORDA - FABRIC1
Expand Down Expand Up @@ -765,11 +775,11 @@ jobs:
cp chaincode.json.template chaincode.json
sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json
./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true &> tmp.out
tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out
tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out


Expand Down Expand Up @@ -851,10 +861,10 @@ jobs:
- './weaver/**'
- '.github/workflows/test_weaver-data-sharing.yaml'

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -945,9 +955,7 @@ jobs:

# CORDA NETWORK
- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start-local &> corda-net.out &
run: make start-local &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -1097,11 +1105,11 @@ jobs:
# CORDA2-CORDA

NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

# CORDA - FABRIC1
Expand Down Expand Up @@ -1193,11 +1201,11 @@ jobs:
cp chaincode.json.template chaincode.json
sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json
./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true --debug=true &> tmp.out
tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out

./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out
tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out


Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_weaver-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Build Protos (Local)
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test_weaver-fabric-fabric-satp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
uses: actions/[email protected]
with:
java-version: '8'
distribution: 'adopt'

- name: Set up Go
uses: actions/[email protected]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/weaver_deploy_corda-pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Generate github.properties
Expand Down Expand Up @@ -60,10 +60,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Generate github.properties
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Generate github.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ Before starting, make sure you have the following software installed on your hos
- Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version)
- Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher)
- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher)
- Golang: [sample instructions](https://golang.org/dl/) (Version 1.20 or higher)
- Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8)
- Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported)
- Yarn: [sample instructions](https://classic.yarnpkg.com/en/docs/install/)
- Protoc (Protobuf compiler): _Golang should already be installed and configured._
* Default method: Run the following with `sudo` if necessary. This will install both the protobuf compiler and the Go code generator plugins.
```
apt-get install protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0
```
* If the above method installs an older version of `protoc` (check using `protoc --version`), say below 3.12.x, you should download pre-compiled binaries instead. (With an older version, you may see errors while attempting to launch and setup the Fabric networks).
```
Expand All @@ -46,13 +46,14 @@ Before starting, make sure you have the following software installed on your hos
sudo apt-get install unzip
unzip protoc-3.15.6-linux-x86_64.zip -d <some-folder-path>
export PATH="$PATH:<some-folder-path>/bin"
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0
```
| Notes |
|:------|
| The latest version at present is `3.15.6`, but you should check the above link to find the most current version before running the above steps. |
| The latest version of `protoc-gen-go-grpc` that works with the Fabric test networks we will run below is `v1.4.0`, which is why that version is hardcoded here. |
### Credentials
Make sure you have an SSH or GPG key registered in https://github.com to allow seamless cloning of repositories (at present, various setup scripts clone repositories using the `https://` prefix but this may change to `git@` in the future).
Expand Down Expand Up @@ -172,7 +173,7 @@ For more information, refer to the associated [README](https://github.com/hyperl
**Troubleshooting Tips**:

- If you see any errors during the launches, re-check the prerequisites (software installations and credentials). Ensure your network connection is working. As a safe bet, you can retry after cleanup: kill and remove all Docker containers and associated volumes.
- If `protoc` or `protoc-gen-go` throws an error, reinstall `protoc` and `protoc-gen-go` using suggestions made in the Prerequisites section above.
- If `protoc` or `protoc-gen-go` throws an error, reinstall `protoc`, `protoc-gen-go`, and `protoc-gen-go-grpc` using suggestions made in the Prerequisites section above.

### Fabric Relay

Expand Down
Loading
Loading