nahuhh / basicswap-bash

A BasicSwapDEX bash installer for Debian/Ubuntu
15 stars 4 forks source link

Errors during installation [Ubuntu 22.04 x86_64] #2

Closed zebede22 closed 1 week ago

zebede22 commented 1 week ago

OS: Ubuntu Server 22.04 Python 3.10.12 Kernel: Linux 5.15.0-119-generic

git clone https://github.com/nahuhh/basicswap-bash
cd basicswap-bash && ./install.sh

Output with errors:

************************************************************************************************************************************************************************
                                                                         BasicSwapDEX Installer
************************************************************************************************************************************************************************
Detected Debian

...

[1] Tor ON (requires sudo)
[2] Tor OFF

Select an option: [1|2] 1

BasicSwapDEX will use Tor

[1] New Install (default)
[2] Restore from Particl Seed

Select an option: [1|2] 1

Installing BasicSwapDEX

[1] Connect to a Monero node
[2] Allow BasicSwapDEX to run a Monero node (+70GB)

Select an option [1|2]: 1
Enter Address of Monero node [example: 192.168.1.123] 127.0.0.1
Enter RPC Port for the Monero node [example: 18081] 18089

Successfully connected to the XMR node @ 127.0.0.1:18089

Installing BasicSwapDEX
Press Enter to continue, or CTRL-C to exit.

...

cat: /home/user/.xsessionrc: No such file or directory # <--- first error

...
# >>> another error
mv: cannot move './coincurve-anonswap/coincurve-anonswap_v0.2/.' to './coincurve-anonswap/.': Device or resource busy
mv: cannot move './coincurve-anonswap/coincurve-anonswap_v0.2/..' to './coincurve-anonswap/..': Device or resource busy

...

Successfully installed Jinja2-3.1.4 MarkupSafe-2.1.5 PySocks-1.7.1 basicswap-0.13.4 greenlet-3.0.3 pycryptodome-3.20.0 python-gnupg-0.5.2 pyzmq-26.2.0 sqlalchemy-1.4.39 wheel-0.44.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    98  100    98    0     0  10182      0 --:--:-- --:--:-- --:--:-- 14000
parse error: Invalid numeric literal at line 1, column 32
Traceback (most recent call last):
  File "/home/user/coinswaps/venv/bin/basicswap-prepare", line 33, in <module>
    sys.exit(load_entry_point('basicswap==0.13.4', 'console_scripts', 'basicswap-prepare')())
  File "/home/user/coinswaps/venv/lib/python3.10/site-packages/bin/basicswap_prepare.py", line 1684, in main
    xmr_restore_height = int(s[1])
ValueError: invalid literal for int() with base 10: ''

INFO:root:BasicSwap prepare script 0.13.4

INFO:root:Python version: 3.10.12
INFO:root:Data dir: /home/user/coinswaps
INFO:root:Bin dir: /home/user/coinswaps/bin
INFO:root:Chain: mainnet
INFO:root:WALLET_ENCRYPTION_PWD is not set
INFO:root:Enabling TOR

When I try to start it anyway: basicswap-bash

Python 3.10.12
INFO:root:Using datadir: /home/user/coinswaps
INFO:root:Chain: mainnet
INFO:root:basicswap-run, version: 0.13.4

Traceback (most recent call last):
  File "/home/user/coinswaps/venv/bin/basicswap-run", line 8, in <module>
    sys.exit(main())
  File "/home/user/coinswaps/venv/lib/python3.10/site-packages/bin/basicswap_run.py", line 443, in main
    runClient(fp, data_dir, chain, start_only_coins)
  File "/home/user/coinswaps/venv/lib/python3.10/site-packages/bin/basicswap_run.py", line 185, in runClient
    raise ValueError('Settings file not found: ' + str(settings_path))
ValueError: Settings file not found: /home/user/coinswaps/basicswap.json
zebede22 commented 1 week ago

I think problem is that CURRENT_XMR_HEIGHT=$(curl https://localmonero.co/blocks/api/get_stats | jq .height) doesn't work. when I run curl https://localmonero.co/blocks/api/get_stats it timesout, I can't even access it via a browser

<html>
<head><title>504 Gateway Time-out</title></head>
<body>

if that's the reason maybe need to update the script to check if all is good

nahuhh commented 1 week ago

Localmonero blocks is down, let me check and update script

edit: the script isnt using localmonero

nahuhh commented 1 week ago

might be a bug with using localhost.

try entering your local ip (192.168.x.x) instead of 127.0.0.1

or if the the port isnt bound to the lan interface, try localhost

zebede22 commented 1 week ago

might be a bug with using localhost.

try entering your local ip (192.168.x.x) instead of 127.0.0.1

or if the the port isnt bound to the lan interface, try localhost

I tried public IP and localhost but still same errors

it crashes here: https://github.com/basicswap/basicswap/blob/003d7b85abf37aedd6ca46d4e88c2847953e7fee/bin/basicswap_prepare.py#L1684

nahuhh commented 1 week ago

I tried public IP and localhost but still same errors

it crashes here: https://github.com/basicswap/basicswap/blob/003d7b85abf37aedd6ca46d4e88c2847953e7fee/bin/basicswap_prepare.py#L1684

its failing here: https://github.com/nahuhh/basicswap-bash/blob/master/bsx%2Fsetup.sh#L26-L28

(it uses your own node to query the height)

Is your node accessible over the ip youre entering?

curl http://localhost:18089/get_info

zebede22 commented 1 week ago
<html><head><title>Unauthorized Access</title></head><body><h1>401 Unauthorized</h1></body></html>

My node using user:pass for auth, I guess that's reason. Is there an option to specify one?

nahuhh commented 1 week ago

Run this:

git clone https://github.com/nahuhh/basicswap-bash
cd basicswap-bash

then add these lines near the top of bsx/setup.sh

XMR_RPC_USER=yourusername
XMR_RPC_PWD=yourpassword

then run

./install

note: there is a bug where, if you enter 127.0.0.1, it thinks you want basicswap to run a node. To workaround this, use your local ip (192.168.x.x)

zebede22 commented 1 week ago

I already managed to start it properly via using a public node, how can I delete/uninstall whole thing? is deleting ~/.local/bin/bsx* and ~/.local/bin/basicswap-bash enough?

nahuhh commented 1 week ago

you don't have to delete, you can edit it to use your own node

edit ~/coinswaps/basicswap.json go to the monero section

add 2 lines

"rpcuser": "youruser",
"rpcpassword": "yourpassword",

and change rpchost to your local ip

if youd like to delete for any reason, just need to delete the coinswaps folder delete ~/.local/bin/bsx* and ~/.local/bin/basicswap-bash to remove the management/launch scripts

zebede22 commented 1 week ago

I tried XMR_RPC_USER=yourusername XMR_RPC_PWD=yourpassword

but still getting same error

nahuhh commented 1 week ago

try setting up with remote node, then editing basicswap.json as above

zebede22 commented 1 week ago

Worked