You don’t have the btcpay module installed. Once you clone the repository you must install dependencies with npm install
.
@Alko89 Still having trouble creating my merchant key. I read through this entire section and upgraded btcpay
to 0.2.4 (also changed it in package.json
); I tried entering the three env variables separately and I tried regular CLI, Git Bash and PowerShell.
Any insight for me?
I’m not sure what article are you referring to, there shouldn’t be any need fixing package.json
. Are you using DOS?
You should use Powershell instead and enter the commands like this:
$env:BTCPAY_URL='https://mydomain.com/'
$env:BTCPAY_KEY='KEY'
$env:BTCPAY_PAIRCODE='PAIRCODE'
node -e "const btcpay=require('btcpay'); new btcpay.BTCPayClient(process.env.BTCPAY_URL, btcpay.crypto.load_keypair(Buffer.from(process.env.BTCPAY_KEY, 'hex'))).pair_client(process.env.BTCPAY_PAIRCODE).then(console.log).catch(console.error)"
Now each environment setting is set as its own command (new line).
Was referring to a post by Filip in this thread. He recommended updating BTCPAY from 0.2.2 to 0.2.4, if you can’t get this code to work. When you do that you also have to ensure that the dependencies are updated in package.json
. As you can see from my screenshot I was using PowerShell (says PS), I just meant that when that didn’t work that I also used DOS and GitBash to try different things.
I already tried the code like you showed in your last reply. It gives the same error ‘… is not recognized as the name of a …’
Using npm 6.14.6, BTCPAY 0.2.4 and NodeJS 12.33 on Win10 PC.
Which line gives you the error? The error now should be different. The previous error was because BTCPAY_URL
was recognized as a command instead of an environment variable.
The node
command now throws this: { StatusCodeError: 400 - {“error”:“Error while pairing (Expired)”}
You need to create a new paircode in BtcPay. The one you are using has expired.
brilliant, thank you sir!
I’m trying to open a channel using Filip’s lightning key but have been getting this error? I have 40,000 sats in my wallet but have been unable to create a channel
How much sats did you use to fund the channel?
The minimum channel size is 20k sats, I’ve tried various amounts to open the channel but am getting the error.
Sometimes when I change the fee speed I get a different error:
Strange, seems you’re getting different errors, hard to pinpoint whats the issue. I created a channel to Filips node a long time ago without issues. You tried with 10k sats right? Are you using LND node?
10k sats gives me an error because 20k is the minimum. I’m using the Zap wallet and its node, can you clarify what you mean?
Zap is just a wallet ui afaik. You need to have a running Lightning node in the background
Does your node run on Tor? If you’re not using Tor you would have to connect to the node using the domain. Try connecting with this string:
035be98895c4d4e3b91fbb88d27af0fa68de6023e3a6eae675cc8332d29f299af4@lightning.filipmartinsson.com:9735
I see, I’m not using Tor - I thought instead of running a full node you’re suppose to use a “light client” like Zap? Sorry if I’m missing something, where does Filip explain the process of running a Lightning node?
Unfortunately he doesn’t explain how to run a node there are many ways to do it and there are also multiple implementations. If you want to run a node its best to check a particular implementation you’re interested in (like c-lightning and lnd). Bear in mind you also have to run a Bitcoin node as well if you want to setup your lightning node.
The course in particular is about how to use Lightning network with Bitpay server and you’re not required to use any Lightning wallet at all.
Hi there,
Im on the Building a Lightning App (LAPP) lesson, and I successfully created my account, but when testing the connection, an error happens, could you please tell me if its OK for me to continue with the course?
the connection string I used was:
type=charge;server=https://lightning.filipmartinsson.com/lightning-charge/btc/;api-token=6ba722c01e01846c671fed7a6909bbda8ebedf0b842fd75c9a82220132b34e60