You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux ubuntu 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem:
Severity: High
Description:
"What you did": I created two nodes, one node executed provide and the other node executed findProvider, and both nodes used the same CID.
"What happened": The operation failed.
" What you expected to happen": The operation was successfully performed
Steps to reproduce the error:
import{createLibp2p}from"libp2p";import{webSockets}from"@libp2p/websockets";import*asfiltersfrom"@libp2p/websockets/filters";import{bootstrap}from"@libp2p/bootstrap";import{kadDHT}from"@libp2p/kad-dht";import{circuitRelayTransport}from"@libp2p/circuit-relay-v2";import{mplex}from'@libp2p/mplex';import{identify}from"@libp2p/identify";import{yamux}from"@chainsafe/libp2p-yamux";import{noise}from"@chainsafe/libp2p-noise";import{CID}from"multiformats/cid";import{sha256}from"multiformats/hashes/sha2";import*asrawfrom"multiformats/codecs/raw";constcreateNode=async()=>{returnawaitcreateLibp2p({transports: [webSockets({filter: filters.all}),circuitRelayTransport({discoverRelays: 10,}),],streamMuxers: [yamux(),mplex()],connectionEncryption: [noise()],peerDiscovery: [bootstrap({list: ["/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN","/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa","/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb","/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt","/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ","/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ","/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ","/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN","/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",],}),],services: {identify: identify(),dht: kadDHT({clientMode: true,maxInboundStreams: 100,maxOutboundStreams: 100,querySelfInterval: 10,}),}})}letnode1=awaitcreateNode();letnode2=awaitcreateNode();awaitnode1.start();awaitnode2.start();console.log("node1 id",node1.peerId);console.log("node2 id",node2.peerId);awaitnode1.services.dht.refreshRoutingTable();awaitnode2.services.dht.refreshRoutingTable();constaddr="js-libp2p-dht-test";constcid=CID.create(1,raw.code,awaitsha256.digest(newTextEncoder().encode(addr)));awaitnode2.contentRouting.provide(cid);while(true){try{forawait(constproviderofnode1.contentRouting.findProviders(cid,{useNetwork:true,useCache:true,})){console.log(provider)}console.log("Waiting for the next round of query...")awaitnewPromise(resolve=>setTimeout(resolve,5000));}catch(error){console.error("Error occurred while finding provider:",error);awaitnewPromise(resolve=>setTimeout(resolve,5000));}}
Output:
root@ubuntu:~/jsp2p# node client.js
node1 id PeerId(12D3KooWFXcg3a8Hi6mEpeqaH2tTrWg44DbPyHGRCMrGDqfAFSrt)
node2 id PeerId(12D3KooWSNV1Cksmn4YTzz7kfm1FdRMXSX2mBV162PRAuccnPQ92)
Waiting for the next round of query...
Waiting for the next round of query...
Waiting for the next round of query...
Waiting for the next round of query...
Waiting for the next round of query...
Waiting for the next round of query...
...
The text was updated successfully, but these errors were encountered:
Severity: High
Description:
Steps to reproduce the error:
Output:
The text was updated successfully, but these errors were encountered: