Improve terminal output

This commit is contained in:
nolash 2021-02-12 09:12:03 +01:00
parent 1ea196d04b
commit 2f22d6df1a
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 9 additions and 6 deletions

View File

@ -43,18 +43,21 @@ class MinedSyncer(Syncer):
def loop(self, interval, getter):
while self.running and Syncer.running_global:
g = self.backend.get()
start_tx = g[1]
self.progress_callback('loop awakened', g[0], start_tx)
last_tx = g[1]
last_block = g[0]
self.progress_callback('loop started', last_block, last_tx)
while self.running and Syncer.running_global:
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)

View File

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

View File

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