Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

lookupinvoice

3 messages, Nov 23 to 26, 2018. Started by Sarat G.

Sarat G (2), Rusty Russell

Permalink First message in the Wayback Machine

Sarat G permalink original

Hi,

I'm been working on the LN repo for a while now. I would like to know if there is any way that a payee can lookup the invoice it gets paid, i.e similar to the 'lookupinvoice' command as provided by the lnd(Golang).

My problem description is: There is a hub, to which all players make payments of different amounts, the hub node has to make sure which invoice of it got paid to it from which player.

If there isn't any single command written for this, could you help me in providing me the if any combination of commands can do this job for me.

Thank You.

Regards, Sarat G

Rusty Russell in reply to Sarat G permalink original

Sarat G <sarath.ginjupalli89 at gmail.com> writes:

Quoted text (5 lines)
> Hi,
>
> I'm been working on the LN repo for a while now. I would like to know if
> there is any way that a payee can lookup the invoice it gets paid, i.e
> similar to the 'lookupinvoice' command as provided by the lnd(Golang).

Hi Sarat,

        I'm confused; "the LN repo" is ambigious, as there are several,
each with their own places to ask questions:

https://github.com/ACINQ/eclair-wallet/ https://github.com/ElementsProject/lightning https://github.com/LightningNetwork/lnd/ https://github.com/nayutaco/ptarmigan https://github.com/rust-bitcoin/rust-lightning

Then of course there's the spec repo as well, which guides us all:

        https://github.com/lightningnetwork/lightning-rfc

But AFAICT (though your question is off-topic for this list):

        lnd has lookupinvoice which looks up by hash[1]
        eclair has checkpayment which looks up by hash or bolt11[2]
        c-lightning has listinvoices which can lookup by label[3], or
           wait(any)invoice[4] which is used for polling.

Would love someone to write a rosetta stone for the different APIs!

Cheers, Rusty.

[1] https://api.lightning.community/#lookupinvoice
[2] https://github.com/ACINQ/eclair/wiki/API
[3] https://github.com/ElementsProject/lightning/blob/master/doc/lightning-listinvoices.7.txt
[4] https://github.com/ElementsProject/lightning/blob/master/doc/lightning-waitanyinvoice.7.txt
Sarat G in reply to Rusty Russell permalink original

Hi Rusty,

Thanks for your reply.

I'm using the C lightning repo for my project( https://github.com/ElementsProject/lightning). Sorry, I framed the question wrongly. Yes, I can use listinvoices to look up for the invoices created at the node.

My scenario is something like this, I'm looking up whether an invoice gets paid or not at the receiver end. For that at this point, I'm calling waitinvoice to see whether an invoice gets paid or not. I would like to know is there any way that the receiver could be aware that the particular invoice created by it paid or not.

The problem is using waitinvoice in my case, it's making my process hang till the invoice gets paid. Some workaround which I'm using for this problem is I'm looking up the difference in amount of the label "msatoshi_to_us" while running the listpeers command.

Thank You.

Regards, Sarat G

On Mon, Nov 26, 2018 at 8:59 AM Rusty Russell <rusty at rustcorp.com.au> wrote:

Quoted text (41 lines)
> Sarat G <sarath.ginjupalli89 at gmail.com> writes:
> > Hi,
> >
> > I'm been working on the LN repo for a while now. I would like to know if
> > there is any way that a payee can lookup the invoice it gets paid, i.e
> > similar to the 'lookupinvoice' command as provided by the lnd(Golang).
>
> Hi Sarat,
>
>         I'm confused; "the LN repo" is ambigious, as there are several,
> each with their own places to ask questions:
>
> https://github.com/ACINQ/eclair-wallet/
> https://github.com/ElementsProject/lightning
> https://github.com/LightningNetwork/lnd/
> https://github.com/nayutaco/ptarmigan
> https://github.com/rust-bitcoin/rust-lightning
>
> Then of course there's the spec repo as well, which guides us all:
>
>         https://github.com/lightningnetwork/lightning-rfc
>
> But AFAICT (though your question is off-topic for this list):
>
>         lnd has lookupinvoice which looks up by hash[1]
>         eclair has checkpayment which looks up by hash or bolt11[2]
>         c-lightning has listinvoices which can lookup by label[3], or
>            wait(any)invoice[4] which is used for polling.
>
> Would love someone to write a rosetta stone for the different APIs!
>
> Cheers,
> Rusty.
>
> [1] https://api.lightning.community/#lookupinvoice
> [2] https://github.com/ACINQ/eclair/wiki/API
> [3]
> https://github.com/ElementsProject/lightning/blob/master/doc/lightning-listinvoices.7.txt
> [4]
> https://github.com/ElementsProject/lightning/blob/master/doc/lightning-waitanyinvoice.7.txt
>