mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-30 19:55:42 +00:00
rpc: implement the ADR 075 /events method (#7965)
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
This commit is contained in:
@@ -2,7 +2,10 @@ package proxy
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/internal/eventlog/cursor"
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
lrpc "github.com/tendermint/tendermint/light/rpc"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
@@ -27,6 +30,17 @@ func (p proxyService) GetConsensusState(ctx context.Context) (*coretypes.ResultC
|
||||
return p.ConsensusState(ctx)
|
||||
}
|
||||
|
||||
// TODO(creachadair): Remove this once the RPC clients support the new method.
|
||||
// This is just a placeholder to let things build during development.
|
||||
func (proxyService) Events(ctx context.Context,
|
||||
filter *coretypes.EventFilter,
|
||||
maxItems int,
|
||||
before, after cursor.Cursor,
|
||||
waitTime time.Duration,
|
||||
) (*coretypes.ResultEvents, error) {
|
||||
return nil, errors.New("the /events method is not implemented")
|
||||
}
|
||||
|
||||
func (p proxyService) Subscribe(ctx context.Context, query string) (*coretypes.ResultSubscribe, error) {
|
||||
return p.SubscribeWS(ctx, query)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user