Browse Source

Merge JoinMarket-Org/joinmarket-clientserver#1228: Add local Tor autostart to missing scripts

8d7d82f15c Add local Tor autostart to missing scripts (Kristaps Kaupe)

Pull request description:

  Some scripts were missed in #1061.

Top commit has no ACKs.

Tree-SHA512: ae6a87295c5d771cc44b8e78d05f20917ddaa7d59a5267811e0e04d4619c101efcb9cb55ed392411c126d1d82ded1ab32f2e668746a3663c0af5d19ce1807182
master
Kristaps Kaupe 4 years ago
parent
commit
d748c28e9d
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 5
      scripts/receive-payjoin.py
  2. 5
      scripts/snicker/create-snicker-proposal.py
  3. 4
      scripts/snicker/receive-snicker.py
  4. 3
      scripts/snicker/snicker-server.py

5
scripts/receive-payjoin.py

@ -7,7 +7,8 @@ from twisted.internet import reactor
from jmbase import get_log, jmprint
from jmclient import jm_single, load_program_config, \
WalletService, open_test_wallet_maybe, get_wallet_path, check_regtest, \
add_base_options, JMBIP78ReceiverManager, start_reactor
add_base_options, JMBIP78ReceiverManager, start_reactor, \
check_and_start_tor
from jmbase.support import EXIT_FAILURE, EXIT_ARGERROR
from jmbitcoin import amount_to_sat
jlog = get_log()
@ -48,6 +49,8 @@ def receive_payjoin_main():
sys.exit(EXIT_FAILURE)
load_program_config(config_path=options.datadir)
check_and_start_tor()
check_regtest()
wallet_path = get_wallet_path(wallet_name, None)

5
scripts/snicker/create-snicker-proposal.py

@ -30,7 +30,7 @@ from jmclient import (process_shutdown,
jm_single, load_program_config, check_regtest,
estimate_tx_fee, add_base_options, get_wallet_path,
open_test_wallet_maybe, WalletService, SNICKERClientProtocolFactory,
start_reactor, JMPluginService)
start_reactor, JMPluginService, check_and_start_tor)
from jmclient.configure import get_log
log = get_log()
@ -96,6 +96,9 @@ def main():
wallet_name, hextx, input_index, output_index, net_transfer = args
input_index, output_index, net_transfer = [int(x) for x in [
input_index, output_index, net_transfer]]
check_and_start_tor()
check_regtest()
# If tx_fees are set manually by CLI argument, override joinmarket.cfg:

4
scripts/snicker/receive-snicker.py

@ -7,7 +7,7 @@ from jmclient import (jm_single, load_program_config, WalletService,
open_test_wallet_maybe, get_wallet_path,
check_regtest, add_base_options, start_reactor,
SNICKERClientProtocolFactory, SNICKERReceiver,
JMPluginService)
JMPluginService, check_and_start_tor)
from jmbase.support import EXIT_ARGERROR
jlog = get_log()
@ -56,6 +56,8 @@ Usage: %prog [options] wallet file [proposal]
load_program_config(config_path=options.datadir,
plugin_services=[snicker_plugin])
check_and_start_tor()
check_regtest()
wallet_path = get_wallet_path(wallet_name, None)

3
scripts/snicker/snicker-server.py

@ -35,7 +35,7 @@ import sqlite3
import threading
from io import BytesIO
from jmbase import jmprint, hextobin, verify_pow
from jmclient import process_shutdown, jm_single, load_program_config
from jmclient import process_shutdown, jm_single, load_program_config, check_and_start_tor
from jmclient.configure import get_log
# Note: this is actually a duplication of the
@ -331,6 +331,7 @@ def snicker_server_start(port, local_port=None, hsdir=None):
if __name__ == "__main__":
load_program_config(bs="no-blockchain")
check_and_start_tor()
# in testing, we can optionally use ephemeral;
# in testing or prod we can use persistent:
if len(sys.argv) < 2:

Loading…
Cancel
Save