From 0e4b2fad99016b47c06f9c6cad4a9a7ee07ac332 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 11 Aug 2021 00:45:33 -0300 Subject: [PATCH] specify index name --- lbry/wallet/orchstr8/node.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lbry/wallet/orchstr8/node.py b/lbry/wallet/orchstr8/node.py index 41b081b12..caa6c638b 100644 --- a/lbry/wallet/orchstr8/node.py +++ b/lbry/wallet/orchstr8/node.py @@ -48,7 +48,7 @@ class Conductor: self.wallet_node = WalletNode( self.manager_module, RegTestLedger, default_seed=seed ) - self.hub_node = HubNode(__hub_url__, "hub", "hub") + self.hub_node = HubNode(__hub_url__, "hub", self.spv_node) self.blockchain_started = False self.spv_started = False @@ -193,9 +193,11 @@ class SPVNode: self.session_timeout = 600 self.rpc_port = '0' # disabled by default self.stopped = False + self.index_name = None async def start(self, blockchain_node: 'BlockchainNode', extraconf=None): self.data_path = tempfile.mkdtemp() + self.index_name = uuid4().hex conf = { 'DESCRIPTION': '', 'PAYMENT_ADDRESS': '', @@ -210,7 +212,7 @@ class SPVNode: 'MAX_QUERY_WORKERS': '0', 'INDIVIDUAL_TAG_INDEXES': '', 'RPC_PORT': self.rpc_port, - 'ES_INDEX_PREFIX': uuid4().hex, + 'ES_INDEX_PREFIX': self.index_name, 'ES_MODE': 'writer', } if extraconf: @@ -487,7 +489,8 @@ class HubProcess(asyncio.SubprocessProtocol): class HubNode: - def __init__(self, url, daemon, cli): + def __init__(self, url, daemon, spv_node): + self.spv_node = spv_node self.debug = False self.latest_release_url = url @@ -552,7 +555,7 @@ class HubNode: loop = asyncio.get_event_loop() asyncio.get_child_watcher().attach_loop(loop) command = [ - self.daemon_bin, 'serve', '--dev' + self.daemon_bin, 'serve', '--esindex', self.spv_node.index_name + 'claims' ] self.log.info(' '.join(command)) while not self.stopped: