stakwork / sphinx-relay

Node.js wrapper for communication between sphinx client and lightning node.
MIT License
247 stars 71 forks source link

Better error messaging when trying to join a tribe if a node is not reachable #169

Open gonzaloaune opened 3 years ago

gonzaloaune commented 3 years ago

What the title says, when some people try to join some tribes, they're just presented with the message "There was an error. Please try again later.", ideally this should explain a bit more the situation. A Tribe example is:

sphinx.chat://?action=tribe&uuid=YFXTSCDZBAd-jXM4vF2xz31OdV2ZwmL5YhuaZrm44WQdWkQWlgilHZgN-BeAXh6JrfCrKSYt1bEgAXXEDVJokTpHIsqG&host=tribes.sphinx.chat

pitoi commented 3 years ago

Adding a queryroute check before trying to connect would provide info on why it might fail. This would be a good way to pre-check: lncli queryroutes --amt=( joining fee + routing fees + post fee for 1 msg + stake fee for 1 msg ) This way they will at least be able to post once they have joined the tribe.