Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
})
}
(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)
exports.createPeerInfo = async () => {
const peerId = await PeerId.create({ bits: 1024 })
return PeerInfo.create(peerId)
}
PeerId.createFromJSON(nodes.node4, (_, peerId) => {
PeerInfo.create(peerId, (err, peerInfo) => {
peer = peerInfo
peer.multiaddrs.add('/p2p-circuit/ipfs/QmSswe1dCFRepmhjAMR5VfHeokGLcvVggkuDJm7RMfJSrE')
done(err)
})
})
})
const createPeerInfo = async () => {
const peerId = await PeerId.create({ bits: 1024 })
return PeerInfo.create(peerId)
}
(peerId, cb) => PeerInfo.create(peerId, cb)
], callback)
return pTimes(number, (i) => PeerInfo.create(peerIds[i]))
}
(cb) => PeerInfo.create(PeerB, cb),
(peerInfo, cb) => {
(cb) => PeerInfo.create(PeerA, cb),
(peerInfo, cb) => {
(cb) => PeerInfo.create(PeerA, cb),
(peerInfo, cb) => {