-
Notifications
You must be signed in to change notification settings - Fork 283
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(cbdc-bridging-app): implementation of CBDC bridging example #2185
feat(cbdc-bridging-app): implementation of CBDC bridging example #2185
Conversation
f60cf2f
to
fb95697
Compare
165607d
to
ecbc579
Compare
d30be9f
to
b87ed02
Compare
@AndreAugusto11 I think the bot needs the dependencies declared in the PR description (e.g. the topmost comment) otherwise it won't parse it as such. |
This PR/issue depends on:
|
cd125dc
to
7c04b83
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.
@AndreAugusto11 I've just rebased onto upstream/main and fixed some of the minor bugs that were blocking the testing the basic functionality.
There is one issue remaining that happens when I use the "bridge out" functionality but other than that it seems to work fine through the GUI.
Could you please take a look into the logs and make a fix?
Backend Logs (Complete)
2023-08-15-cacti-cbdc-example-crash.log
The Failing Request from the GUI
http://localhost:4000/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest
Request Payload
{
"clientGatewayConfiguration": { "apiHost": "http://localhost:4000" },
"serverGatewayConfiguration": { "apiHost": "http://localhost:4100" },
"version": "0.0.0",
"loggingProfile": "dummyLoggingProfile",
"accessControlProfile": "dummyAccessControlProfile",
"applicationProfile": "dummyApplicationProfile",
"payloadProfile": {
"assetProfile": {
"expirationDate": "Fri Dec 24 2060 00:00:00 GMT-0800 (Pacific Standard Time)",
"issuer": "CB1",
"assetCode": "CBDC1",
"keyInformationLink": [
"5",
"x509::/OU=client/OU=org1/OU=department1/CN=userB::/C=US/ST=North Carolina/L=Durham/O=org1.example.com/CN=ca.org1.example.com",
"0xB264c626D7D09789AbfD2a431A28a054366e7b63"
]
},
"capabilities": ""
},
"assetProfile": {
"expirationDate": "Fri Dec 24 2060 00:00:00 GMT-0800 (Pacific Standard Time)",
"issuer": "CB1",
"assetCode": "CBDC1",
"keyInformationLink": [
"5",
"x509::/OU=client/OU=org1/OU=department1/CN=userB::/C=US/ST=North Carolina/L=Durham/O=org1.example.com/CN=ca.org1.example.com",
"0xB264c626D7D09789AbfD2a431A28a054366e7b63"
]
},
"assetControlProfile": "dummyAssetControlProfile",
"beneficiaryPubkey": "dummyPubKey",
"clientDltSystem": "DLT1",
"originatorPubkey": "dummyPubKey",
"recipientGatewayDltSystem": "DLT2",
"recipientGatewayPubkey": "02309ff54e58748616aa81245c1a4457f11fab47dcdb45b107dbcde24ee772b609",
"serverDltSystem": "DLT2",
"sourceGatewayDltSystem": "DLT1",
"clientIdentityPubkey": "",
"serverIdentityPubkey": "",
"maxRetries": 5,
"maxTimeout": 5000,
"sourceLedgerAssetID": "id",
"recipientLedgerAssetID": "FABRIC_ASSET_ID"
}
Response Payload
{
"message": "Internal Server Error",
"error": "Error: OdapGateway#makeRequest(), TransferInitializationRequest message failed.
Error: Request failed with status code 500\n
at /home/peter/a/cacti/packages/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway.ts:1216:19\n
at runMicrotasks (<anonymous>)\n
at processTicksAndRejections (node:internal/process/task_queues:96:5)\n
at async FabricOdapGateway.makeRequest (/home/peter/a/cacti/packages/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway.ts:1212:18)\n
at async ClientHelper.sendTransferInitializationRequest (/home/peter/a/cacti/examples/cactus-example-cbdc-bridging-backend/src/main/typescript/odap-extension/client-helper.ts:133:5)\n
at async FabricOdapGateway.runOdap (/home/peter/a/cacti/packages/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway.ts:1115:5)\n
at async ClientRequestEndpointV1.handleRequest (/home/peter/a/cacti/packages/cactus-plugin-odap-hermes/src/main/typescript/web-services/client-side/client-request-endpoint.ts:89:7)"
}
cc: @RafaelAPB
80945ae
to
d941445
Compare
@petermetz thank you for your help in all the PRs. The bug is fixed!! |
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.
@AndreAugusto11 You seem to have broken the build ;-(
Error: examples/cactus-example-cbdc-bridging-backend/src/main/typescript/odap-extension/server-helper.ts(55,48): error TS2339: Property 'TransferInitialization' does not exist on type 'typeof OdapMessageType'.
d941445
to
99e9304
Compare
@AndreAugusto11 OK, I figured it out, it was the enum property that I renamed originally, put it back how it was! |
@petermetz yes, that's right, sorry |
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.
@AndreAugusto11 No worries, glad we figured it out finally!
I retested it now and it works on my machine!
The only small bug I saw (for future reference) is that the bridge's balance is unchanged on the left after I do a bridge out to send money to the right (I assumed the balance of it should be decreased on the UI)
This application demonstrates a CBDC bridging between a Fabric and a Besu network using the ODAP business logic plugin, a protocol under standardization for cross-chain asset transfers in the IETF. The goal is to demonstrate the use of npm packages of Cactus so that anyone can build a solution on top of Cacti. Summary: * CBDC application backend (set up underlying ledgers and deployment of smart contracts) * Add support for multiple organizations in some operations in the FabricTestLedger * Add support for minting some Ether to a given address in the BesuTestLedger Future Work: * CBDC app UI demonstrating the use of the app is, for now, only available as docker image * A Dockerfile for the backend will be created as soon as this package is published to npm * More documentation will be added in the next weeks Depends on: hyperledger-cacti#2205 Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com> Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt> Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
99e9304
to
29096a7
Compare
@petermetz The balance is only updated when we refresh the page (the GET request is done once every page load). That's certainly something to improve. I'm not sure if that's the case you're referring to, but I'll take a look anyway 😀 |
@AndreAugusto11 It stayed that way after page refresh as well :-( |
@petermetz I have tested it again, I think I got it! So, when doing a If you believe it is useful, I can also write a small section talking about the example in the whitepaper. What do you think? |
@AndreAugusto11 I like the idea but the whitepaper is currently out of commission until we have time to renovate/update it properly. What I'd recommend is extending the README.md file of the example itself with this information and once the whitepaper is back online we can add the same info there as well! |
This PR presents a new example to demonstrate the capabilities of Cactus. This application demonstrates a CBDC bridging between a Fabric and a Besu network using the ODAP business logic plugin, a protocol under standardization for cross-chain operations in the IETF.
The goal is to demonstrate the use of npm packages of Cactus so that anyone can build a solution such as this. (Some dependencies are not using npm packages and the Dockerfile is not functional yet since some npm packages are not available yet – an example is the ODAP plugin).
Summary of the contributions:
Future Work:
aaugusto11/cactus-example-cbdc-bridging-frontend
) so that one can run the entire app and play with it.Depends on #2205
Depends on #2251
Depends on #2249
Signed-off-by: André Augusto andre.augusto@tecnico.ulisboa.pt