kaspa连接rpc用例错误分析
作者:未知 来源:kastop.com 发布时间:2024年09月02日 点击数:
If I run a local node like:
./kaspad --testnet \ --utxoindex \ --ram-scale=0.8 \ --appdir "./tn10" \ --rpclisten="0.0.0.0:16210" \ --listen="0.0.0.0:16211" \ --rpclisten-borsh="0.0.0.0:17210" \ --maxinpeers=20 &
Can I just connect it locally with WASM like the following?
const RPC = new RpcClient({ resolver: new Resolver({ urls: ["ws://127.0.0.1:16210"]}), encoding: Encoding.Borsh, networkId: network });
For some reason it's not working
错误分析:
1、The RpcClient argument is “url” not “resolver”. Resolver is a different protocol. So when connecting to a local node, specify url : “ws://127.0.0.1:17210” and omit the resolver argument.
2、why are you targeting your Rpcclient borsch on 16210 while you activated the borsh listening on 17210 (on the node)?
3、Wasm is approaching the borsh rpc endpoint, so you need the 17210 port
4、参考代码:
const { RpcClient } = kaspa; const rpc = new RpcClient({ url: "127.0.0.1", networkId:"testnet-10", }) await rpc.connect()
感动 | 同情 | 无聊 | 愤怒 | 搞笑 | 难过 | 高兴 | 路过 |
- 上一篇:获取免费kaspa测试地址
- 下一篇:矿霸resistant分析
相关文章
-
没有相关内容