Skip to content

Enhancements to rpc events #287

@ethanfrey

Description

@ethanfrey

As I am working with the jsonrpc interface while developing a client, I came across some enhancement wishes, which I believe would be generally useful. I am also willing to work on a pull request for them (but will need @ebuchman for review and cleanup).

First, simple enough, on the tx event, can we add the block height of the block in which it is / will be committed. It is great to receive this event, but if I want to double-check the node (a minority may be Byzantine), I will want to see the block that contains it. I think the block height is the easiest way to pass the info so I can query the block myself if needed.

Second, there is both rpc and pub-sub on the tendermint nodes. However, I only have a simple request-response interface to the tmsp app (add tx or make query). It would be super cool to also allow the client to subscribe to events in the app. Example use-case, I query for my account balance and listen to any events that change it. Only the app know this. Otherwise, I must listen to all tx and parse them locally.

I have used couchbase before, which has some nice ideas about syncing data. They use channel names for this. Every tx may define a list (array) of strings, which are channel names that the update gets pushed to. In append_tx, if the result is okay, also send txevents to all channels returned from tmsp app, prefixed by tmsp: to avoid conflicts. Like "tmsp:my_acct_id". This is generic infrastructure to support pub-sub in any tmsp app.

This second suggestion would add a field ([] string) to the tmsp result, but since the nil value has no effect, it should be backwards compatible.

Please let me know your thoughts on these changes and a thumbs up or down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:rpcComponent: JSON RPC, gRPC

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions