4
0
mirror of git://holbrook.no/eth-monitor.git synced 2024-11-26 21:36:45 +01:00

Handle filters and renderers from args in settings

This commit is contained in:
lash 2022-10-14 15:41:58 +00:00
parent 2f3e652ca3
commit fe9b657b36
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 17 additions and 4 deletions

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -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