-
Notifications
You must be signed in to change notification settings - Fork 285
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(copm): add Corda COPM implementation #3625
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jenniferlianne Looking pretty high quality in general, but as usual I have some requests. On top of the comments I left inline, please make sure to include a test case which verifies the plugin being functional while used through the API server (you'll most likely need a separate package because this one cannot depend on the API server due to circular dependency issues)
If you need examples just let me know.
...acti/plugin/cacti/plugin/copm/core/services/defaultservice/DefaultServiceOuterClassGrpcKt.kt
Outdated
Show resolved
Hide resolved
packages/cacti-plugin-copm-corda/src/main/typescript/plugin-copm-corda.ts
Outdated
Show resolved
Hide resolved
...plugin-copm-corda/src/main/kotlin/org/hyperledger/cacti/plugin/copm/corda/CordaAssetClaim.kt
Show resolved
Hide resolved
e107eb5
to
e04747c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jenniferlianne LGTM, thank you!
e04747c
to
69d8450
Compare
As mentioned on the call, the plugin is brought up via the ApiServer in both fabric and corda cases. Please see: |
packages/cacti-copm-core/src/main/proto/generated/openapi/models/asset_lock_claim_v1_pb.proto
Show resolved
Hide resolved
packages/cacti-copm-test/src/main/typescript/lib/weaver-interop-configuration.ts
Show resolved
Hide resolved
packages/cacti-plugin-copm-corda/sample/src/main/kotlin/com/copmCorda/SampleInteropConfig.kt
Outdated
Show resolved
Hide resolved
...-corda/sample/src/main/kotlin/com/copmCorda/interop/corda/RemoteCopmContractCordaFungible.kt
Outdated
Show resolved
Hide resolved
...-copm-corda/sample/src/main/kotlin/com/copmCorda/interop/corda/RemoteCopmContractCordaNFT.kt
Outdated
Show resolved
Hide resolved
...orda/sample/src/main/kotlin/com/copmCorda/interop/fabric/RemoteCopmContractFabricFungible.kt
Outdated
Show resolved
Hide resolved
...opm-corda/sample/src/main/kotlin/com/copmCorda/interop/fabric/RemoteCopmContractFabricNFT.kt
Outdated
Show resolved
Hide resolved
packages/cacti-plugin-copm-corda/src/main/typescript/plugin-copm-corda.ts
Show resolved
Hide resolved
@jenniferlianne Thank you for the PR, overall looks good to me. Just some small suggestions above I've shared. |
@@ -15,7 +16,8 @@ export type CopmContractNames = { | |||
}; | |||
|
|||
export type RemoteNetworkConfig = { | |||
channelName: string; | |||
channelName: string; // fabric-specific | |||
chaincode: string; // fabric-specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to chaincodeName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably networkName
instead of network
in the below line 21?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further discussion on the project channel I have removed the chaincode and flowPackage variables from the remote network configuration struct as remote networks may use multiple chaincode packages in both fabric and corda. The network variable has been renamed networkName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jenniferlianne I'm not sure about the purpose of this type RemoteNetworkConfig
, but even the channelName and corda party endpoints could also be different for every remote call for the same network, as there can be multiple channels (as discussed on discord).
I believe you have taken this from fabric-cli which was a tool for testing purpose, but since this is a main package to be used by others, I would recommend to make it as general as possible.
Its okay if you can just open an issue to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @VRamakrishna 2 weeks ago, the naming, which is consistent with a similar structure in the fabric implementation submitted 3 months ago, reflects the data structures in the weaver test network json configuration files. While named 'network', they seem to talk about organizations, not networks. While I may be wrong, I expect this information will not change on the fly for a given organization. Can rename to RemoteOrganizationConfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets it be as it is for now, just open an issue to track this, so that we can think about it more later, if we actually need restructuring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too late - I updated the naming to be RemoteOrganization, as well as using 'organization' instead of 'network' for AssetAccounts in the OpenApi spec. The code is more consistent now. I opened an issue here for revisiting in the future: #3656
69d8450
to
28bc627
Compare
ac09efd
to
f88723e
Compare
5b82161
to
9858457
Compare
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]>
9858457
to
4f62aec
Compare
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:
Pull Request Requirements
upstream/main
branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.-s
flag when usinggit commit
command. You may refer to this link for more information.Character Limit
A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.