Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haveno: add package #68

Open
milahu opened this issue Jul 18, 2024 · 20 comments
Open

haveno: add package #68

milahu opened this issue Jul 18, 2024 · 20 comments

Comments

@milahu
Copy link
Owner

milahu commented Jul 18, 2024

fix NixOS#293842

based on NixOS#311314
based on tadfisher/gradle2nix#62

draft in haveno/default.nix

nix-shell -p nur.repos.milahu.haveno

haveno is not working

the desktop app is working, but it fails to connect to seednodes
i dont know whether this is a problem with the client or a problem with the haveno network

the gui statusbar says: no seed nodes available

the seednode seems offline:
bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion:1002

$ torsocks nc bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion 1002
1720959904 ERROR torsocks[402405]: Host unreachable (in socks5_recv_connect_reply() at socks5.c:539)

$ curl --proxy socks5h://[email protected]:9050 http://bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion:1002
curl: (97) Can't complete SOCKS5 connection to bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion. (4)

the main version of haveno is broken by design
because the authors want to separate development from deployment
so im using the haveno-reto fork
which has seednodes and different keys
but otherwise its exactly the same code

is haveno a scam

it is possible that haveno is a scam, a waste of time

https://old.reddit.com/r/Monero/comments/1cqf02p/haveno_mainnet_documentation_released/

its already running on mainnet however not usable because there's no mods.

how do you propose to run a mainnet network from the official repository without being exposed to significant legal risk?

https://old.reddit.com/r/Monero/comments/1e60nc8/haveno_instances_experience/

Haveno Reto is the only running Haveno network that everybody knows about

haveno-dex/haveno#1142

im building haveno from source, but i guess it requires more patching
maybe there are some more libs or bins hidden in jars
which dont run on nixos by default and cause silent errors
but i rather invest my time in basicswap

having a list of N seednodes is not "decentralized"
haveno is a pipe dream similar to openbazaar

haveno/readme.txt

future work

i already spent too much time on this...

if someone wants to get their hands dirty on this
i would recommend to first try a binary release of haveno-reto
maybe with steam-run, maybe with buildFHSEnv
maybe on a different linux distro like arch linux
to verify that haveno-reto is actually working

then i would modify gradle2nix so that my mkOverride function is applied to all jar files
maybe there are still some libs or bins that need to be patched
otherwise haveno silently fails... but that is an optimistic view

ping @Kreyren @linsui @emmanuelrosa @chayleaf @surfaceflinger @TanvirOnGH @shortwavesurfer2009 @nahuhh

@Kreyren
Copy link

Kreyren commented Jul 18, 2024

Why don't you submit the code as merge request in nixpkgs? Makes it easier to review

@linsui
Copy link

linsui commented Jul 18, 2024

Because they are banned.

@linsui
Copy link

linsui commented Jul 18, 2024

NixOS/moderation@8369649

@milahu
Copy link
Owner Author

milahu commented Jul 18, 2024

"they" xD
i was banned because i give a shit about "modern feelings", i only care about code

i still think its interesting whether haveno-reto is actually working
at least on the technical level, ignoring social problems like real-world scammers

Kreyren referenced this issue in NixOS/moderation Jul 18, 2024
@Kreyren
Copy link

Kreyren commented Jul 18, 2024

sounds like the thing i would get banned for :D

Make that a merge request to an upstream branch that is synced with upstream and ping us

@milahu
Copy link
Owner Author

milahu commented Jul 18, 2024

nah, please help yourself

git clone --depth=1 https://github.com/milahu/nur-packages

cp -r nur-packages/pkgs/applications/blockchains/haveno \
  ~/src/nixpkgs/pkgs/applications/blockchains

NixOS/moderation@8369649#commitcomment-144375785

rationale for milanu ban plz

see my hate-maintainers-censored

tldr: im "too rude" in my comments
and someone from "the nix community" stalked some of my social feeds
and he didnt like my opinions

@Kreyren
Copy link

Kreyren commented Jul 18, 2024

I don't care for politics in open-source i will work with people who's views i don't agree with and won't obstruct their work, but i won't review if you do the code development in this shitty issue way like it's a kindergarten tossing balls at each other.

I have my merge request submitted you can submit changes to my fork branch for me to merge them and submit them to nixpkgs for example.

