Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken example #362

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading