Skip to content

Commit b781911

Browse files
author
Julien Bouquillon
authored
fix(example): rename misleading variable (#645)
* fix(example): rename misleading variable * fix: typo
1 parent 3fa1fa3 commit b781911

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/pnet/libp2p-node.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const Protector = require('libp2p/src/pnet')
88

99
/**
1010
* privateLibp2pNode returns a libp2p node function that will use the swarm
11-
* key at the given `swarmKeyPath` to create the Protector
11+
* key with the given `swarmKey` to create the Protector
1212
*
1313
* @param {Buffer} swarmKey
1414
* @returns {Promise<libp2p>} Returns a libp2pNode function for use in IPFS creation
1515
*/
16-
const privateLibp2pNode = async (swarmKeyPath) => {
16+
const privateLibp2pNode = async (swarmKey) => {
1717
const node = await Libp2p.create({
1818
modules: {
1919
transport: [TCP], // We're only using the TCP transport for this example
@@ -25,7 +25,7 @@ const privateLibp2pNode = async (swarmKeyPath) => {
2525
// being left in for explicit readability.
2626
// We should explicitly dial pnet peers, or use a custom discovery service for finding nodes in our pnet
2727
peerDiscovery: [],
28-
connProtector: new Protector(swarmKeyPath)
28+
connProtector: new Protector(swarmKey)
2929
}
3030
})
3131

0 commit comments

Comments
 (0)