Skip to content

Commit d13cd49

Browse files
futpibmaschad
andauthored
docs(@libp2p/mdns): update mdns defaults in README.md (#2037)
It's clear from the code that `broadcast` and `serviceTag` defaults are not what docs said https://github.com/libp2p/js-libp2p/blob/5294f14caa314bb150554afff3a7ff45d2bf17ba/packages/peer-discovery-mdns/src/index.ts#L42-L44 Co-authored-by: Chad Nehemiah <[email protected]>
1 parent 28d6722 commit d13cd49

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/peer-discovery-mdns/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,30 @@ async function start () {
4848
- options
4949
- `peerName` - Peer name to announce (should not be peeer id), default random string
5050
- `multiaddrs` - multiaddrs to announce
51-
- `broadcast` - (true/false) announce our presence through mDNS, default `false`
51+
- `broadcast` - (true/false) announce our presence through mDNS, default `true`
5252
- `interval` - query interval, default 10 \* 1000 (10 seconds)
53-
- `serviceTag` - name of the service announce , default 'ipfs.local\`
53+
- `serviceTag` - name of the service announce , default '_p2p._udp.local\`
5454

5555
## MDNS messages
5656

57-
A query is sent to discover the IPFS nodes on the local network
57+
A query is sent to discover the libp2p nodes on the local network
5858

5959
```js
6060
{
6161
type: 'query',
62-
questions: [ { name: 'ipfs.local', type: 'PTR' } ]
62+
questions: [ { name: '_p2p._udp.local', type: 'PTR' } ]
6363
}
6464
```
6565

66-
When a query is detected, each IPFS node sends an answer about itself
66+
When a query is detected, each libp2p node sends an answer about itself
6767

6868
```js
69-
[ { name: 'ipfs.local',
69+
[ { name: '_p2p._udp.local',
7070
type: 'PTR',
7171
class: 'IN',
7272
ttl: 120,
73-
data: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK.ipfs.local' },
74-
{ name: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK.ipfs.local',
73+
data: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK._p2p._udp.local' },
74+
{ name: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK._p2p._udp.local',
7575
type: 'SRV',
7676
class: 'IN',
7777
ttl: 120,
@@ -80,7 +80,7 @@ When a query is detected, each IPFS node sends an answer about itself
8080
weight: 1,
8181
port: '20002',
8282
target: 'LAPTOP-G5LJ7VN9' } },
83-
{ name: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK.ipfs.local',
83+
{ name: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK._p2p._udp.local',
8484
type: 'TXT',
8585
class: 'IN',
8686
ttl: 120,

0 commit comments

Comments
 (0)