This will generate following stack:
Error: No available transports to dial peer QmTxbrLsEBWjHgeK4kfJoRmfXDMeL9m1pD4E7hEKueJTFa!
at nextTransport (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/dial.js:369:27)
at switch.transport.dial (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/dial.js:382:18)
at dialer.dialMany (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/transport.js:69:16)
at f (/home/radu/git/dcdn/p2p_service/node_modules/once/once.js:25:25)
at map (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/limit-dialer/index.js:61:14)
at /home/radu/git/dcdn/p2p_service/node_modules/async/internal/map.js:32:9
at /home/radu/git/dcdn/p2p_service/node_modules/async/internal/once.js:12:16
at iteratorCallback (/home/radu/git/dcdn/p2p_service/node_modules/async/eachOf.js:60:13)
at /home/radu/git/dcdn/p2p_service/node_modules/async/internal/onlyOnce.js:12:16
at Object.callback (/home/radu/git/dcdn/p2p_service/node_modules/async/internal/map.js:29:13)
After killing node2 delete node2 from node1 peerBook and dht.routingTable like bellow:
node.on('peer:disconnect', (peerInfo) => {
supernode._dht.routingTable.remove(peerInfo.id, (err) => {
if (err)
console.log(err);
});
supernode.peerBook.remove(peerInfo); <<<- Just calling this should be enough
});
Problem now is that if I call findProviders(resource) on node1, it won't crash but I will still get that there is someone providing the resource, but has no address.
Not clear how I can handle this case.
Take following case:
This will generate following stack: Error: No available transports to dial peer QmTxbrLsEBWjHgeK4kfJoRmfXDMeL9m1pD4E7hEKueJTFa! at nextTransport (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/dial.js:369:27) at switch.transport.dial (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/dial.js:382:18) at dialer.dialMany (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/transport.js:69:16) at f (/home/radu/git/dcdn/p2p_service/node_modules/once/once.js:25:25) at map (/home/radu/git/dcdn/p2p_service/node_modules/libp2p/node_modules/libp2p-switch/src/limit-dialer/index.js:61:14) at /home/radu/git/dcdn/p2p_service/node_modules/async/internal/map.js:32:9 at /home/radu/git/dcdn/p2p_service/node_modules/async/internal/once.js:12:16 at iteratorCallback (/home/radu/git/dcdn/p2p_service/node_modules/async/eachOf.js:60:13) at /home/radu/git/dcdn/p2p_service/node_modules/async/internal/onlyOnce.js:12:16 at Object.callback (/home/radu/git/dcdn/p2p_service/node_modules/async/internal/map.js:29:13)
After killing node2 delete node2 from node1 peerBook and dht.routingTable like bellow: node.on('peer:disconnect', (peerInfo) => { supernode._dht.routingTable.remove(peerInfo.id, (err) => { if (err) console.log(err); });
supernode.peerBook.remove(peerInfo); <<<- Just calling this should be enough });
Problem now is that if I call findProviders(resource) on node1, it won't crash but I will still get that there is someone providing the resource, but has no address.