eth-monitor

Monitor and cache ethereum transactions with match filters
git clone git://git.defalsify.org/eth-monitor.git
Log | Files | Refs | README | LICENSE

commit fe9b657b36462eef37bb39002a3bee943b074a5e
parent 2f3e652ca3da6a8fd2023244e5f0f139ccbfd103
Author: lash <dev@holbrook.no>
Date:   Fri, 14 Oct 2022 15:41:58 +0000

Handle filters and renderers from args in settings

Diffstat:
MCHANGELOG | 3+++
Meth_monitor/settings.py | 12+++++++++++-
Mrequirements.txt | 4++--
Msetup.cfg | 2+-
4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,6 @@ +- 0.5.1 + * Remove useless need to add session dir for mem backend + * Reenable renderers and filters specified through args in new settings setup - 0.5.0 * Implement on chainlib 0.3.0 - 0.4.8 diff --git a/eth_monitor/settings.py b/eth_monitor/settings.py @@ -315,6 +315,15 @@ def process_out_filter(settings, config): return settings +def process_arg_filter(settings, config): + store = settings.get('SYNC_STORE') + for k in config.get('ETHMONITOR_FILTER'): + m = importlib.import_module(k) + fltr = m.Filter() + store.register(fltr) + return settings + + def process_filter(settings, config): settings.set('FILTER', []) settings = process_renderer(settings, config) @@ -322,12 +331,13 @@ def process_filter(settings, config): settings = process_cache_filter(settings, config) settings = process_tx_filter(settings, config) settings = process_out_filter(settings, config) + settings = process_arg_filter(settings, config) return settings def process_renderer(settings, config): renderers_mods = [] - for renderer in list_from_prefix(config, 'renderer'): + for renderer in config.get('ETHMONITOR_RENDERER'): m = importlib.import_module(renderer) renderers_mods.append(m) logg.info('using renderer module {}'.format(renderer)) diff --git a/requirements.txt b/requirements.txt @@ -2,5 +2,5 @@ chainlib-eth~=0.3.0 chainlib~=0.3.0 chainsyncer~=0.5.0 leveldir~=0.3.0 -eth-cache~=0.1.5 -confini~=0.6.2 +eth-cache~=0.1.6 +confini~=0.6.3 diff --git a/setup.cfg b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-monitor -version = 0.5.0 +version = 0.5.1 description = Monitor and cache transactions using match filters author = Louis Holbrook author_email = dev@holbrook.no