Skip to content

Commit

Permalink
fix: add autonat capability (#2827)
Browse files Browse the repository at this point in the history
Add the service capability to signal to other components that
autonat can provide functionality
  • Loading branch information
achingbrain authored Nov 18, 2024
1 parent 656db81 commit 05d559f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/protocol-autonat/src/autonat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbortError, setMaxListeners } from '@libp2p/interface'
import { AbortError, serviceCapabilities, setMaxListeners } from '@libp2p/interface'
import { peerIdFromMultihash } from '@libp2p/peer-id'
import { isPrivateIp } from '@libp2p/utils/private-ip'
import { multiaddr, protocols } from '@multiformats/multiaddr'
Expand Down Expand Up @@ -50,6 +50,10 @@ export class AutoNATService implements Startable {

readonly [Symbol.toStringTag] = '@libp2p/autonat'

readonly [serviceCapabilities]: string[] = [
'@libp2p/autonat'
]

isStarted (): boolean {
return this.started
}
Expand Down

0 comments on commit 05d559f

Please sign in to comment.