diff --git a/api/api_gateway.go b/api/api_gateway.go index e71a8b712..ceadea9a7 100644 --- a/api/api_gateway.go +++ b/api/api_gateway.go @@ -132,4 +132,5 @@ type Gateway interface { GetActorEvents(ctx context.Context, filter *types.ActorEventFilter) ([]*types.ActorEvent, error) SubscribeActorEvents(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error) + ChainGetEvents(context.Context, cid.Cid) ([]types.Event, error) } diff --git a/api/proxy_gen.go b/api/proxy_gen.go index 5bbd32aa9..6686b3b87 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -655,6 +655,8 @@ type GatewayMethods struct { ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) `` + ChainGetEvents func(p0 context.Context, p1 cid.Cid) ([]types.Event, error) `` + ChainGetGenesis func(p0 context.Context) (*types.TipSet, error) `` ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) `` @@ -4286,6 +4288,17 @@ func (s *GatewayStub) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*Bl return nil, ErrNotSupported } +func (s *GatewayStruct) ChainGetEvents(p0 context.Context, p1 cid.Cid) ([]types.Event, error) { + if s.Internal.ChainGetEvents == nil { + return *new([]types.Event), ErrNotSupported + } + return s.Internal.ChainGetEvents(p0, p1) +} + +func (s *GatewayStub) ChainGetEvents(p0 context.Context, p1 cid.Cid) ([]types.Event, error) { + return *new([]types.Event), ErrNotSupported +} + func (s *GatewayStruct) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) { if s.Internal.ChainGetGenesis == nil { return nil, ErrNotSupported diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index b7dab0ad5..9b2c70b91 100644 Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/gateway.json.gz b/build/openrpc/gateway.json.gz index a5239bb5c..fa2f1c26f 100644 Binary files a/build/openrpc/gateway.json.gz and b/build/openrpc/gateway.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index aa1a9f6e8..db7e3c28a 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index bdc0dec0f..048e9daec 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/gateway/node.go b/gateway/node.go index f3ecb7640..814d9c8cb 100644 --- a/gateway/node.go +++ b/gateway/node.go @@ -149,6 +149,7 @@ type TargetAPI interface { GetActorEvents(ctx context.Context, filter *types.ActorEventFilter) ([]*types.ActorEvent, error) SubscribeActorEvents(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error) + ChainGetEvents(ctx context.Context, eventsRoot cid.Cid) ([]types.Event, error) } var _ TargetAPI = *new(api.FullNode) // gateway depends on latest diff --git a/gateway/proxy_fil.go b/gateway/proxy_fil.go index e7ad3bdb4..a4f919dce 100644 --- a/gateway/proxy_fil.go +++ b/gateway/proxy_fil.go @@ -451,6 +451,13 @@ func (gw *Node) SubscribeActorEvents(ctx context.Context, filter *types.ActorEve return gw.target.SubscribeActorEvents(ctx, filter) } +func (gw *Node) ChainGetEvents(ctx context.Context, eventsRoot cid.Cid) ([]types.Event, error) { + if err := gw.limit(ctx, chainRateLimitTokens); err != nil { + return nil, err + } + return gw.target.ChainGetEvents(ctx, eventsRoot) +} + func (gw *Node) StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error) { if err := gw.limit(ctx, stateRateLimitTokens); err != nil { return nil, err