From a638c55ecb790dc28eddc98f3524fc70bc090e19 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Wed, 30 Dec 2020 23:01:21 +0200 Subject: [PATCH] Update install notes for OSX. Download correct XMR release. Trust added PGP keys. --- bin/basicswap_prepare.py | 12 ++++++-- doc/install.md | 66 +++++++++++++++++++++------------------- docker/.env | 2 +- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index eee8362..1ac8af3 100755 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -154,8 +154,9 @@ def prepareCore(coin, version, settings, data_dir): release_filename = '{}-{}-{}'.format(coin, version, BIN_ARCH) if coin == 'monero': - release_url = 'https://downloads.getmonero.org/cli/monero-linux-x64-v{}.tar.bz2'.format(version) - + if os_name == 'osx': + os_name = 'mac' + release_url = 'https://downloads.getmonero.org/cli/monero-{}-x64-v{}.tar.bz2'.format(os_name, version) release_path = os.path.join(bin_dir, release_filename) if not os.path.exists(release_path): downloadFile(release_url, release_path) @@ -240,6 +241,7 @@ def prepareCore(coin, version, settings, data_dir): rv = gpg.import_keys(urllib.request.urlopen(pubkeyurl).read()) print('import_keys', rv) assert('F0AF4D462A0BDF92' in rv.fingerprints[0]) + gpg.trust_keys('F0AF4D462A0BDF92', 'TRUST_FULLY') with open(assert_path, 'rb') as fp: verified = gpg.verify_file(fp) else: @@ -251,7 +253,10 @@ def prepareCore(coin, version, settings, data_dir): pubkeyurl = 'https://raw.githubusercontent.com/tecnovert/basicswap/master/gitianpubkeys/{}_{}.pgp'.format(coin, signing_key_name) logger.info('Importing public key from url: ' + pubkeyurl) - gpg.import_keys(urllib.request.urlopen(pubkeyurl).read()) + rv = gpg.import_keys(urllib.request.urlopen(pubkeyurl).read()) + + for key in rv.fingerprints: + gpg.trust_keys(key, 'TRUST_FULLY') with open(assert_sig_path, 'rb') as fp: verified = gpg.verify_file(fp, assert_path) @@ -286,6 +291,7 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic): fp.write('rpc-bind-ip=127.0.0.1\n') fp.write('zmq-rpc-bind-port={}\n'.format(core_settings['zmqport'])) fp.write('zmq-rpc-bind-ip=127.0.0.1\n') + fp.write('prune-blockchain=1') wallet_conf_path = os.path.join(data_dir, coin + '_wallet.conf') if os.path.exists(wallet_conf_path): diff --git a/doc/install.md b/doc/install.md index 0986c2a..b159036 100644 --- a/doc/install.md +++ b/doc/install.md @@ -53,21 +53,42 @@ Remove any existing wallets after copying over a pruned chain or the Bitcoin dae ## Run Without Docker: + +### Ubuntu Setup: + $ apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config - $ export SWAP_DATADIR=/var/data/coinswaps +### OSX Setup: + +Install Homebrew: + + https://brew.sh/ + +Command Line Tools: + + $ xcode-select --install + +Dependencies: + + $ brew install wget unzip python git protobuf gnupg automake libtool pkg-config + + +### Basicswap: + + $ export SWAP_DATADIR=/Users/$USER/coinswaps $ mkdirs -p "$SWAP_DATADIR/venv" $ python3 -m venv "$SWAP_DATADIR/venv" $ . $SWAP_DATADIR/venv/bin/activate && python -V + $ cd $SWAP_DATADIR $ wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/anonswap.zip $ unzip coincurve-anonswap.zip - $ cd coincurve-anonswap + $ cd $SWAP_DATADIR/coincurve-anonswap $ python3 setup.py install --force $ cd $SWAP_DATADIR $ git clone https://github.com/tecnovert/basicswap.git - $ cd basicswap + $ cd $SWAP_DATADIR/basicswap $ protoc -I=basicswap --python_out=basicswap basicswap/messages.proto $ pip3 install . @@ -75,6 +96,9 @@ Prepare the datadir: XMR_RPC_HOST="node.xmr.to" BASE_XMR_RPC_PORT=18081 basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --withoutcoins=litecoin --xmrrestoreheight=2245107 + OR using a local XMR daemon: + basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --withoutcoins=litecoin --xmrrestoreheight=2245107 + Record the mnemonic from the output of the above command. Start the app @@ -84,6 +108,14 @@ Start the app Open in browser: `http://localhost:12700` +Start after installed: + + $ export SWAP_DATADIR=/Users/$USER/coinswaps + $ python3 -m venv "$SWAP_DATADIR/venv" + $ basicswap-run --datadir=$SWAP_DATADIR + + + Old notes ============= @@ -97,34 +129,6 @@ Old notes $ python bin/basicswap-run.py -## OSX - -Install Homebrew: - - https://brew.sh/ - -Command Line Tools: - - $ xcode-select --install - -Dependencies: - - $ brew install python git protobuf gnupg - -Python certificates: - - $ /Applications/Python\ 3.7/Install\ Certificates.command - -Basicswap - - $ git clone https://github.com/tecnovert/basicswap.git - $ cd basicswap - $ protoc -I=basicswap --python_out=basicswap basicswap/messages.proto - $ pip3 install . - $ basicswap-prepare - $ basicswap-run - - # Windows Install git and python3: diff --git a/docker/.env b/docker/.env index 74e93e3..f36d603 100644 --- a/docker/.env +++ b/docker/.env @@ -1,2 +1,2 @@ HTML_PORT=127.0.0.1:12700:12700 -#COINDATA_PATH=/var/data/basicswap +#COINDATA_PATH=/var/data/coinswaps