mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-15 10:11:22 +00:00
fix(example): rename misleading variable (#645)
* fix(example): rename misleading variable * fix: typo
This commit is contained in:
committed by
GitHub
parent
3fa1fa3a0b
commit
b781911ac2
@ -8,12 +8,12 @@ const Protector = require('libp2p/src/pnet')
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* privateLibp2pNode returns a libp2p node function that will use the swarm
|
* privateLibp2pNode returns a libp2p node function that will use the swarm
|
||||||
* key at the given `swarmKeyPath` to create the Protector
|
* key with the given `swarmKey` to create the Protector
|
||||||
*
|
*
|
||||||
* @param {Buffer} swarmKey
|
* @param {Buffer} swarmKey
|
||||||
* @returns {Promise<libp2p>} Returns a libp2pNode function for use in IPFS creation
|
* @returns {Promise<libp2p>} Returns a libp2pNode function for use in IPFS creation
|
||||||
*/
|
*/
|
||||||
const privateLibp2pNode = async (swarmKeyPath) => {
|
const privateLibp2pNode = async (swarmKey) => {
|
||||||
const node = await Libp2p.create({
|
const node = await Libp2p.create({
|
||||||
modules: {
|
modules: {
|
||||||
transport: [TCP], // We're only using the TCP transport for this example
|
transport: [TCP], // We're only using the TCP transport for this example
|
||||||
@ -25,7 +25,7 @@ const privateLibp2pNode = async (swarmKeyPath) => {
|
|||||||
// being left in for explicit readability.
|
// being left in for explicit readability.
|
||||||
// We should explicitly dial pnet peers, or use a custom discovery service for finding nodes in our pnet
|
// We should explicitly dial pnet peers, or use a custom discovery service for finding nodes in our pnet
|
||||||
peerDiscovery: [],
|
peerDiscovery: [],
|
||||||
connProtector: new Protector(swarmKeyPath)
|
connProtector: new Protector(swarmKey)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user