Skip to content

refactor: discontinue dedicated HTTP listeners (ExpressJS apps) for web service plugins #358

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

Closed
petermetz opened this issue Nov 4, 2020 · 9 comments · Fixed by #1041
Closed
Assignees
Labels
API_Server enhancement New feature or request good-first-issue Good for newcomers good-first-issue-200-intermediate Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label.
Milestone

Comments

@petermetz
Copy link
Contributor

petermetz commented Nov 4, 2020

Description

Originally we implemented this feature to provide the possibility for deployments to run plugins isolated on separate web domains/network hosts, but with today's code the latter can also be achieved by running multiple API servers which makes the dedicated HTTP listeners of plugins a redundant feature which also throws a wrench into the consortium definition powered routing within nodes.

Added benefit: Make it less confusing to implement plugins.


Examples of the code that is being talked about in this issue:

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-plugin-consortium-manual/src/main/typescript/plugin-consortium-manual.ts#L68

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts#L101

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts#L58

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts#L73

These shutdown methods on plugin classes could be deleted since this change would place the concern of HTTP listeners back completely to the control of the API server:
https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-plugin-consortium-manual/src/main/typescript/plugin-consortium-manual.ts#L45


Also could get rid of these from the common interface definition for web service plugins:

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-core-api/src/main/typescript/plugin/web-service/i-plugin-web-service.ts#L9

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-core-api/src/main/typescript/plugin/web-service/i-plugin-web-service.ts#L10

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-core-api/src/main/typescript/plugin/web-service/i-plugin-web-service.ts#L20

https://github.com/hyperledger/cactus/blob/3f0d86d2d7a95fce63bae2635466644e461d5f3e/packages/cactus-core-api/src/main/typescript/plugin/web-service/i-plugin-web-service.ts#L23

Acceptance Criteria

  1. Redundant code is removed
  2. Updated the common web service plugin interface
  3. Code compiles, tests are passing. Where applicable test cases were updated so that the HTTP layer isolation is demonstrated via separate instances of API servers rather than plugins running their dedicated listeners.

cc: @sfuji822 @takeutak @jonathan-m-hamilton

@petermetz petermetz added API_Server enhancement New feature or request good-first-issue Good for newcomers Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. labels Nov 4, 2020
@petermetz petermetz added this to the v0.3.0 milestone Nov 4, 2020
@petermetz petermetz modified the milestones: v0.3.0, v0.4.0 Jan 8, 2021
@petermetz petermetz modified the milestones: v0.4.0, v0.5.0 Apr 25, 2021
@siv2r
Copy link

siv2r commented May 9, 2021

Hey, I am new to HL Cactus and would like to start contributing to this project. Can I try working on this issue?

@petermetz
Copy link
Contributor Author

@siv2r Welcome to the project! Yeah, I think this is a good one to get started on, it's mostly just demolition work (deleting code).
If you need any help I'm here and I can also recommend our pair programming sessions that run daily (check the wiki or the calendar for the links)

@petermetz petermetz modified the milestones: v0.5.0, v0.6.0 May 19, 2021
@TonyRowntree
Copy link
Contributor

hey @siv2r are you still working on this? Or can I pick this up?

@siv2r
Copy link

siv2r commented Jun 10, 2021 via email

@TonyRowntree TonyRowntree self-assigned this Jun 10, 2021
@TonyRowntree
Copy link
Contributor

Also delete from the connector interface

@petermetz
Copy link
Contributor Author

@TonyRowntree Is it cool if I reassign this to @Leeyoungone ?

@TonyRowntree
Copy link
Contributor

@TonyRowntree Is it cool if I reassign this to @Leeyoungone ?

Sure thing! 👍

@petermetz
Copy link
Contributor Author

@Leeyoungone Please make a comment on the issue to enable assignment.

@Leeyoungone
Copy link
Contributor

Leeyoungone commented Aug 20, 2021

Thank you for letting me pick this up!

@petermetz petermetz modified the milestones: v0.9.0, v0.10.0 Sep 2, 2021
Leeyoungone added a commit to TonyRowntree/cactus that referenced this issue Sep 24, 2021
Leeyoungone added a commit to TonyRowntree/cactus that referenced this issue Sep 25, 2021
petermetz pushed a commit that referenced this issue Sep 27, 2021
…plugins

Fixes #358

Signed-off-by: TonyRowntree [email protected]
Signed-off-by: Youngone Lee <[email protected]>
maramih pushed a commit to maramih/cactus that referenced this issue Sep 27, 2021
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Sep 28, 2021
brioux pushed a commit to brioux/cactus that referenced this issue Oct 4, 2021
RafaelAPB pushed a commit to RafaelAPB/blockchain-integration-framework that referenced this issue Mar 9, 2022
ryjones pushed a commit that referenced this issue Feb 1, 2023
Updating Golang package versions and dependencies and Re-enabling workflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server enhancement New feature or request good-first-issue Good for newcomers good-first-issue-200-intermediate Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants