{"action":"created","issue":{"url":"https://api.github.com/repos/libp2p/js-libp2p/issues/275","repository_url":"https://api.github.com/repos/libp2p/js-libp2p","labels_url":"https://api.github.com/repos/libp2p/js-libp2p/issues/275/labels{/name}","comments_url":"https://api.github.com/repos/libp2p/js-libp2p/issues/275/comments","events_url":"https://api.github.com/repos/libp2p/js-libp2p/issues/275/events","html_url":"https://github.com/libp2p/js-libp2p/issues/275","id":377030474,"node_id":"MDU6SXNzdWUzNzcwMzA0NzQ=","number":275,"title":"Error: No content routers available","user":{"login":"klueq","id":43359723,"node_id":"MDQ6VXNlcjQzMzU5NzIz","avatar_url":"https://avatars0.githubusercontent.com/u/43359723?v=4","gravatar_id":"","url":"https://api.github.com/users/klueq","html_url":"https://github.com/klueq","followers_url":"https://api.github.com/users/klueq/followers","following_url":"https://api.github.com/users/klueq/following{/other_user}","gists_url":"https://api.github.com/users/klueq/gists{/gist_id}","starred_url":"https://api.github.com/users/klueq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klueq/subscriptions","organizations_url":"https://api.github.com/users/klueq/orgs","repos_url":"https://api.github.com/users/klueq/repos","events_url":"https://api.github.com/users/klueq/events{/privacy}","received_events_url":"https://api.github.com/users/klueq/received_events","type":"User","site_admin":false},"labels":[{"id":419592464,"node_id":"MDU6TGFiZWw0MTk1OTI0NjQ=","url":"https://api.github.com/repos/libp2p/js-libp2p/labels/backlog","name":"backlog","color":"ededed","default":false},{"id":239815005,"node_id":"MDU6TGFiZWwyMzk4MTUwMDU=","url":"https://api.github.com/repos/libp2p/js-libp2p/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-11-03T07:08:53Z","updated_at":"2018-11-15T10:50:00Z","closed_at":null,"author_association":"NONE","body":"DHT doesn't seem to work because of this. Built the latest js-ipfs + the DHT PR + the latest js-libp2p:\r\n\r\nhttps://klueq.github.io/?https://ipfs.io/ipfs/QmdFgDWRTB4L3Ks87615kSc6yQStXxRTfp1hmYUfDGTeBe/index.js\r\n\r\nThen tried to use DHT:\r\n\r\n- `ipfs.dht.findprovs('QmXXtHtDwXFbCTzMDjacZxid6CCNY4m5oM6MgBhyPVT3Tr')`\r\n- `ipfs._libp2pNode.contentRouting.findProviders('QmXXtHtDwXFbCTzMDjacZxid6CCNY4m5oM6MgBhyPVT3Tr', 5000, (...args) => console.log('done:', ...args));`\r\n\r\nSame result: the \"No content routers available\" error.\r\n\r\nDump of the console logs:\r\n\r\n```\r\nipfs.dht.findprovs('QmXXtHtDwXFbCTzMDjacZxid6CCNY4m5oM6MgBhyPVT3Tr')\r\nPromise {<rejected>: Error: No content routers available\r\n    at Object.findProviders (https://ipfs.io/ipfs/QmdFgDWRTB4L3K…}\r\ncontent-routing.js:28 Uncaught (in promise) Error: No content routers available\r\n    at Object.findProviders (content-routing.js:28)\r\n    at Function.findprovs.promisify (dht.js:95)\r\n    at index.js:41\r\n    at new Promise (<anonymous>)\r\n    at Object.findprovs (index.js:35)\r\n    at <anonymous>:1:10\r\nfindProviders @ content-routing.js:28\r\nfindprovs.promisify @ dht.js:95\r\n(anonymous) @ index.js:41\r\n(anonymous) @ index.js:35\r\n(anonymous) @ VM1356:1\r\n6crypto.js:80 Uncaught Error: dialed to the wrong peer, Ids do not match\r\n    at PeerId.createFromPubKey (crypto.js:80)\r\n    at pubKey.hash (index.js:201)\r\n    at Multihashing.Multihashing.digest (index.js:33)\r\n    at index.js:15\r\n    at run (setImmediate.js:40)\r\n    at runIfPresent (setImmediate.js:69)\r\n    at onGlobalMessage (setImmediate.js:109)\r\nPeerId.createFromPubKey @ crypto.js:80\r\npubKey.hash @ index.js:201\r\nMultihashing.Multihashing.digest @ index.js:33\r\n(anonymous) @ index.js:15\r\nrun @ setImmediate.js:40\r\nrunIfPresent @ setImmediate.js:69\r\nonGlobalMessage @ setImmediate.js:109\r\npostMessage (async)\r\nregisterImmediate @ setImmediate.js:120\r\nsetImmediate @ setImmediate.js:27\r\n(anonymous) @ index.js:14\r\nPromise.then (async)\r\nnodeify @ index.js:13\r\n(anonymous) @ crypto-sha1-2-browser.js:37\r\nsha2256 @ crypto-sha1-2-browser.js:49\r\nIpfs../node_modules/peer-id/node_modules/multihashing-async/src/index.js.Multihashing.digest @ index.js:84\r\nMultihashing @ index.js:28\r\nhash @ rsa-class.js:43\r\nIpfs../node_modules/peer-id/src/index.js.exports.createFromPubKey @ index.js:196\r\nIpfs../node_modules/libp2p-secio/src/handshake/crypto.js.exports.identify @ crypto.js:72\r\nwaterfall @ propose.js:24\r\nnextTask @ waterfall.js:16\r\nnext @ waterfall.js:23\r\n(anonymous) @ onlyOnce.js:12\r\nonComplete @ decode.js:49\r\nreader.read @ decode.js:125\r\ndrain @ index.js:39\r\nmore @ index.js:55\r\n(anonymous) @ index.js:66\r\n(anonymous) @ index.js:20\r\n(anonymous) @ map.js:19\r\n(anonymous) @ index.js:114\r\n(anonymous) @ index.js:114\r\n(anonymous) @ map.js:19\r\n(anonymous) @ source.js:31\r\nipfs._libp2pNode.contentRouting.findProviders('QmXXtHtDwXFbCTzMDjacZxid6CCNY4m5oM6MgBhyPVT3Tr', 5000, () => {});\r\nundefined\r\n2crypto.js:80 Uncaught Error: dialed to the wrong peer, Ids do not match\r\n    at PeerId.createFromPubKey (crypto.js:80)\r\n    at pubKey.hash (index.js:201)\r\n    at Multihashing.Multihashing.digest (index.js:33)\r\n    at index.js:15\r\n    at run (setImmediate.js:40)\r\n    at runIfPresent (setImmediate.js:69)\r\n    at onGlobalMessage (setImmediate.js:109)\r\nPeerId.createFromPubKey @ crypto.js:80\r\npubKey.hash @ index.js:201\r\nMultihashing.Multihashing.digest @ index.js:33\r\n(anonymous) @ index.js:15\r\nrun @ setImmediate.js:40\r\nrunIfPresent @ setImmediate.js:69\r\nonGlobalMessage @ setImmediate.js:109\r\npostMessage (async)\r\nregisterImmediate @ setImmediate.js:120\r\nsetImmediate @ setImmediate.js:27\r\n(anonymous) @ index.js:14\r\nPromise.then (async)\r\nnodeify @ index.js:13\r\n(anonymous) @ crypto-sha1-2-browser.js:37\r\nsha2256 @ crypto-sha1-2-browser.js:49\r\nIpfs../node_modules/peer-id/node_modules/multihashing-async/src/index.js.Multihashing.digest @ index.js:84\r\nMultihashing @ index.js:28\r\nhash @ rsa-class.js:43\r\nIpfs../node_modules/peer-id/src/index.js.exports.createFromPubKey @ index.js:196\r\nIpfs../node_modules/libp2p-secio/src/handshake/crypto.js.exports.identify @ crypto.js:72\r\nwaterfall @ propose.js:24\r\nnextTask @ waterfall.js:16\r\nnext @ waterfall.js:23\r\n(anonymous) @ onlyOnce.js:12\r\nonComplete @ decode.js:49\r\nreader.read @ decode.js:125\r\ndrain @ index.js:39\r\nmore @ index.js:55\r\n(anonymous) @ index.js:66\r\n(anonymous) @ index.js:20\r\n(anonymous) @ map.js:19\r\n(anonymous) @ index.js:114\r\n(anonymous) @ index.js:114\r\n(anonymous) @ map.js:19\r\n(anonymous) @ source.js:31\r\nipfs._libp2pNode.contentRouting.findProviders('QmXXtHtDwXFbCTzMDjacZxid6CCNY4m5oM6MgBhyPVT3Tr', 5000, (...args) => console.log('done:', ...args));\r\nVM1532:1 done: Error: No content routers available\r\n    at Object.findProviders (content-routing.js:28)\r\n    at <anonymous>:1:33\r\n```"},"comment":{"url":"https://api.github.com/repos/libp2p/js-libp2p/issues/comments/438998798","html_url":"https://github.com/libp2p/js-libp2p/issues/275#issuecomment-438998798","issue_url":"https://api.github.com/repos/libp2p/js-libp2p/issues/275","id":438998798,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODk5ODc5OA==","user":{"login":"jacobheun","id":639834,"node_id":"MDQ6VXNlcjYzOTgzNA==","avatar_url":"https://avatars3.githubusercontent.com/u/639834?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobheun","html_url":"https://github.com/jacobheun","followers_url":"https://api.github.com/users/jacobheun/followers","following_url":"https://api.github.com/users/jacobheun/following{/other_user}","gists_url":"https://api.github.com/users/jacobheun/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobheun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobheun/subscriptions","organizations_url":"https://api.github.com/users/jacobheun/orgs","repos_url":"https://api.github.com/users/jacobheun/repos","events_url":"https://api.github.com/users/jacobheun/events{/privacy}","received_events_url":"https://api.github.com/users/jacobheun/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T10:50:00Z","updated_at":"2018-11-15T10:50:00Z","author_association":"CONTRIBUTOR","body":"> Why is it so resource intensive, though?\r\nThe DHT is constantly working on behalf of the network, not just your node. You're providing information about the network to other peers, which can include creating new connections. Our goal is to make this as efficient as possible. Nodes in restricted environments such as mobile browsers or IoT devices, probably shouldn't run a DHT.  \r\n\r\nDelegated routing gives us the ability to use custom peer and content routers, that know how to talk to other DHTs via their exposed http apis. For IPFS we've created two such routers: https://github.com/libp2p/js-libp2p-delegated-content-routing and https://github.com/libp2p/js-libp2p-delegated-peer-routing. Once the go-ipfs gateway nodes release their api support, these can query the apis directly. They will also fetch your content from you if you register as a provider. This can save limited nodes a lot of resources.\r\n\r\n> Not needing to run DHT seems to contradict the effort to implement it.\r\n\r\nNot *needing* a DHT and not being able to run a DHT are different. This becomes valuable when we start looking at self healing / dynamic networks. You may not run a DHT when you don't need to, but could potentially turn it on if the state of the network warrants turning that on."}}
{"actor":{"display_login":"jacobheun"}}