How to use peer-info - 10 common examples

To help you get started, we’ve selected a few peer-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github libp2p / js-libp2p-switch / test / utils.js View on Github external
tasks.push((cb) => {
      if (fixtures[i]) {
        PeerId.createFromJSON(fixtures[i].id, (err, id) => {
          if (err) {
            return cb(err)
          }

          cb(null, new PeerInfo(id))
        })
        return
      }

      PeerInfo.create(cb)
    })
  }
github validitylabs / hopr / src / js / testing / index.js View on Github external
(key, cb) => {
                    let hash = crypto.createHash('sha256').update(key.public.bytes).digest()
                    let id = Multihash.encode(hash, 'sha2-256')
                    PeerInfo.create(new PeerId(id, key, key.public), cb)
                }
            ], cb)
github libp2p / js-libp2p-floodsub / test / utils / index.js View on Github external
exports.createPeerInfo = async () => {
  const peerId = await PeerId.create({ bits: 1024 })

  return PeerInfo.create(peerId)
}
github libp2p / js-libp2p / test / circuit / dialer.spec.js View on Github external
PeerId.createFromJSON(nodes.node4, (_, peerId) => {
        PeerInfo.create(peerId, (err, peerInfo) => {
          peer = peerInfo
          peer.multiaddrs.add('/p2p-circuit/ipfs/QmSswe1dCFRepmhjAMR5VfHeokGLcvVggkuDJm7RMfJSrE')
          done(err)
        })
      })
    })
github ipfs / js-datastore-pubsub / test / utils.js View on Github external
const createPeerInfo = async () => {
  const peerId = await PeerId.create({ bits: 1024 })

  return PeerInfo.create(peerId)
}
github libp2p / js-libp2p / test / utils / create-node.js View on Github external
    (peerId, cb) => PeerInfo.create(peerId, cb)
  ], callback)
github libp2p / js-libp2p / test / utils / creators / peer.js View on Github external
  return pTimes(number, (i) => PeerInfo.create(peerIds[i]))
}
github libp2p / js-libp2p / pdd / pdd-transport--story-3--peer-b.js View on Github external
    (cb) => PeerInfo.create(PeerB, cb),
    (peerInfo, cb) => {
github libp2p / js-libp2p / pdd / pdd-transport--story-1--peer-a.js View on Github external
    (cb) => PeerInfo.create(PeerA, cb),
    (peerInfo, cb) => {
github libp2p / js-libp2p / pdd / pdd-transport--story-2--peer-a.js View on Github external
    (cb) => PeerInfo.create(PeerA, cb),
    (peerInfo, cb) => {

peer-info

IPFS Peer abstraction JavaScript implementation

MIT
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular peer-info functions