commit 2f22d6df1a001b23f5044a3516c00854aedd6f38
parent 1ea196d04b81a52b330abd8cc63cc4560330867b
Author: nolash <dev@holbrook.no>
Date: Fri, 12 Feb 2021 09:12:03 +0100
Improve terminal output
Diffstat:
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/chainsyncer/driver.py b/chainsyncer/driver.py
@@ -43,18 +43,21 @@ class MinedSyncer(Syncer):
def loop(self, interval, getter):
+ g = self.backend.get()
+ last_tx = g[1]
+ last_block = g[0]
+ self.progress_callback('loop started', last_block, last_tx)
while self.running and Syncer.running_global:
- g = self.backend.get()
- start_tx = g[1]
- self.progress_callback('loop awakened', g[0], start_tx)
while True:
block = self.get(getter)
if block == None:
break
+ last_block = block.number
self.process(getter, block)
- self.progress_callback('process block {}'.format(self.backend.get()), block.number, start_tx)
start_tx = 0
+ self.progress_callback('processed block {}'.format(self.backend.get()), last_block, last_tx)
time.sleep(self.yield_delay)
+ #self.progress_callback('loop ended', last_block + 1, last_tx)
time.sleep(interval)
diff --git a/requirements.txt b/requirements.txt
@@ -5,4 +5,4 @@ eth-tester==0.5.0b3
confini==0.3.6b2
semver==2.13.0
hexathon==0.0.1a2
-chainlib~=0.0.1a6
+chainlib~=0.0.1a7
diff --git a/setup.cfg b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = chainsyncer
-version = 0.0.1a4
+version = 0.0.1a5
description = Generic blockchain syncer driver
author = Louis Holbrook
author_email = dev@holbrook.no