Pages:
Author

Topic: Questions RE: setting up Lightning Node on Raspberry Pi with Stadicus' guide - page 3. (Read 22070 times)

legendary
Activity: 1876
Merit: 3132
When I check the transaction on Blockexplorer it tells me that my channel is funded with 0.0006 / 60000 sat
It sums up to the total amount minus 177sat fee (even though it was announced with 166). But I totally do not get it.  Angry

If you executed only these three commands then you didn't open any channel. You have just funded on-chain wallet of your Lightning Network node. In order to open a channel, you have to execute the following commands:

lncli connect @:
lncli openchannel --node_key= --local_amt=

Could you share your txid with us? Since you are working on the testnet, it won't have any impact on your privacy.
newbie
Activity: 4
Merit: 0
Hi there, not sure if this is the right thread but I dont know where else to put it rn.
I followed this instruction and got it somehow running on testnet.

Now I funded my LN Wallet with 0.001 BTC

Code:
bitcoin@xxx:~ $ bitcoin-cli sendtoaddress 2N5gfEWg4nMU1DS4uLRwqwCQfG8Yym3Jf7m 0.001

Checked immediately after it looked like this (Which made sense to me):

Code:
bitcoin@xxx:~ $ lncli --network=testnet walletbalance
{
    "total_balance": "100000",
    "confirmed_balance": "0",
    "unconfirmed_balance": "100000"

Now the sourcery when tx where confirmed (which doesnt make any sense to me):

Code:
bitcoin@xxx:~ $ lncli --network=testnet walletbalance
{
    "total_balance": "39823",
    "confirmed_balance": "39823",
    "unconfirmed_balance": "0"

It’s getting even weirder:
When I check the transaction on Blockexplorer it tells me that my channel is funded with 0.0006 / 60000 sat
It sums up to the total amount minus 177sat fee (even though it was announced with 166). But I totally do not get it.  Angry

Can someone provide help? Thanks a lot!
member
Activity: 112
Merit: 17
Edit: I spoke too soon, my LND is caught up but I can't generate a new wallet address. When I do "lncli newaddress np2wkh" I get the following error message

[lncli] rpc error: code = Unknown desc = cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist

It still looks like a permission problem to me. Let's try two different things and see which one will work.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

Check if this has fixed your problem. LND restart might (but should not) be needed. If it doesn't work, try deleting admin.macaroon (it will probably result in another error which you faced earlier).

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

EDIT: The second solution (deleting admin.macaroon) might work since you have switched from the testnet to the mainnet. LND should generate a new permission file compatible with the mainnet. Also, we assigned the "-hR" parameter to the chown earlier so it should have affected admin.macaroon as well.

Awesome, I got it working! Funding wallet now! Feel free to provide your node info, would like to repay you for all the help (same goes for Carlton)

Update: Thank you guys!

legendary
Activity: 1876
Merit: 3132
Edit: I spoke too soon, my LND is caught up but I can't generate a new wallet address. When I do "lncli newaddress np2wkh" I get the following error message

[lncli] rpc error: code = Unknown desc = cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist

It still looks like a permission problem to me. Let's try two different things and see which one will work.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

Check if this has fixed your problem. LND restart might (but should not) be needed. If it doesn't work, try deleting admin.macaroon (it will probably result in another error which you faced earlier).

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

EDIT: The second solution (deleting admin.macaroon) might work since you have switched from the testnet to the mainnet. LND should generate a new permission file compatible with the mainnet. Also, we assigned the "-hR" parameter to the chown earlier so it should have affected admin.macaroon as well.
member
Activity: 112
Merit: 17
Oh. I forgot that I asked you to create mainnet folder using sudo. User bitcoin probably did not have permission to create wallet.db file. The testnet one is obviously incompatible.

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chown -hR bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet

Now you can try creating a new wallet again.

That did the trick, thank you!! Please provide your node info, would like to throw a lightning tip your way once my LND gets caught up with the mainnet blockchain

Edit: I spoke too soon, my LND is caught up but I can't generate a new wallet address. When I do "lncli newaddress np2wkh" I get the following error message

[lncli] rpc error: code = Unknown desc = cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist
legendary
Activity: 1876
Merit: 3132
Oh. I forgot that I asked you to create mainnet folder using sudo. User bitcoin probably did not have permission to create wallet.db file. The testnet one is obviously incompatible.

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chown -hR bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet

Now you can try creating a new wallet again.
member
Activity: 112
Merit: 17
Gave that a try and got the following error message when I tried to unlock afterwards

It seems to be a small permission problem. These two commands should fix it.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db

The documentation seems to be a bit outdated.

Ok well that sorta seemed to work but brings me back to square one. I'm able to successfully unlock the wallet but when I monitor the LND startup process with the "sudo journalctl -f -u lnd" command, the following message pops up



After waiting a minute or two, this message eventually comes up


legendary
Activity: 1876
Merit: 3132
Gave that a try and got the following error message when I tried to unlock afterwards

It seems to be a small permission problem. These two commands should fix it.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db

The documentation seems to be a bit outdated.
member
Activity: 112
Merit: 17
Any ideas?

You wallet might have been created in the testnet directory. Try copying wallet.db using the following command

Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/wallet.db /home/bitcoin/.lnd/data/chain/bitcoin/mainnet



Gave that a try and got the following error message when I tried to unlock afterwards

[lncli] rpc error: code = PermissionDenied desc = open /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db: permission denied
legendary
Activity: 1876
Merit: 3132
Any ideas?

You wallet might have been created in the testnet directory. Try copying wallet.db using the following command

Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/wallet.db /home/bitcoin/.lnd/data/chain/bitcoin/mainnet

member
Activity: 112
Merit: 17
So I was able to get testnet fully operation and have started the migration process to mainnet. For some reason I'm having a hard time unlocking my LND wallet. Under "Mainnet > Restart bitcoind & lnd for mainnet" it has us create a new LND wallet using same password as testnet. Followed these steps without any issues but for some reason when I restart and unlock my wallet, I get the following error message

[lncli] rpc error: code = Unknown desc = wallet not found

Any ideas?
legendary
Activity: 1876
Merit: 3132
Also, how do I assign an alias to my node? That might make it easier to find.

You have to edit the configuration file using nano and restart your node to apply changes. "Alias" setting should be somewhere in the middle of the file and as far as I remember, it should not exceed 32 characters.

Code:
sudo nano /home/bitcoin/.lnd/lnd.conf
Code:
sudo systemctl restart lnd

ACINQ explorer is a bit outdated so I wouldn't be surprised if it was their fault. 1ML.com is often used by us, especially on the mainnet. If I were you, I would ignore that issue. Please note that 1ML.com might not update your node information instantly. On the left side of the page there should be "Last updated".
member
Activity: 112
Merit: 17
How would I find my testnet node on a Lightning Network explorer like in the link below?

https://explorer.acinq.co/


From their site:
Quote
If you can't find your node, please make sure that your node or one of its peers has a connection or a channel opened to one of the nodes in the network.


So first make sure you are connected to at least one of these nodes.

Afterwards you can use the serach bar at the upper right to find your node either using your public key or IP address.

I can find my node on the 1ML testnet explorer but not on the acqing explorer. Link to my node on 1ML is below, I definitely have channels open with nodes listed on acqing

https://1ml.com/testnet/node/038c7b93518f30975d046a98dd1b369219abc77a17f804ee728402c9e0f3d65657

Also, how do I assign an alias to my node? That might make it easier to find.
legendary
Activity: 1624
Merit: 2481
How would I find my testnet node on a Lightning Network explorer like in the link below?

https://explorer.acinq.co/


From their site:
Quote
If you can't find your node, please make sure that your node or one of its peers has a connection or a channel opened to one of the nodes in the network.


So first make sure you are connected to at least one of these nodes.

Afterwards you can use the serach bar at the upper right to find your node either using your public key or IP address.
member
Activity: 112
Merit: 17
How would I find my testnet node on a Lightning Network explorer like in the link below?

https://explorer.acinq.co/
member
Activity: 112
Merit: 17
Nice that did the trick! Made my first successful payment on the testnet! Thank you!

Good to hear

Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees.

Maybe a software bug? Reading up on lnd might help


Also there is a pretty significant delay when making the payment, thought it was supposed to be lightning fast Smiley (or maybe it's just the limited processing power of the Pi)

Possibly the Pi. How long was the delay? And when you did 'lncli openchannel', was that to the starblocks node directly? If not, that may be one reason for the delay (BitCryptex is saying the same basic thing a different way).

One way it could slow right down is if the payment path failed multiple times, that would be pretty bad luck for a first attempt.

It took about 20 seconds per transaction on Starblocks but was near instant when I bought an article off Yalls.org. It's possible I'm not connected directly with the Starblocks channel, will have to double check when I get home.

Very happy that I finally have the testnet up and running, thank you again for all the help! Going to move onto mainnet tonight so I can buy this Blockstream sticker. Then it will all have been worth it Smiley

https://store.blockstream.com/product/lightning-sticker/
legendary
Activity: 3430
Merit: 3080
Nice that did the trick! Made my first successful payment on the testnet! Thank you!

Good to hear

Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees.

Maybe a software bug? Reading up on lnd might help


Also there is a pretty significant delay when making the payment, thought it was supposed to be lightning fast Smiley (or maybe it's just the limited processing power of the Pi)

Possibly the Pi. How long was the delay? And when you did 'lncli openchannel', was that to the starblocks node directly? If not, that may be one reason for the delay (BitCryptex is saying the same basic thing a different way).

One way it could slow right down is if the payment path failed multiple times, that would be pretty bad luck for a first attempt.
legendary
Activity: 1876
Merit: 3132
Thank you! Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees. Also there is a bit of a delay when making the payment, thought it was supposed to be lightning fast  Smiley

Bitcoin Lightning Network transaction speed depends on the number of nodes that take part in the payment routing. LND might prefer to take a cheaper route over a shorter one. If you open a channel directly to Starblock then your payment will be confirmed instantly without any fees. Wallet balance is not the same as channel balance. You have to use the following command to check the state of your channels.

Code:
lncli listchannels
member
Activity: 112
Merit: 17
Looks like there is still an issue with the macaroon files/path  Huh

Use the following commands.

Code:
sudo mkdir /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/admin.macaroon /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/

Are you sure that your LND instance runs on the testnet?

@DOWN: Fixed

Nice that did the trick! Made my first successful payment on the testnet! Thank you!

Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees. Also there is a pretty significant delay when making the payment, thought it was supposed to be lightning fast Smiley (or maybe it's just the limited processing power of the Pi)
member
Activity: 112
Merit: 17
Looks like there is still an issue with the macaroon files/path  Huh

Use the following commands.

Code:
sudo mkdir /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo cp --parents /home/bitcoin/.lnd/data/chain/bitcoin/testnet/admin.macaroon .lnd/data/chain/bitcoin/mainnet/

Are you sure that your LND instance runs on the testnet?

Now I'm not so sure... After making the directory and entering that second command I get the following message

cp: with --parents, the destination must be a directory
Try 'cp --help' for more information.


Is it possible to remove the LND entirely and redo that part of the guide? At this point I'm probably better off with a clean install rather than troubleshooting to see what went wrong
Pages:
Jump to: