-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(copm): add Corda COPM implementation
Primary change: Implements COPM primitives for Corda as a cacti plugin. The implementation follows the model of the Corda ledger connector plugin, where a typescript pass-through implementation is registered on the plugin server, and commands are implemented on a separate grpc server in the Kotlin Spring framework. Secondary changes: - The lock claim protobuf structure was updated to reduce the number of parameters. - A no-op endpoint was added, per project specification - The format of the inter-network command for requesting the status of a pledge varies by remote network type and asset. Adds a function to the typescript interop configuration interface to supply the appropriate command given the remote network and asset. - Adds test package to test combinations of network types - Updates CI script to use new testing framework - Updates linter ignore to include weaver build directories, allowing yarn lint to pass on a system where weaver libraries have been built. Also excludes docs directory to avoid linting minified js from documentation packages. Signed-off-by: Jennifer Bell <[email protected]>
- Loading branch information
Jennifer Bell
committed
Nov 22, 2024
1 parent
5e3d9d7
commit 45bafef
Showing
135 changed files
with
4,903 additions
and
1,247 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 |
---|---|---|
|
@@ -98,6 +98,7 @@ | |
"Hursley", | ||
"HyperLedger", | ||
"immalleable", | ||
"imodule", | ||
"ipaddress", | ||
"ipfs", | ||
"IPFSHTTP", | ||
|
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,8 +1,22 @@ | ||
name: 'Copm Test' | ||
description: "common setup steps for the weaver network needed to run copm tests" | ||
inputs: | ||
github-actor: | ||
description: the github actor variable | ||
required: true | ||
github-token: | ||
description: the github secret token variable | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: free github runner disk space | ||
shell: bash | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
- name: Use Node.js ${{ env.NODEJS_VERSION }} | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -22,15 +36,35 @@ runs: | |
cargo update -p nom | ||
cargo update -p lexical-core | ||
working-directory: weaver/core/relay | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20.2' | ||
- name: Use Protoc 3.15 | ||
shell: bash | ||
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 | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
# PROTOS | ||
- name: Build local weaver dependencies | ||
run: make setup --trace | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Generate github.properties | ||
shell: bash | ||
working-directory: packages/cacti-plugin-copm-fabric | ||
run: | | ||
echo "Using ${{ inputs.github-actor }} user." | ||
{ | ||
echo "username=${{ inputs.github-actor }}" | ||
echo "password=${{ inputs.github-token }}" | ||
echo "url=https://maven.pkg.github.com/hyperledger/cacti" | ||
} >> github.properties | ||
{ | ||
echo "username=${{ inputs.github-actor }}" | ||
echo "password=${{ inputs.github-token }}" | ||
echo "url=https://maven.pkg.github.com/hyperledger/cacti" | ||
} >> github.main.properties | ||
working-directory: weaver/tests/network-setups/corda | ||
|
||
|
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 |
---|---|---|
|
@@ -64,7 +64,7 @@ jobs: | |
plugin-htlc-coordinator-besu-changed: ${{ steps.changes.outputs.plugin-htlc-coordinator-besu-changed }} | ||
test-tooling-changed: ${{ steps.changes.outputs.test-tooling-changed }} | ||
ghcr-dev-container-vscode-changed: ${{ steps.changes.outputs.ghcr-dev-container-vscode-changed }} | ||
plugin-copm-fabric-changed: ${{ steps.changes.outputs.plugin-copm-fabric-changed }} | ||
copm-changed: ${{ steps.changes.outputs.copm-changed }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -175,9 +175,15 @@ jobs: | |
- './packages/cactus-plugin-keychain-memory/**' | ||
# - './.github/workflows/ci.yaml' | ||
plugin-copm-fabric-changed: | ||
copm-changed: | ||
- './packages/cactus-common/**' | ||
- './packages/cactus-core/**' | ||
- './packages/cactus-core-api/**' | ||
- './packages/cacti-copm-common/**' | ||
- './packages/cacti-copm-test/**' | ||
- './packages/cacti-plugin-copm-fabric/**' | ||
- './packages/cacti-plugin-copm-corda/**' | ||
- './weaver/**' | ||
build-dev: | ||
needs: check-ci-skip | ||
|
@@ -1471,7 +1477,7 @@ jobs: | |
needs: | ||
- build-dev | ||
- compute_changed_packages | ||
if: needs.compute_changed_packages.outputs.plugin-copm-fabric-changed == 'true' | ||
if: needs.compute_changed_packages.outputs.copm-changed == 'true' | ||
uses: ./.github/workflows/test_copm.yaml | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -8,62 +8,84 @@ env: | |
RUN_CODE_COVERAGE: true | ||
|
||
jobs: | ||
copm-fabric-fabric-pledge-and-provestate: | ||
continue-on-error: false | ||
env: | ||
CACTI_NPM_PACKAGE_NAME: "@hyperledger-cacti/cacti-plugin-copm-fabric" | ||
HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' | ||
FULL_BUILD_DISABLED: true | ||
FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false | ||
JEST_TEST_PATTERN: packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-pledge-claim.test.ts packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-getverifiedview.test.ts | ||
JEST_TEST_RUNNER_DISABLED: false | ||
JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/plc-copm-fabric-fabric-pledge | ||
JEST_TEST_CODE_COVERAGE_ENABLED: true | ||
TAPE_TEST_PATTERN: "" | ||
TAPE_TEST_RUNNER_DISABLED: true | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/copm_test/ | ||
- name: Make the fabric network | ||
run: make pledge-network --trace | ||
working-directory: packages/cacti-plugin-copm-fabric | ||
- name: show the running network | ||
run: docker container ls | ||
- run: ./tools/ci.sh | ||
- name: Upload coverage reports as artifacts | ||
if: ${{ env.RUN_CODE_COVERAGE == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage-reports-copm-fabric | ||
path: ./code-coverage-ts/**/ | ||
matrix-pledge-and-getview: | ||
name: pledge-getview-${{ matrix.net1 }}-${{ matrix.net2 }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
net1: ["fabric", "corda"] | ||
net2: ["fabric", "corda"] | ||
env: | ||
FULL_BUILD_DISABLED: true | ||
FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false | ||
JEST_TEST_PATTERN: packages/cacti-copm-test/src/test/typescript/integration/test-copm-getverifiedview.test.ts packages/cacti-copm-test/src/test/typescript/integration/test-copm-pledge-claim.test.ts | ||
JEST_TEST_RUNNER_DISABLED: false | ||
JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/copm-pledge-${{ matrix.net1 }}-${{ matrix.net2}} | ||
JEST_TEST_CODE_COVERAGE_ENABLED: true | ||
TAPE_TEST_PATTERN: '' | ||
TAPE_TEST_RUNNER_DISABLED: true | ||
COPM_NET_1: ${{ matrix.net1 }} | ||
COPM_NET_2: ${{ matrix.net2 }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/copm_test/ | ||
with: | ||
github-actor: ${GITHUB_ACTOR} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Make the ${{matrix.net1}} network | ||
run: | | ||
make -f Makefile_${{matrix.net1}} setup pledge-network | ||
working-directory: packages/cacti-copm-test | ||
- name: Make the ${{matrix.net2}} network | ||
run: | | ||
make -f Makefile_${{matrix.net2}} setup pledge-network | ||
working-directory: packages/cacti-copm-test | ||
if: ${{ matrix.net1 != matrix.net2 }} | ||
- name: show the running network | ||
run: docker container ls | ||
- run: ./tools/ci.sh | ||
- name: Upload coverage reports as artifacts | ||
if: ${{ env.RUN_CODE_COVERAGE == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: copm-pledge-${{ matrix.net1 }}-${{ matrix.net2}} | ||
path: ./code-coverage-ts/**/ | ||
|
||
copm-fabric-fabric-lock: | ||
continue-on-error: false | ||
env: | ||
CACTI_NPM_PACKAGE_NAME: "@hyperledger-cacti/cacti-plugin-copm-fabric" | ||
HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' | ||
FULL_BUILD_DISABLED: true | ||
FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false | ||
JEST_TEST_PATTERN: packages/cacti-plugin-copm-fabric/src/test/typescript/integration/test-copm-lock-claim.test.ts | ||
JEST_TEST_RUNNER_DISABLED: false | ||
JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/plc-copm-fabric-fabric-lock | ||
JEST_TEST_CODE_COVERAGE_ENABLED: true | ||
TAPE_TEST_PATTERN: "" | ||
TAPE_TEST_RUNNER_DISABLED: true | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/copm_test/ | ||
- name: Make the fabric network | ||
run: make lock-network --trace | ||
working-directory: packages/cacti-plugin-copm-fabric | ||
- name: show the running network | ||
run: docker container ls | ||
- run: ./tools/ci.sh | ||
- name: Upload coverage reports as artifacts | ||
if: ${{ env.RUN_CODE_COVERAGE == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage-reports-copm-fabric-lock | ||
path: ./code-coverage-ts/**/ | ||
matrix-lock: | ||
name: lock-${{ matrix.net1 }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
net1: ["fabric", "corda"] | ||
env: | ||
FULL_BUILD_DISABLED: true | ||
FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false | ||
TAPE_TEST_PATTERN: '' | ||
TAPE_TEST_RUNNER_DISABLED: true | ||
JEST_TEST_PATTERN: packages/cacti-copm-test/src/test/typescript/integration/test-copm-lock-claim.test.ts | ||
JEST_TEST_RUNNER_DISABLED: false | ||
JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/copm-lock-${{ matrix.net1 }} | ||
JEST_TEST_CODE_COVERAGE_ENABLED: true | ||
COPM_NET_1: ${{ matrix.net1 }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/copm_test/ | ||
with: | ||
github-actor: ${GITHUB_ACTOR} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Make the ${{matrix.net1}} network | ||
run: | | ||
make -f Makefile_${{matrix.net1}} setup lock-network | ||
working-directory: packages/cacti-copm-test | ||
- name: show the running network | ||
run: docker container ls | ||
- run: ./tools/ci.sh | ||
- name: Upload coverage reports as artifacts | ||
if: ${{ env.RUN_CODE_COVERAGE == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: copm-lock-${{ matrix.net1 }} | ||
path: ./code-coverage-ts/**/ | ||
|
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
Oops, something went wrong.