Skip to content

Commit

Permalink
Merge pull request #362 from fawazahmed0/patch-1
Browse files Browse the repository at this point in the history
Fix broken example
  • Loading branch information
Stebalien authored Feb 13, 2024
2 parents ec0a075 + 397e984 commit c76535b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/guides/getting-started/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ We can configure and use [`pingService`](https://libp2p.github.io/js-libp2p/modu
We can have our application accepting a peer multiaddress via command line argument and try to ping it. To do so, we'll need to add a couple things. First, require the `process` module so that we can get the command line arguments. Then we'll need to parse the multiaddress from the command line and try to ping it:

```sh
npm install multiaddr
npm install multiaddr @libp2p/ping
```

```javascript
Expand All @@ -197,7 +197,7 @@ import { tcp } from '@libp2p/tcp'
import { noise } from '@chainsafe/libp2p-noise'
import { mplex } from '@libp2p/mplex'
import { multiaddr } from 'multiaddr'
import { pingService } from 'libp2p/ping'
import { ping } from '@libp2p/ping'

const node = await createLibp2p({
addresses: {
Expand All @@ -208,7 +208,7 @@ const node = await createLibp2p({
connectionEncryption: [noise()],
streamMuxers: [mplex()],
services: {
ping: pingService({
ping: ping({
protocolPrefix: 'ipfs', // default
}),
},
Expand Down

0 comments on commit c76535b

Please sign in to comment.