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(client, broker): [NET-1310] Use custom event polling logic for Broker features #2601

Merged
merged 61 commits into from
Jun 28, 2024

Conversation

teogeb
Copy link
Contributor

@teogeb teogeb commented Jun 18, 2024

Moved OperatorContractFacade and operatorContractUtils from the broker package to the client package. Renamed it to Operator. Added StreamrClient#getOperator semi-public method to the client API.

Modified the class to use client's contract utilities, e.g. the FallbackProvider and the ChainEventPoller.

  • The functions of operatorContractUtils don't use FallbackProvider and the ChainEventPoller. That's maybe ok as those are used in tests only. But if we start to use the functions in production code, we should start to start to use the helper classes also in these functions.

Future improvements

  • Replace individual contract artifacts with imports from @streamr/network-contracts-ethers6. But need to find a way to do this without bloating webpack bundle size.
  • Could use https://typedoc.org/tags/hidden/ in classes/methods which are currently marked as @deprecated?
  • Do we need to export the _operatorContractUtils object? Maybe could add a StreamrClient#getSponsorship method? Some methods/functions of Operator and operatorContractUtils could be moved to the class returned by that method
    • Maybe could remove OperatorRegistry class?
  • Lazy load instances of Contract in Operator?

@github-actions github-actions bot added broker Related to Broker Package client Related to Client Package labels Jun 18, 2024
@teogeb teogeb force-pushed the mv-broker-OperatorContractFacade branch from 11edbf1 to 35a74cb Compare June 18, 2024 12:51
@github-actions github-actions bot added network Related to Network Package utils labels Jun 24, 2024
@teogeb teogeb marked this pull request as ready for review June 27, 2024 11:56
@teogeb teogeb requested a review from harbu June 27, 2024 11:56
packages/broker/src/plugins/operator/OperatorPlugin.ts Outdated Show resolved Hide resolved
packages/broker/src/plugins/operator/inspectRandomNode.ts Outdated Show resolved Hide resolved
packages/broker/src/plugins/operator/inspectionUtils.ts Outdated Show resolved Hide resolved
packages/broker/src/plugins/operator/reviewSuspectNode.ts Outdated Show resolved Hide resolved
packages/client/src/StreamrClient.ts Outdated Show resolved Hide resolved
packages/client/src/contracts/Operator.ts Outdated Show resolved Hide resolved
packages/client/src/contracts/Operator.ts Outdated Show resolved Hide resolved
packages/client/src/contracts/Operator.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the docs label Jun 27, 2024
@teogeb teogeb requested a review from harbu June 27, 2024 20:39
@harbu harbu merged commit 04db025 into main Jun 28, 2024
25 checks passed
@harbu harbu deleted the mv-broker-OperatorContractFacade branch June 28, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broker Related to Broker Package client Related to Client Package docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants