This repository was archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
dht functionality #1857
Copy link
Copy link
Closed
Labels
P1High: Likely tackled by core team if no one steps upHigh: Likely tackled by core team if no one steps upexp/expertHaving worked on the specific codebase is importantHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)
Description
- Version:
feat/dht-part-ii branch (b0acc71) - Platform:
mac/linux - Subsystem:
dht
I just used browserify directly on a little example while having the feat/dhs-part-ii branch checked out.
So now my index.js looks like
'use strict'
const IPFS = require('ipfs')
const Protector = require('libp2p-pnet')
const swarmKey = Buffer.from("/key/swarm/psk/1.0.0/\n/base16/\nTHEKEY")
const node = new IPFS({
repo: String(Math.random() + Date.now()),
relay: {
enabled: true,
hop: {enabled: true}
},
preload: {enabled: false},
libp2p2: {
modules: {
connProtector: new Protector(swarmKey)
}
},
config: {
Bootstrap: ["/ip4/IP_TO_A_GOLANG_NODE/tcp/9443/ws/ipfs/THE_PEER_ID"]
}
})
node.once('ready', function() {
console.log('IPFS node is ready')
window.node = node
node.dht.findPeer('THE_PEER_ID')
})
However I always get Error: Peer lookup failed from that last line.
Also even trying to do a node.get('THE_PEER_FILE_HASH') just hangs, even though that peers is in the node.swarm.peers() (only one since its the bootstrap).
If I take out the swarm key and connect to public network, the findPeer doesn't fail but always returns nothing, same with findProvs etc.
Metadata
Metadata
Assignees
Labels
P1High: Likely tackled by core team if no one steps upHigh: Likely tackled by core team if no one steps upexp/expertHaving worked on the specific codebase is importantHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)