@milahu
Copy link
Owner Author

milahu commented Jul 18, 2024

i won't review

ok, good luck : )

i had the impression that the people i pinged
have an interest in getting haveno run on nixos

i have spent enough time on haveno already
only to see that it breaks on runtime...

@Kreyren
Copy link

Kreyren commented Jul 18, 2024

interest in haveno running without issues and implemented in a sane and controlled way

@Kreyren
Copy link

Kreyren commented Jul 18, 2024

Why the long and hacky unpack phase? Should be handled via NixOS#272380

As it's likely a complexity-induced issue that is not obvious to see rn

@milahu
Copy link
Owner Author

milahu commented Jul 18, 2024

Why the long and hacky unpack phase

you mean mkOverride?
that is a missing feature of gradle2nix, see tadfisher/gradle2nix#62 (comment)

i dont remember whether this works with gradle2nix v1
my version is based on gradle2nix v2 with better dependency resolution

but thats implementation detail
some of the jar files contain libraries and executables (libs and bins)
which require patching with patchelf

like i said, before spending more time on this
i would recommend to verify if haveno-reto is actually working
for example on arch linux
(but remember, dont trust binary releases, treat it like malware)

@Kreyren
Copy link

Kreyren commented Jul 18, 2024

screw gradle2nix you should be using the provided gradle setup hook

@milahu
Copy link
Owner Author

milahu commented Jul 18, 2024

oh man, im so happy that i "left" nixpkgs...
these discussions are so braindead

its a matter of taste which is better
nixpkgs prefers one derivation for all dependencies (vendor hash)
i prefer one derivation per dependency (lockfiles in nix repo)

but thats implementation detail...
if haveno is broken, "the provided gradle setup hook" wont save you

@nahuhh
Copy link

nahuhh commented Jul 18, 2024

or a problem with the haveno network

correct

wait a few days and try again with new version

@Kreyren
Copy link

Kreyren commented Jul 19, 2024

oh man, im so happy that i "left" nixpkgs... these discussions are so braindead

its a matter of taste which is better nixpkgs prefers one derivation for all dependencies (vendor hash) i prefer one derivation per dependency (lockfiles in nix repo)

but thats implementation detail... if haveno is broken, "the provided gradle setup hook" wont save you

it's about consensus on packages if you think that things should be done differently in an objectively better way then there is an RFC for it instead of doing subjective shits just because "i prefer them"

reto works in the present version

@milahu
Copy link
Owner Author

milahu commented Jul 19, 2024

yeah, i prefer to do my subjective shit
instead of wasting my time debating matters of taste

but hey, good luck porting reto to nixpkgs

@boldsuck
Copy link

boldsuck commented Jul 19, 2024

haveno is not working

the desktop app is working, but it fails to connect to seednodes i dont know whether this is a problem with the client or a problem with the haveno network

the gui statusbar says: no seed nodes available

the seednode seems offline: bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion:1002

$ torsocks nc bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion 1002
1720959904 ERROR torsocks[402405]: Host unreachable (in socks5_recv_connect_reply() at socks5.c:539)

Your adjustments up to this point were correct, you should have just left the app running.
The seed nodes are under DoS. Your messages are normal. Just let the app run for 20-30 minutes.

the main version of haveno is broken by design
It's not broken, it's been running live on the Monero testnet (Stagenet) for 1.5 years and will always be there. It's all documented.

is haveno a scam

it is possible that haveno is a scam, a waste of time

Haveno-reto is not a scam. I have made over 30 trades there.

its already running on mainnet however not usable because there's no mods.

Mods are in the SimpleX chat or as arbs in the client if there are problems.

https://haveno-reto.com/
Haveno Reto is LIVE

@milahu
Copy link
Owner Author

milahu commented Jul 30, 2024

any progress with haveno on nixos?

apparently the seed node is offline

currently i can reach 2 of 8 seed nodes

haveno-ping.sh
#!/usr/bin/env bash

# https://github.com/retoaccess1/haveno-reto/raw/master/core/src/main/resources/xmr_mainnet.seednodes

