Comments (3)
The conversion of /p2p
to /ipfs
only applies to the string representation, the codecs are equivalent. Over the wire representation won't matter, as any other nodes on the network should know the codec.
We will be migrating over to /p2p
by default soon, libp2p/libp2p#79, so the string representation will always be /p2p
as we migrate away from using /ipfs
.
In regards to the errors you're seeing, those lead me to believe that the node being dialed isn't correct. Pierre may be able to help more in terms of joining the substrate network as I am not familiar with doing that currently.
Error: dialed to the wrong peer, Ids do not match
This indicates that you were able to connect to the node, but SECIO failed because the node you actually connected to is not QmPiGU1jwL9UDw2FMyMQFr9FdpF9hURKxkfy6PWw6aLsur
.
Error: No available transports to dial peer
This means no transports are dialing, so TCP is likely failing since that's a TCP address. I turned on debugging for my local node to check the errors and TCP is getting an ECONNREFUSED
error. So the boot nodes may not be available.
from js-multiaddr.
Error: dialed to the wrong peer, Ids do not match
I faced similar issue when connecting Rust & JS via libp2p. The problem is that peer-id JS computes peer id from public key like this:
const computeDigest = (pubKey, cb) => {
if (pubKey.bytes.length <= 42) {
const digest = mh.encode(pubKey.bytes, 'identity') // This get's executed
cb(null, digest)
} else {
pubKey.hash((err, digest) => {
cb(err, digest)
})
}
}
Result is that in JS mh.encode(pubKey.bytes, 'identity')
results in addresses of format 12D3KooWSwNXzEeGjgwEocRJBzbdoDqxbz3LdrwgSuKmKeGvbM4G
, while in Rust PeerId for the same public key looks like QmTESkr2vWDCKqiHVsyvf4iRQCBgvNDqBJ6P3yTTDb6haw
.
Error then happens in libp2p-secio/src/handshake/crypto.js
in identify
function in JS:
if (state.id.remote.toB58String() !== remoteId.toB58String()) { // <-- remoteId here is computed from public key in 12D3 format, while state.id.remote is in Qm format
return callback(new Error('dialed to the wrong peer, Ids do not match'))
}
Currently, I don't have a solution for that except to patch either JS or Rust.
from js-multiaddr.
This issue is very stale - the modules referenced have been updated several times, some such as secio aren't used any more.
Please open a new issue if this is still a problem.
from js-multiaddr.
Related Issues (20)
- Add a static method `isValid` HOT 2
- Adding types to DefinitelyTyped HOT 3
- Export Multiaddr to allow type checking HOT 2
- Export types HOT 2
- DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated HOT 1
- Current ipv6 implementation doesn't account for interface HOT 3
- Add tls to protocoltables
- Compile problem when using latest multiaddr in a browser app HOT 1
- No documentation for getPeerId() HOT 3
- Replace Multiaddr class with an interface HOT 1
- Outdated README.md HOT 1
- The automated release is failing 🚨
- Transitive dependency on `node-fetch` HOT 1
- Add /webrtc and /certhash HOT 2
- [ERR_MODULE_NOT_FOUND]: Cannot find package 'dns' imported from /Users/javaspeak/workspace3/symbiont/permanent_node/server/node_modules/@multiformats/multiaddr/dist/src/resolvers/dns.js HOT 1
- Drop is-ip dependency with alternative IP parsing fn HOT 2
- Reference to non-existent js file from ts HOT 4
- bug: new kubo/ipfs/libp2p protocols break JS ecosystem HOT 2
- getPeerId can return an unexpected peer id HOT 1
- Respect `.../ipfs/...` when it is passed? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-multiaddr.