Git Product home page Git Product logo

Comments (18)

rkfg avatar rkfg commented on July 20, 2024

Hi! Yes, I've just received your payment and got a notification.
Screenshot_20220123-203833
Not sure what the problem could be. You might want to add more debug information to see if the invoice is generated correctly and also try to subscribe to it manually using curl. It's not really easy as you need to encode the hash as base64 and also replace some characters so it's best to start with as much debug info as possible.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

Thanks for your response. I was debugging the r_hash and see that it is passed to the invoice subscription method base64 encoded which doesn't seem to be found in the existing invoices.

Do you recall which version you are running? Which is the commit you are running on?

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

I'm on 507ac8a, haven't updated since my last PR.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

I am starting to believe it's my lnd installation or something. When I log an r_hash like 5YUKNOJ8ZRj7xvMPvrNtK8El8pYgSxuHCv_rDuf_Vm8= and do a curl -X GET --cacert /home/user/.lnd/tls.cert --header "$MACAROON_HEADER" https://localhost:8080/v2/invoices/subscribe/5YUKNOJ8ZRj7xvMPvrNtK8El8pYgSxuHCv_rDuf_Vm8= I receive {"code":5, "message":"Not Found", "details":[]}.

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

Try any manually created invoice, add one with lncli addinvoice, convert its payment hash to base64 and see if it works.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

Nope:

abc@ubuntu-8gb-hel1-1:~$ lncli addinvoice
{
    "r_hash": "b6220cceadda087ecbd4f47ac3ec88bcf1180d8e1e18b9f2436d3a241dbee2",
    "payment_request": "lnbc1ps7m0kcpp5kc3qenkmphdqslkt6n684slv3z70zxqd3c0p3w0jgdkn5fqahm3qdqqcqzpgxqyz5vqrzjqw260vnuwkt7l2m27kqxpq0x7nv7v5qrkyqtd44vazfteldukhn5zz4gw5qqz7sqqqqqqq
qqqqqqp9sq9qsp5nf5xsvqme0szfa72rycuvy6027xe2qadf550mqsq5uxl4s2kwqxs9qyyssqhkaa3q4uwttws7jzjvl3gwfs0y5ynn3hw9gakhm7ac2he9p06zv5hhmhdedrrqxjwuyznpq8x4xn7lf7uezgzu9rwqz2hfk3p80d5ecqh
utcjt",
    "add_index": "341",
    "payment_addr": "9a6868301bcbe024f7ca1931c6134f578d9503ad4d28fd8200a70dfac156700d"
}

abc@ubuntu-8gb-hel1-1:~$ echo b6220ccedb0dda087ecbd4f47ac3ec88bcf1180d8e1e18b9f2436d3a241dbee2 | base64
YjYyMjBjY2VkYjBkZGEwODdlY2JkNGY0N2FjM2VjODhiY2YxMTgwZDhlMWUxOGI5ZjI0MzZkM2Ey
NDFkYmVlMgo=

abc@ubuntu-8gb-hel1-1:~$ curl -X GET --cacert /home/abc/.lnd/tls.cert --header "$MACAROON_HEADER" https://localhost:8080/v2/invoices/subscribe/P+0KNfyZahh+sajK/YjYyMjBjY2VkYjBkZGE
wODdlY2JkNGY0N2FjM2VjODhiY2YxMTgwZDhlMWUxOGI5ZjI0MzZkM2Ey
{"code":5, "message":"Not Found", "details":[]}abc@ubuntu-8gb-hel1-1:~$ curl -X GET --cacert /home/abc/.lnd/tls.cert --header "$MACAROON_HEADER" https://localhost:8080/v2/invoices
/subscribe/P+0KNfyZahh+sajK/YjYyMjBjY2VkYjBkZGEwODdlY2JkNGY0N2FjM2VjODhiY2YxMTgwZDhlMWUxOGI5ZjI0MzZkM2EyNDFkYmVlMgo=
{"code":5, "message":"Not Found", "details":[]}abc@ubuntu-8gb-hel1-1:~$

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

You're doing it wrong! You should encode the binary value, not the hex ASCII representation. Try echo -n 'b6220cceadda087ecbd4f47ac3ec88bcf1180d8e1e18b9f2436d3a241dbee2' | xxd -p -r | base64 (-n removes newline). Then replace / with _ and + with - if there are any.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

