连接到对等方时出现无效的版本号错误

问题描述

尝试连接到节点时出现错误。 IPFS实例是在具有JavaScript工厂功能的类中创建的。连接函数如下所示:

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);
    }
}

这将传递到swarm.connet:/p2p-circuit/ipfs/QmWxWkrCcgNBG2uf1HSVAwb9RzcSYYC2d6CRsfJcqrz2FX

这是我得到的错误

(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

它能够连接到同级,如果我列出了已连接的同级,则列表不为空。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...