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: add capability detection to metrics-devtools #2708

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

achingbrain
Copy link
Member

Description

Adds the ability to find configured services that possess a given capability and interact with that service via rpc.

Starts with a configured PubSub service.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

Adds the ability to find configured services that possess a given
capability and interact with that service via rpc.

Starts with a configured PubSub service.
@achingbrain achingbrain requested a review from a team as a code owner September 19, 2024 09:45
@@ -257,6 +262,13 @@ class DevToolsMetrics implements Metrics, Startable {
.catch(err => {
this.log.error('error while reading RPC messages', err)
})

const pubsub = findCapability('@libp2p/pubsub', this.components)
Copy link
Member

Choose a reason for hiding this comment

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

can you use getPubsub here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because you need to know the name of the pubsub component ahead of time to use getPubsub

@achingbrain achingbrain merged commit 4fd7eb2 into main Sep 20, 2024
21 checks passed
@achingbrain achingbrain deleted the feat/add-capability-detection branch September 20, 2024 13:40
@achingbrain achingbrain mentioned this pull request Sep 20, 2024
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.

2 participants