Thanks! Still no luck:

bob@ubuntu-8gb-hel1-1:~$ lncli addinvoice
{
    "r_hash": "151416051a57370962cfe9bbc0e1d5765ea0c0607215dcb7ee9ea963d11e2c3b",
    "payment_request": "lnbc1ps7msw9pp5z52pvpg62umsjck0axaupcw4we02psrqwg2aedlwn65k85g79sasdqqcqzpgxqyz5vqrzjqw260vn
uwkt7l2m27kqxpq0x7nv7v5qrkyqtd44vazfteldukhn5zz4gw5qqz7qqqqqqqqqqqqqp9sq9qsp5cs84xmh9wud8k6m8sc6k79mtfz806zzy4heg6g
9m68e3mr9tgz2s9qyyssqkj6ml03zlff7yswe7fsrgnk7w2wglu325t3e5cmfcs0u46l6lefn3rlrvlfvh2ycppnhrc34j6g70nxq735p08ekjxw5uj3
9z2hxgxspy2n27y",
    "add_index": "344",
    "payment_addr": "c40f536ee5771a7b6b6786356f176b488efd0844adf28d20bbd1f31d8cab4095"
}

bob@ubuntu-8gb-hel1-1:~$ echo -n '151416051a57370962cfe9bbc0e1d5765ea0c0607215dcb7ee9ea963d11e2c3b' | xxd -p -r | base64
FRQWBRpXNwliz+m7wOHVdl6gwGByFdy37p6pY9EeLDs=

bob@ubuntu-8gb-hel1-1:~$ curl -X GET --cacert /home/bob/.lnd/tls.cert --header "$MACAROON_HEADER" https://localhost:
8080/v2/invoices/subscribe/FRQWBRpXNwliz-m7wOHVdl6gwGByFdy37p6pY9EeLDs=
{"code":5, "message":"Not Found", "details":[]}

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

What's your $MACAROON_HEADER? How did you set it? Mine is set with MACAROON_HEADER="Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 ~/.lnd/data/chain/bitcoin/mainnet/invoices.macaroon)"

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

bob@ubuntu-8gb-hel1-1:~$ MACAROON_HEADER="Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 /home/bob/.lnd/data/chain/bitcoin/mainnet/invoices.macaroon)"

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

Since it's a weird issue there must be a weird cause... are you sure your lnd uses the same data directory? Maybe it runs under a different user or such?

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

You must be right, let me check it.

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

Or maybe you run two instances, one generates invoices and another listens on 127.0.0.1:8080 so of course they don't see each other. Or maybe the port is forwarded to a different host, there might be plenty of reasons like that.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

Weirdly enough non of the /v2 REST endpoints seems to work but /v1 does. I get "Not Found" for all I tried...
curl -X GET --cacert /home/bob/.lnd/tls.cert --header "$MACAROON_HEADER" https://localhost:8080/v2/wallet/estimatefee/3
{"code":5, "message":"Not Found", "details":[]}
I wonder if I need to compile lnd with a flag for v2?

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

I compile lnd with make release BUILD_SYSTEM=linux-arm64 for my RPi node, then unpack the .tar.gz it produces and upload the binaries to the node. This way it includes all the flags. Maybe you forgot to include invoicesrpc in your tags? Here's the full list.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

That was indeed the issue. I rebuilt lnd with make release BUILD_SYSTEM=linux-amd64 and it worked. Thanks for your help. I sent you a tip to your lightning address.

from go-host-lnaddr.

rkfg avatar rkfg commented on July 20, 2024

Thanks, received it. I also had various issues building lnd with no tags explicitly specified, don't remember all details but many programs (RTL, lntop etc.) refused to work normally with it, most probably because of those missing APIs. After that I build using that command even though it's suboptimal as I need to unpack the result manually. Also, the binary file dates are always the same (to make the archives reproducible) so rsync might refuse to copy them over thinking that the files are unchanged so make sure you touch * them.

from go-host-lnaddr.

hieblmi avatar hieblmi commented on July 20, 2024

Pro tip! Thank you.

from go-host-lnaddr.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.