geth 事件 newPendingTransactions 没有发生

geth event newPendingTransactions does not occur

我有 运行 geth 下一个命令:

$ geth --testnet --networkid 3 --verbosity 3 --syncmode light --ipcdisable --ws --wsapi "db,eth,net,web3,personal,txpool,admin,miner" --wsorigins '*'

在第二个控制台中,我使用 wscat 连接到 geth jsonrpc。

正在订阅一个事件"newHeads"工作正常:

$ wscat -c ws://localhost:8546
> {"id": 2, "method": "eth_subscribe", "params": ["newHeads"]}
< {"jsonrpc":"2.0","id":2,"result":"0x660135584e36a9edb0c55f89c389848"}
< {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x660135584e36a9edb0c55f89c389848","result":{"parentHash":"0xe7d0...","hash":"0x1dcc...

但是订阅事件"newPendingTransactions" 不起作用:

$ wscat -c ws://localhost:8546
> {"id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}
< {"jsonrpc":"2.0","id":1,"result":"0x511b3274aa5dec44bb79d178c238e7fe"}

仅此而已:我没有收到新的待处理交易。

订阅 ropsten.infura.io 上的事件 "newPendingTransactions" 工作正常:

$ wscat -c wss://ropsten.infura.io/ws
> {"id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}
< {"jsonrpc":"2.0","id":1,"result":"0x18fda7bf20ee9c5b5f1f08edf5c3e482"}
< {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x18fda7bf20ee9c5b5f1f08edf5c3e482","result":"0xc1e00266ab9f2c512d6c1967c300fc00381586e868611b7dff6fd94f230dd707"}}

信息:

$ geth version
Geth
Version: 1.8.22-stable
Git Commit: 7fa3509e2eaf1a4ebc12344590e5699406690f15
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10.4
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.10

我有两个问题:

1.为什么订阅事件 "newPendingTransactions" 不起作用?

2。我做错了什么?

问题是我没有等到同步结束

我从头开始(这次我使用了 Rinkeby 网络):

geth --rinkeby --verbosity 3 --syncmode fast --ipcdisable --ws --wsapi "db,eth,net,web3,personal,txpool,admin" --wsorigins '*'

对于 Rinkeby 网络,这花了大约 20 个小时,区块链的大小在我的 SSD 上大约为 25 GB。

现在订阅 newPendingTransactions 事件 工作正常

谢谢大家!