From c930466ae9cf1c3d39c2e48dd5078c6748a2fdc8 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 7 May 2021 10:00:42 +0000 Subject: [PATCH] MoneroWalletDaemon: support multiple instances --- mmgen/daemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mmgen/daemon.py b/mmgen/daemon.py index 6113df95..a64ea9d5 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -229,15 +229,19 @@ class MoneroWalletDaemon(Daemon): test_suite = False, host = None, user = None, - passwd = None ): + passwd = None, + rpc_port_shift = None ): super().__init__() self.platform = g.platform self.wallet_dir = wallet_dir self.rpc_port = 13142 if test_suite else 13131 + if rpc_port_shift: + self.rpc_port += rpc_port_shift - id_str = 'monero-wallet-rpc' - self.datadir = os.path.join('test',id_str) if test_suite else id_str + bn = 'monero-wallet-rpc' + id_str = f'{bn}-{self.rpc_port}' + self.datadir = os.path.join('test',bn) if test_suite else bn self.pidfile = os.path.join(self.datadir,id_str+'.pid') self.logfile = os.path.join(self.datadir,id_str+'.log')