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(cmd-socketio-server): support multiple BLP in single server #2103

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

outSH
Copy link
Contributor

@outSH outSH commented Jun 27, 2022

  • Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
    All required TransactionManagement request should be routed to the correct BLP.
  • Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
  • Fix some bugs and hard-coded BLP Ids in TransactionManagement.
  • Add new unit tests to check newly added functionalities.

Closes #2102

Depends on #2030

Signed-off-by: Michal Bajer [email protected]

@outSH
Copy link
Contributor Author

outSH commented Jun 27, 2022

@jagpreetsinghsasan @izuru0 Please review (only the last commit)

Copy link
Contributor

@jagpreetsinghsasan jagpreetsinghsasan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@izuru0 izuru0 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

This PR/issue depends on:

@outSH outSH force-pushed the blp_refactor_pr branch from cae65b0 to 59496e5 Compare July 15, 2022 11:17
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.

@outSH LGTM, thank you!

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.

@outSH Please resolve the merge conflict and then we are good to go!

@outSH
Copy link
Contributor Author

outSH commented Sep 2, 2022

@outSH Please resolve the merge conflict and then we are good to go!

@petermetz Resolved

@outSH outSH requested review from petermetz and removed request for sandeepnRES and takeutak September 2, 2022 11:53
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.

@outSH Thank you! LGTM

At the same time though, I see this test failure which does not look like a flake. Could you please take a look?

FAIL packages/cactus-cmd-socketio-server/src/test/typescript/unit/cmd-socketio-blp-plugin.test.ts
  ● Test suite failed to run

    ENOENT: no such file or directory, open '/etc/cactus/validator-registry-config.yaml'

      67 |
      68 |   constructor(path: string) {
    > 69 |     const yamlText = fs.readFileSync(path, "utf8");
         |                         ^
      70 |     const yamlObj = yaml.safeLoad(yamlText);
      71 |     this.ledgerPluginInfo = yamlObj.ledgerPluginInfo;
      72 |     this.signTxInfo = yamlObj.signTxInfo;

      at new ValidatorRegistry (packages/cactus-cmd-socketio-server/src/main/typescript/verifier/validator-registry.ts:69:25)
      at Object.<anonymous> (packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/DBAccess.ts:18:43)
      at Object.<anonymous> (packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/LPInfoHolder.ts:8:1)

@outSH
Copy link
Contributor Author

outSH commented Sep 26, 2022

@outSH Thank you! LGTM

At the same time though, I see this test failure which does not look like a flake. Could you please take a look?

FAIL packages/cactus-cmd-socketio-server/src/test/typescript/unit/cmd-socketio-blp-plugin.test.ts
  ● Test suite failed to run

    ENOENT: no such file or directory, open '/etc/cactus/validator-registry-config.yaml'

      67 |
      68 |   constructor(path: string) {
    > 69 |     const yamlText = fs.readFileSync(path, "utf8");
         |                         ^
      70 |     const yamlObj = yaml.safeLoad(yamlText);
      71 |     this.ledgerPluginInfo = yamlObj.ledgerPluginInfo;
      72 |     this.signTxInfo = yamlObj.signTxInfo;

      at new ValidatorRegistry (packages/cactus-cmd-socketio-server/src/main/typescript/verifier/validator-registry.ts:69:25)
      at Object.<anonymous> (packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/DBAccess.ts:18:43)
      at Object.<anonymous> (packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/LPInfoHolder.ts:8:1)

@petermetz Oh yes. sorry I've missed that - should be fixed now :)

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.

@outSH Please fix the merge conflict and then pass it back for review!

@outSH
Copy link
Contributor Author

outSH commented Nov 28, 2022

@petermetz Rebased and tested - ready to merge

@outSH outSH requested a review from petermetz November 28, 2022 15:42
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.

@outSH LGTM, thank you!

- Add support for starting Cactus CMD SocketIO server with multiple Bussiness Logic Plugins (BLP).
  All required TransactionManagement request should be routed to the correct BLP.
- Add optional onListening callback when starting the cactus cmd socketio server, to simplify tests.
- Fix some bugs and hard-coded BLP Ids in TransactionManagement.
- Add new unit tests to check newly added functionalities.

Closes hyperledger-cacti#2102

Depends on hyperledger-cacti#2030

Signed-off-by: Michal Bajer <[email protected]>
@petermetz petermetz merged commit 0f67085 into hyperledger-cacti:main Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(cmd-socketio-server): support multiple BLP in single server
4 participants