1

我正在尝试在 geth 控制台上使用 web3 运行一个简单的耳语示例:

var f = web3.shh.filter({topics: ["qwerty"]})
f.get()
web3.shh.getMessages("qwerty")
web3.shh.post({topics: ["qwerty"], payload: "0x847a786376", ttl: "0x1E", workToProve: "0x9" })

但我收到这些错误:

> f.get()
Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.
    at web3.js:3602:23
    at <anonymous>:1:1

> web3.shh.getMessages("qwerty")
TypeError: 'getMessages' is not a function
    at <anonymous>:1:1

> web3.shh.post({topics: ["qwerty"], payload: "0x847a786376", ttl: "0x1E", workToProve: "0x9" })
The method shh_post does not exist/is not available
    at web3.js:3119:20
    at web3.js:6023:15
    at web3.js:4995:36
    at <anonymous>:1:1

文档是不是最新的,还是不能与我的 geth 版本一起运行(尝试过 1.4.5 和 1.5)?还会收到“不存在/不可用”错误web3.shh.newIdentity()

4

0 回答 0