4
0
mirror of git://holbrook.no/eth-monitor.git synced 2024-11-21 20:06:46 +01:00

Implement and expose dialect filters for chain interface

This commit is contained in:
lash 2023-08-13 17:58:18 +01:00
parent d36b3ed673
commit 10e16dcb00
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
5 changed files with 11 additions and 15 deletions

View File

@ -1,3 +1,6 @@
- 0.8.5
* Instantiate constructor for chain interface superclass
* Remove unused settings transform method for sync interface
- 0.8.4 - 0.8.4
* Update man pages with rpc batch limit setting * Update man pages with rpc batch limit setting
- 0.8.3 - 0.8.3

View File

@ -8,15 +8,19 @@ from chainlib.eth.block import (
from chainlib.eth.tx import ( from chainlib.eth.tx import (
receipt, receipt,
Tx, Tx,
transaction,
) )
class EthChainInterface(ChainInterface): class EthChainInterface(ChainInterface):
def __init__(self, dialect_filter=None, batch_limit=1): def __init__(self, dialect_filter=None, batch_limit=1):
super(EthChainInterface, self).__init__(dialect_filter=dialect_filter, batch_limit=batch_limit)
self.batch_limit = batch_limit self.batch_limit = batch_limit
self._block_latest = block_latest self._block_latest = block_latest
self._block_by_number = block_by_number self._block_by_number = block_by_number
self._block_from_src = Block.from_src self._block_from_src = Block.from_src
self._tx_from_src = Tx.from_src
self._tx_receipt = receipt self._tx_receipt = receipt
self._src_normalize = Tx.src_normalize self._src_normalize = Tx.src_normalize
self._dialect_filter = dialect_filter self._dialect_filter = dialect_filter
self._tx_by_hash = transaction

View File

@ -356,22 +356,11 @@ def process_cache_rpc(settings, config):
return settings return settings
def process_sync_interface(settings, config):
ifc = EthChainInterface(dialect=settings.get('RPC_DIALECT_FILTER'))
settings.set('SYNCER_INTERFACE', ifc)
return settings
def process_sync(settings, config): def process_sync(settings, config):
dialect_filter = settings.get('RPC_DIALECT_FILTER') dialect_filter = settings.get('RPC_DIALECT_FILTER')
settings.set('SYNCER_INTERFACE', EthChainInterface(dialect_filter=dialect_filter, batch_limit=settings.get('RPC_BATCH_LIMIT'))) settings.set('SYNCER_INTERFACE', EthChainInterface(dialect_filter=dialect_filter, batch_limit=settings.get('RPC_BATCH_LIMIT')))
settings = process_sync_range(settings, config) settings = process_sync_range(settings, config)
return settings return settings
#def process_sync(settings, config):
# settings = process_sync_interface(settings, config)
# settings = process_sync_backend(settings, config)
# settings = process_sync_range(settings, config)
# return settings
def process_cache(settings, config): def process_cache(settings, config):

View File

@ -1,6 +1,6 @@
chainlib-eth~=0.5.0 chainlib-eth~=0.5.1
chainlib~=0.5.1 chainlib~=0.5.2
chainsyncer~=0.8.2 chainsyncer~=0.8.3
leveldir~=0.3.0 leveldir~=0.3.0
eth-cache~=0.3.0 eth-cache~=0.3.0
confini~=0.6.3 confini~=0.6.3

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = eth-monitor name = eth-monitor
version = 0.8.4 version = 0.8.5
description = Monitor and cache transactions using match filters description = Monitor and cache transactions using match filters
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no