Getting invalid version number error when connecting to peer

269 views Asked by At

I'm getting an error when trying to connect to a node. The IPFS instance is created in a class, with a JavaScript factory function. The connect function looks like this:

async connectToPeer(multiaddr, protocol = "/p2p-circuit/ipfs/") {
    try {
        console.log("swarm.connect: ", protocol + multiaddr);
        await this.node.swarm.connect(protocol + multiaddr);
    } catch (e) {
        throw(e);
    }
}

This will be passed to swarm.connet: /p2p-circuit/ipfs/QmWxWkrCcgNBG2uf1HSVAwb9RzcSYYC2d6CRsfJcqrz2FX

This is the error I get:

(node:24449) UnhandledPromiseRejectionWarning: AggregateError: 
    Error: Invalid version, must be a number equal to 1 or 0
        at Function.validateCID (/home/user/orbit-playground/music-app-no-react/node_modules/cids/src/index.js:312:13)
        at new CID (/home/user/orbit-playground/music-app-no-react/node_modules/cids/src/index.js:151:9)
        at new CID (/home/user/orbit-playground/music-app-no-react/node_modules/class-is/index.js:15:17)
        at Function.exports.createFromCID (/home/user/orbit-playground/music-app-no-react/node_modules/peer-id/src/index.js:248:32)
        at ClassIsWrapper.dial (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/circuit/index.js:107:30)
        at TransportManager.dial (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/transport-manager.js:89:30)
        at DialRequest.dialAction (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/dialer/index.js:149:36)
        at pAny.addrs.map (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/dialer/dial-request.js:58:29)
    at maybeSettle (/home/user/orbit-playground/music-app-no-react/node_modules/p-some/index.js:31:11)
    at /home/user/orbit-playground/music-app-no-react/node_modules/p-some/index.js:69:23

It is able to connect to peers, if I list connected peers the list is not empty.

0

There are 0 answers