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

get network details from file #911

Open
chefnaphtha opened this issue May 15, 2024 · 2 comments
Open

get network details from file #911

chefnaphtha opened this issue May 15, 2024 · 2 comments

Comments

@chefnaphtha
Copy link

i think haveno should get the network details from a json (or other) file, at some point an ui for this would be nice

the network operators would release the network json file, which will then be downloaded by people that want to connect to that network and loaded into the main haveno app

right now the way its done is to fork the app and hardcode the network details into the code, then build that separately. i think it's a waste of computing resources and a security risk (people running random binaries off the internet), not to mention it's simply inefficient to have a completely separate binary for every single network when only a few vars need to change

the variables that would need to be loaded from the json file (and un-hardcoded) are:

arbitrator public keys (string[]):
946a80f
a22c903
4ecfe15

fees (object?)
e532f2d

seednodes (string[]) (this is hardcoded into a file, code that reads that file needs to be updated)
1448613

xmr network (mainnet/stagenet/testnet) (string) (this is in package.gradle, same as above)
58ffc9a

my proposed config file example would look something like this:

{
  "xmrNetwork": "mainnet",
  "arbitratorKeys": [
    "029da09bc04dea33cd11a31bc1c05aa830b9180acb84e5370ee7fde60cae9f3d03",
    "02834de139c2767cd11f000f8ea71a3e168fec81132850a4a2cce65385da57a98a"
  ],
  "fees": {
    "arbitratorAssignsTradeFeeAddress": true, // maybe should be shortened? not sure what this does exactly
    "ratios": { // in the code, this is percentages
      "maker": 0.005, // but this is 0.5%, not 0.005%, so ratios is more accurate imo
      "taker": 0.001,
      "penalty": 0.02
    }
  },
  "seedNodes": [
    "gq2reknmxhmf3lnakkyzflr72kbtkpueui7utk3w7qfziuesbjsnkayd.onion:1002 (@anon1)",
    "bugc27z7lqjgpwmhbuu3kuwoq2bhailj573r32jm5ydwrcqrwjtblnid.onion:1002 (@anon2)",
    "c66xsfwbequrnytwlp7cz7oirs6q4grxmqyny7afuvc6r4e3cn2ynoqd.onion:1003 (@anon1)"
  ]
}
@chefnaphtha
Copy link
Author

also the haveno folder in the home dir being global and not per-network should probably be fixed before this is released but a separate issue for that is probably best

@monerobull
Copy link

There should be some warning about the importance of the files integrity, otherwise scammers could ask people to add their own nodes/arbitrators to it to my understanding put them on an orderbook where every single offer is made and arbitrated by the scammer, allowing them to drain any trade. Maybe also some mechanism to check the integrity against existing networks like a hash of the file and a big warning if it doesn't match.

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

2 participants