From a74caa9f770de925459dbe1cf21b2f315e95fd56 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 29 Mar 2023 18:35:05 -0400 Subject: [PATCH] Add paper engine "offline loading" support to the ledger cli --- piker/accounting/cli.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/piker/accounting/cli.py b/piker/accounting/cli.py index 71ad9757..6018ffe1 100644 --- a/piker/accounting/cli.py +++ b/piker/accounting/cli.py @@ -93,6 +93,7 @@ def sync( account: str, loglevel: str = 'cancel', + pdb: bool = False, ): start_kwargs, _, trades_ep = broker_init( @@ -106,6 +107,8 @@ def sync( open_piker_runtime( name='ledger_cli', loglevel=loglevel, + debug_mode=pdb, + ) as (actor, sockaddr), tractor.open_nursery() as an, @@ -120,12 +123,12 @@ def sync( brokername == 'paper' or trades_ep is None ): - # from . import _paper_engine as paper - # open_trades_endpoint = paper.open_paperboi( - # fqme='.'.join([symbol, broker]), - # loglevel=loglevel, - # ) - RuntimeError('Paper mode not supported for sync!') + from ..clearing import _paper_engine as paper + open_trades_endpoint = paper.open_paperboi( + fqme=None, # tell paper to not start clearing loop + broker=brokername, + loglevel=loglevel, + ) else: # open live brokerd trades endpoint open_trades_endpoint = portal.open_context(