seednodes="$(cat <<'EOF'
z47tltuwytd5icqq4hni2ammvlugp6pcwqboeu7ngawruualxjjuu3ad.onion:9992(@anon3)
xephvvzd3orepnny7lbia4nkwie5t7wjivlvvz5lhbsck7ubavystead.onion:9992(@anon3)
c66xsfwbequrnytwlp7cz7oirs6q4grxmqyny7afuvc6r4e3cn2ynoqd.onion:1003(@anon1)
bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion:1002(@anon2)
u6wwec5ddxswwyrz7rgzuiwowf33llab57y3xzmwwxvsofq2w4m6ihad.onion:1002(@anon4)
syslvhws23bczuabxtd6ekaprbc4pkel7yrrj7iq5awd5fhkjfzkcaqd.onion:1002(@anon5)
znoonk3vlow2ishmgnucjzuejwzabdfg2zcvg55ok63viohjohuw4cad.onion:1002(@anon6)
h7skqvtehrnhmsfnk3vgpej7nrn5qepla7a3ls27h7ctve7qr525baad.onion:1002(@anon7)
EOF
)"

# netselect is not working with torsocks
#torsocks netselect $(echo "$seednodes" | sed -E 's/\(@anon[0-9]+\)$//')
#torsocks netselect $(echo "$seednodes" | sed -E 's/\(@anon[0-9]+\)$//')

# ping is not working with torsocks
#torsocks ping $(echo "$seednodes" | sed -E 's/\(@anon[0-9]+\)$//')

total=$(echo "$seednodes" | wc -l)

timeout=30

while true; do
  res="$(
    pids=()
    while IFS=: read host port; do
      #echo $host $port
      echo asdf | timeout $timeout torsocks nc -v $host $port 2>&1 | grep -v 'ERROR torsocks' &
      pids+=($!)
    done < <(echo "$seednodes" | sed -E 's/\(@anon[0-9]+\)$//' | shuf)
    wait ${pids[@]}
  )"
  # Connection to $host (127.xxx.xxx.xxx) $port port [tcp/...] succeeded!
  #good=$(echo "$res" | grep ^Connection | wc -l)
  good=$(echo "$res" | grep -E '^Connection .* succeeded!$' | wc -l)
  # nc: connect to $host (127.xxx.xxx.xxx) port $port (tcp) failed: No route to host
  #bad=$(echo "$res" | grep ^nc | wc -l)
  echo $(date +%Y-%m-%dT%H:%M:%S%z) reachable seednodes: $good of $total
done
$ ./haveno-ping.sh 
2024-07-30T20:47:21+0200 reachable seednodes: 0 of 8
2024-07-30T20:47:51+0200 reachable seednodes: 0 of 8
2024-07-30T20:48:22+0200 reachable seednodes: 0 of 8
2024-07-30T20:48:52+0200 reachable seednodes: 1 of 8
2024-07-30T20:49:23+0200 reachable seednodes: 1 of 8
2024-07-30T20:49:53+0200 reachable seednodes: 2 of 8
2024-07-30T20:50:24+0200 reachable seednodes: 2 of 8
2024-07-30T20:50:54+0200 reachable seednodes: 1 of 8

@boldsuck
Copy link

any progress with haveno on nixos?

No, why I think you are working on it.
Haveno is a Java package that runs on all major OS. IDK why NIXOS can't do that.

apparently the seed node is offline

Some seeds are gone or under DOS, but new ones are coming with v1.0.10, because everyone has to generate new .onion addresses for externalTor.

currently i can reach 2 of 8 seed nodes

The client won't connect to more than 2. After bootstrap you no longer need seed nodes. The network is P2P.

@milahu
Copy link
Owner Author

milahu commented Aug 2, 2024

I think you are working on it.

no. i stopped working on haveno.nix
because i found nanswap and changenow
which "just work" for small amounts
so i made this issue to share my progress

IDK why NIXOS can't do that.

because nixos has no FHS paths like /lib/ld-linux.so.2
so precompiled bins and libs must be patched with patchelf
see mkOverride in my haveno.nix

precompiled bins and libs

but generally, using precompiled files is a security risk
so ideally, more jar files should be built from source
or constructed from other nix packages (tor, monero, ...)

my haveno.nix kind-of works
but 2 weeks ago, it failed to connect to seed nodes
maybe i should have had more patience
maybe its a silent failure in haveno
somebody will find out... ; )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants