Compare commits

5 Commits

Author SHA1 Message Date
lash
7d5ceb9a28 Bump version 2022-05-10 18:35:13 +00:00
lash
21db658575 Add missing single flag 2022-05-10 18:30:28 +00:00
lash
909b85b2b7 Upgrade deps 2022-05-09 19:43:36 +00:00
lash
2f9663a8f8 Fix faulty new fs store path create 2022-05-07 11:28:13 +00:00
lash
637ead1a38 Improve log output for unlocking tool 2022-05-07 11:27:01 +00:00
7 changed files with 19 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
* 0.4.8
- Add unlock action description to info loglevel for unlock tool
* 0.4.7
- Upgrade shep to avoid sync in persist set
* 0.4.6

View File

@@ -7,6 +7,7 @@ def process_flags(argparser, flags):
if flags & SyncFlag.RANGE > 0:
argparser.add_argument('--offset', type=int, help='Block to start sync from. Default is start of history (0).')
argparser.add_argument('--until', type=int, default=-1, help='Block to stop sync on. Default is stop at block height of first run.')
argparser.add_argument('--single', action='store_true', help='Execute a single sync, regardless of previous states')
if flags & SyncFlag.HEAD > 0:
argparser.add_argument('--head', action='store_true', help='Start from latest block as offset')
argparser.add_argument('--keep-alive', action='store_true', help='Do not stop syncing when caught up')

View File

@@ -17,4 +17,6 @@ def process_config(config, args, flags):
config.add(getattr(args, 'keep_alive'), '_KEEP_ALIVE')
config.add(getattr(args, 'head'), '_HEAD')
config.add(getattr(args, 'single'), '_SINGLE')
return config

View File

@@ -329,7 +329,8 @@ class SyncStore:
if locked_item_key == None:
return False
locked_item = self.get(locked_item_key)
locked_state = self.filter_state.state(locked_item_key) - self.filter_state.state_store.LOCK
state = self.filter_state.state(locked_item_key)
locked_state = state - self.filter_state.state_store.LOCK
locked_state_name = self.filter_state.name(locked_state)
logg.debug('found locked item {} in state {}'.format(locked_item, locked_state))
@@ -339,10 +340,17 @@ class SyncStore:
if i == -1:
raise FilterInitializationError('locked state {} ({}) found for item {}, but matching filter has not been registered'.format(locked_state_name, locked_state, locked_item))
direction = None
if revert:
self.__unlock_previous(locked_item, fltrs, i)
new_state = self.filter_state.state(locked_item_key)
direction = 'previous'
else:
self.__unlock_next(locked_item, fltrs, i)
new_state = self.filter_state.state(locked_item_key)
direction = 'next'
logg.info('chainstate unlock to {} {} ({}) -> {} ({})'.format(direction, self.filter_state.name(state), state, self.filter_state.name(new_state), new_state))
return True

View File

@@ -24,7 +24,8 @@ class SyncFsStore(SyncStore):
create_path = True
if create_path:
self.__create_path(base_path, self.default_path, session_id=session_id)
#self.__create_path(base_path, self.default_path, session_id=session_id)
os.makedirs(self.session_path)
self.session_id = os.path.basename(self.session_path)
logg.info('session id {} resolved {} path {}'.format(session_id, self.session_id, self.session_path))

View File

@@ -1,5 +1,5 @@
confini~=0.6.0
semver==2.13.0
hexathon~=0.1.6
chainlib~=0.1.2
shep~=0.2.8
chainlib~=0.2.0
shep~=0.2.9

View File

@@ -1,6 +1,6 @@
[metadata]
name = chainsyncer
version = 0.4.7
version = 0.4.10
description = Generic blockchain syncer driver
author = Louis Holbrook
author_email = dev@holbrook.no