From d2027accdc6d15ef6fc0b5f0639a06c72ab54892 Mon Sep 17 00:00:00 2001 From: Jakub Freebit <49676311+jakub-freebit@users.noreply.github.com> Date: Fri, 2 Sep 2022 23:53:58 +0900 Subject: [PATCH] mobile: register filter APIs (#25642) This fixes a regression introduced in PR #25459. --- mobile/geth.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mobile/geth.go b/mobile/geth.go index 204e29c8be..7dee93b77c 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethstats" "github.com/ethereum/go-ethereum/internal/debug" @@ -35,6 +36,7 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) // NodeConfig represents the collection of configuration values to fine tune the Geth @@ -200,6 +202,14 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) { rawStack.Close() return nil, fmt.Errorf("ethereum init: %v", err) } + // Register log filter RPC API. + filterSystem := filters.NewFilterSystem(lesBackend.ApiBackend, filters.Config{ + LogCacheSize: ethConf.FilterLogCacheSize, + }) + rawStack.RegisterAPIs([]rpc.API{{ + Namespace: "eth", + Service: filters.NewFilterAPI(filterSystem, true), + }}) // If netstats reporting is requested, do it if config.EthereumNetStats != "" { if err := ethstats.New(rawStack, lesBackend.ApiBackend, lesBackend.Engine(), config.EthereumNetStats); err != nil {