Building a Lightning App (Lapp) - Discussion

Welcome to the discussion thread about this lecture section. Here you can feel free to discuss the topic at hand and ask questions.

Please do post the documentation to set up own BTCpay LN node.


1 Like

its ok i found it…thankyou


Running Windows 10 and PowerShell. When I try the long entry starting with “BTCPAY_URL= BTCPAY_KEY” receive error: The term ‘BTCPAY_URL=’ is not recognized as the name of a cmdlet, function,script file, or operable program.

Going back to the start and trying again. Will post solution if I find it.

Try this. Just replace the <BTCPAY_URL>, <BTCPAY_KEY> and <BTCPAY_PAIRCODE> with the real values you already had. This should work, let me know. Will update the lecture with this code for windows users.

node -e "const btcpay=require('btcpay'); new btcpay.BTCPayClient(<BTCPAY_URL>, btcpay.crypto.load_keypair(Buffer.from(<BTCPAY_KEY>, 'hex'))).pair_client(<BTCPAY_PAIRCODE>).then(console.log).catch(console.error)"

@filip Thank you, that did the trick! I was able to generate a merchant key.

1 Like

Hi Filip, what are the coordinates of your lightning node please so I can connect to it. Nothing appears under your name.


Thanks. I just connected (Cryptoking)

1 Like

node -e “const btcpay=require(‘btcpay’); new btcpay.BTCPayClient(XXXXXX, btcpay.crypto.load_keypair(Buffer.from(XXXXXX, ‘hex’))).pair_client(XXXXXXXXXX).then(console.log).catch(console.error)”


SyntaxError: missing ) after argument list

Any suggestions?

Hmm, the script works for me. What node version are you running?

The version is v10.15.3

Alright, I found the issue. All the variables you input need to be strings. So you need to put quotes both around the url, the key and the pairing code.

1 Like

I have updated the lecture to clarify this :slight_smile:

Hello, all! I just wanted to give a quick shout out to the course. I ended applying what I learned to build my first lighting app to power ride-share and won a hackathon this past weekend as a solo dev.


AMAZING DUDE! Love it! Thank you for sharing :slight_smile:

@filip me getting the same identical problem… As per message on discord any suggestions

It should have been solved with the above solution. Could you post your query?

@filip In the frontend of the app, somebody agrees to pay using his lightning node. This goes to the backend which using the API sends request to the server (centralized) which in this case is your BTCpay server. This server is connected to the lightning node that we entered using the script. This node shall be ours in real life. So for every different store, each person enters a different website and different script to connect to his node. Is this summary correct?

Yes, that’s generally correct. Each store owner should run and connect to their own lightning node.