chainsyncer

Blockchain syncer driver
Log | Files | Refs | LICENSE

commit d9196f5ff5427f7f666927f4b2b693c757991f72
parent 70873e4aecae393be416510b91585d8c2548b0db
Author: nolash <dev@holbrook.no>
Date:   Wed, 24 Feb 2021 12:47:18 +0100

Bump version

Diffstat:
Mchainsyncer/driver.py | 8++++++--
Mrequirements.txt | 2+-
Msetup.cfg | 2+-
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/chainsyncer/driver.py b/chainsyncer/driver.py @@ -5,6 +5,7 @@ import time import signal # external imports +import sqlalchemy from chainlib.eth.block import ( block_by_number, Block, @@ -92,6 +93,10 @@ class BlockPollSyncer(Syncer): return self.backend.get() except NoBlockForYou as e: break +# TODO: To properly handle this, ensure that previous request is rolled back +# except sqlalchemy.exc.OperationalError as e: +# logg.error('database error: {}'.format(e)) +# break last_block = block.number self.process(conn, block) start_tx = 0 @@ -116,6 +121,7 @@ class HeadSyncer(BlockPollSyncer): self.backend.set(block.number, i) self.filter.apply(conn, block, tx) except IndexError as e: + logg.debug('index error syncer rcpt get {}'.format(e)) self.backend.set(block.number + 1, 0) break i += 1 @@ -130,7 +136,6 @@ class HeadSyncer(BlockPollSyncer): if r == None: raise NoBlockForYou() b = Block(r) - logg.debug('get {}'.format(b)) return b @@ -161,7 +166,6 @@ class HistorySyncer(HeadSyncer): if r == None: raise NoBlockForYou() b = Block(r) - logg.debug('get {}'.format(b)) return b diff --git a/requirements.txt b/requirements.txt @@ -3,4 +3,4 @@ SQLAlchemy==1.3.20 confini~=0.3.6b2 semver==2.13.0 hexathon~=0.0.1a3 -chainlib~=0.0.1a17 +chainlib~=0.0.1a18 diff --git a/setup.cfg b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = chainsyncer -version = 0.0.1a17 +version = 0.0.1a18 description = Generic blockchain syncer driver author = Louis Holbrook author_email = dev@holbrook.no