Skip to content

Commit e81b213

Browse files
authored
tweak chia dev data sync-time (#19548)
1 parent 6b88ae3 commit e81b213

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

chia/cmds/dev/data.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def data_group() -> None:
4949

5050

5151
def print_date(*args: Any, **kwargs: Any) -> None:
52+
kwargs.setdefault("flush", True)
5253
s = datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds")
5354
print(f"{s}:", *args, **kwargs)
5455

@@ -105,6 +106,10 @@ async def run(self) -> None:
105106
database_path = working_path.joinpath("datalayer.sqlite")
106107
print_date(f"working with database at: {database_path}")
107108

109+
wallet_client_info = await exit_stack.enter_async_context(self.wallet_rpc_info.wallet_rpc())
110+
wallet_rpc = wallet_client_info.client
111+
await wallet_rpc.dl_track_new(launcher_id=self.store_id)
112+
108113
data_store = await exit_stack.enter_async_context(DataStore.managed(database=database_path))
109114

110115
await data_store.subscribe(subscription=Subscription(store_id=self.store_id, servers_info=[]))
@@ -114,15 +119,16 @@ async def run(self) -> None:
114119

115120
print_date("subscribed")
116121

117-
wallet_client_info = await exit_stack.enter_async_context(self.wallet_rpc_info.wallet_rpc())
118-
wallet_rpc = wallet_client_info.client
119-
120122
to_download = await wallet_rpc.dl_history(
121123
launcher_id=self.store_id,
122124
min_generation=uint32(1),
123125
max_generation=uint32(self.generation_limit + 1),
124126
)
125127

128+
print_date(
129+
f"found generations to download: {to_download[-1].generation} -> {to_download[0].generation}"
130+
)
131+
126132
root_hashes = [record.root for record in reversed(to_download)]
127133

128134
files_path = server_files_path_from_config(config=config, root_path=self.context.root_path)

0 commit comments

Comments
 (0)