0

我正在使用以下代码订阅 Tendermint 的事件(如新交易);

query := "tm.event='Tx'"
txs, err := client.Subscribe(ctx, "some-consumer", query)

或从终端作为;

wscat --connect ws://0.0.0.0:26657/websocket
> { "jsonrpc": "2.0", "method": "subscribe", "params": ["tm.event='Tx'"], "id": 1 }

我在事件发生时得到事件,但我怎样才能得到历史事件,例如从特定块开始?

4

1 回答 1

0

I think you should use the HTTP from github.com/tendermint/tendermint/rpc/client/http. Then you can make requests like Block(context, height), Tx(context, hash, prove), and many others!

于 2021-02-22T01:08:40.513 回答