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(connector-besu, connector-quorum): filesystem replaced by keychain #702

Merged
merged 2 commits into from
Apr 12, 2021

Conversation

jordigiam
Copy link

@jordigiam jordigiam commented Mar 22, 2021

Resolves #678
Resolves #680

@jordigiam jordigiam self-assigned this Mar 22, 2021
@jordigiam jordigiam marked this pull request as ready for review March 22, 2021 10:48
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jordigiam When we generate the changelogs at release time, with the current commit message, this will show up as besu getting the keychain support, but there will be nothing there about quorum. Is there any chance that you could either break it up into two commits (it's OK to keep the PR as is, with 2 commits because they are doing the same change anyway) like
Commit 1 feat(connector-besu): filesystem replaced by keychain
Commit 2 feat(connector-quorum): filesystem replaced by keychain

Or you could also leave it in one commit and just edit the scope to include both besu and quorum like
feat(connector-besu,connector-quorum): filesystem replaced by keychain
Assuming it's not over the character limit this would work as well. Also any other solution that makes sure that the generated changelogs will mention both quorum and besu would work for me, but I only know of the two options above to make it so.

);
if (contractJson.contractName != contractName) {
if (!keychainPlugin.has(contractName)) {
throw new Error(
`${fnTag} Cannot create an instance of the contract because the contractName and the contractName of the JSON doesn't match`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jordigiam Is it possible that the error message of the exception is no longer accurate as to what is happening? I'd slightly rephrase it to explain that the request had a contract name specified and we did not find an entry like that in the keychain.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@jordigiam jordigiam force-pushed the feature/replace-filesystem branch from 9cf7c80 to 96ab837 Compare April 7, 2021 06:50
@jordigiam jordigiam changed the title feat(connector-besu): filesystem replaced by keychain feat(connector-besu, connector-quorum): filesystem replaced by keychain Apr 7, 2021
@jordigiam jordigiam requested a review from petermetz April 7, 2021 09:07
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jordigiam Just tracking/noting down for the record here what we discussed on the pair programming session today => please make sure that the request can always override whatever is in this.contracts by using the keychain instead.

@jordigiam jordigiam force-pushed the feature/replace-filesystem branch 4 times, most recently from 8246edc to 604edf6 Compare April 9, 2021 06:25
Signed-off-by: jordigiam <jordi.giron.amezcua@accenture.com>
@jordigiam jordigiam force-pushed the feature/replace-filesystem branch from 604edf6 to 6cdc0c3 Compare April 9, 2021 06:48
@jordigiam jordigiam requested a review from petermetz April 9, 2021 08:17
With these changes I was able to build the container image
and then launch it, test it, etc.

The Fabric part of it fails with the error below which I
suspect is a problem with Fabric changing their
release tags over time, breaking software that depends
on Fabric even when exact versions are specified.

},
    data: {
      error: 'Error: PluginLedgerConnectorFabric#transact() Unable to run transaction: Event strategy not satisfied within the timeout period. No response received from event hubs: peer0.org1.example.com, peer0.org2.example.com:9051, peer1.org2.example.com:10051, peer1.org1.example.com:8051\n' +
        '    at PluginLedgerConnectorFabric.transact (/cactus-scratch-1/packages/cactus-plugin-ledger-connector-fabric/dist/lib/main/typescript/plugin-ledger-connector-fabric.js:331:19)\n' +
        '    at runMicrotasks (<anonymous>)\n' +
        '    at processTicksAndRejections (internal/process/task_queues.js:97:5)'
    }

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Note to self: We need to put in some time to design something that's stateless so that the contracts map can be eliminated entirely (somehow, but I don't know any better right now either except for the consortium database, but that's also not a mature design for contract storage so back to my initial point about putting time into some design...)

One thing I noticed is that we could expose a get network ID endpoint on the web3 flavored connectors (besu, quorum) so that we can build on that in the future by requiring the caller to fill the network ID themselves and freeing the connector from having to do that altogether.

@jordigiam jordigiam merged commit 4635d81 into hyperledger-cacti:main Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants