[c-lightning] waitinvoice from app

ZmnSCPxj ZmnSCPxj at protonmail.com
Fri Nov 30 18:31:05 AEDT 2018


Good morning Richard,

That is the correct way, indeed.

However I do not know why it would not work using nodejs net package.
Internally, `lightning-cli` simply connects to the JSON-RPC interface, sends `waitinvoice`, then waits for a response.
Could you try alternate packages?

Regards,
ZmnSCPxj


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, November 29, 2018 7:58 AM, Richard Bondi <socketexception at gmail.com> wrote:

> Greetings,
>
> When `waitinvoce` is called from the command line, it will sit there
> and wait, and when invoice is paid, I get the response
>
> How does this translate to calling it from an app over rpc?
>
> I am using node with the net package
>
> const sock = new net.createConnection(rpcFile);
> sock.on('data', (data) => {...}
>
> sock.write(JSON.stringify(payload))
>
> I send the request, then when the invoice is paid, nothing happens
>
> if I send the request after the invoice is paid I get an immediate response
>
> What is the proper way to subscribe to an invoice event that will get
> a notification?
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> c-lightning mailing list
> c-lightning at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/c-lightning




More information about the c-lightning mailing list