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

Lightning tip over Tor #14

Open
adiack opened this issue Sep 3, 2018 · 3 comments
Open

Lightning tip over Tor #14

adiack opened this issue Sep 3, 2018 · 3 comments

Comments

@adiack
Copy link

adiack commented Sep 3, 2018

Background

I am able to run lightningtip successfully on regular IP addresses but it is not working for onion addresses.

Your environment

version of lnd: 0.5 commit=73af09a06ae9cd5ba92a376e8253ae5450fe09cc
which operating system (uname -a on *Nix): 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
Tor version (tor -v): Tor 0.2.9.15

Lightnintips.conf

# Host for the REST interface of LightningTip
 resthost = 0.0.0.0:8081

# The domain (or IP address) you are using LightningTip from
# Only needed if LightningTip is running on another port than the web server and no reverse proxy is used
# Set the value to "*" to allow all domains and IP addresses
# This value is used for the HTTP header: "Access-Control-Allow-Origin"
 accessdomain =*

# It is possible to use LightningTip over HTTPS instead of HTTP
# If you want to: edit "tlscertfile" and "tlskeyfile" accordingly
# tlscertfile =
# tlskeyfile =


# After how many seconds invoices should expire
# tipexpiry = 3600


# If the connection to LND gets lost LightningTip will try to reconnect at the interval (in seconds) below
# Set to 0 or comment out to disable
# reconnectinterval = 0

# If you are using LightningTip behind a firewall it could happen the connection to LND times out after a few minutes
# To prevent this keepalive requests (requests which contain meaningless data) will be sent at the interval (in seconds) below
# Set to 0 or comment out to disable
# keepaliveinterval = 0


[LND]
# LightningTip should work out of the box with LND
# You only have to change this settings if you edited the according settings in the LND config

# Host of the gRPC interface of LND
 lnd.grpchost = localhost:10009

# TLS certificate for the LND gRPC and REST services
 lnd.certfile = tls.cert

# Invoice macaroon file for authentication
# If you are using LND version 0.4.0 or lower use the file admin.macaroon
# Set an empty string if you disabled the usage of macaroons (not recommended)
 lnd.macaroonfile = /home/adiack/.lnd/data/chain/bitcoin/mainnet/invoice.macaroon

lnd.conf
[Application Options]
listen=localhost
debuglevel=info
restlisten=localhost:8080
  • which operating system?
    Debian Linux.
  • any other relevant environment details?
  • are you running LightningTip behind a reverse proxy?

Steps to reproduce

Access webserver via onion address. Click on get request.

Expected behaviour

Invoice created

Actual behaviour

Error: Fail to reach backend.

Tor console:

SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Stack trace:
getInvoice/request.onreadystatechange@http://cxmu737kkbcpping.onion/lightningTip.js:63:40
  lightningTip.js:105:29
	getInvoice/request.onreadystatechange http://cxmu737kkbcpping.onion/lightningTip.js:105:29
Failed to reach backend  lightningTip.js:302:5
	showErrorMessage http://cxmu737kkbcpping.onion/lightningTip.js:302:5
	getInvoice/request.onreadystatechange http://cxmu737kkbcpping.onion/lightningTip.js:107:29

     
@michael1011
Copy link
Owner

I don't have much experience with Tor services but I will look into a solution 🤔

@adiack
Copy link
Author

adiack commented Sep 10, 2018

ok thanks for your work anyway. I will try to troubleshoot this as well. Let me know if there is a way I can help.

@seth586
Copy link

seth586 commented Apr 19, 2019

I have it successfully working over tor:

http://seth576fk35mys5mem6s2bterxdcsma3cnp6do2tc33uidtndc3cbead.onion/lightningtip/

Just make sure your hidden service torrc forwards port 8081 to lightningTip's resthost=

And lightningTip.js has the onion address under requestUrl =

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

3 participants