Skip to content

Commit

Permalink
fix: add getProtocols method (#1523)
Browse files Browse the repository at this point in the history
So we don't have to expose the registrar component, add a method to get the currently supported protocols
  • Loading branch information
achingbrain authored Dec 21, 2022
1 parent 2fa2893 commit 57a56aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libp2p.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
return this.components.addressManager.getAddresses()
}

getProtocols (): string[] {
return this.components.registrar.getProtocols()
}

async hangUp (peer: PeerId | Multiaddr): Promise<void> {
const { id } = getPeer(peer)

Expand Down

0 comments on commit 57a56aa

Please sign in to comment.