Skip to content

Commit

Permalink
docs: add config example listening on interfaces (#2578)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Daniel N <2color@users.noreply.github.com>
Co-authored-by: Alex Potsides <alex@achingbrain.net>
  • Loading branch information
3 people authored Jun 6, 2024
1 parent bc6556f commit 769461d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ It's important to note that some services depend on others in order to function

```js
// Creating a libp2p node with:
// listen on tcp ports 9001 and 9002 on all interfaces
// transport: websockets + tcp
// stream-muxing: mplex
// crypto-channel: noise
Expand All @@ -255,6 +256,12 @@ import { gossipsub } from 'libp2p-gossipsub'
import { yamux } from '@chainsafe/libp2p-yamux'

const node = await createLibp2p({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/9001/ws',
'/ip4/0.0.0.0/tcp/9002',
],
},
transports: [
tcp(),
webSockets()
Expand Down

0 comments on commit 769461d

Please sign in to comment.