Pages:
Author

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

legendary
Activity: 1876
Merit: 3132
Looks like there is still an issue with the macaroon files/path  Huh

Use the following commands to create missing mainnet directory and copy files over there.

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 the command. Now it should work.
member
Activity: 112
Merit: 17
I got some testnet BTC from a faucet and successfully deposited into my LND wallet, but for some reason unable to make a payment to Starblocks. See image below... LND is supposedly on "Autopilot" by default so it should be opening channels on its own, yet I don't see any channels open when I enter "lncli --network=testnet listchannels"

You have to fund a channel first. Below you will find an example how to do it. Here you can browse testnet nodes.

Code:
lncli connect 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f@197.155.6.38:9735
Code:
lncli openchannel 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f 20000

20000 is number of satoshis. One satoshi equals 0.00000001 BTC. As far as I remember, six confirmations are needed for channels to work. I might be wrong.

Looks like there is still an issue with the macaroon files/path  Huh

legendary
Activity: 3430
Merit: 3080
^^^ Right

1. Make LN connection
2. Open channel
3. Pay someone through channel
legendary
Activity: 1876
Merit: 3132
I got some testnet BTC from a faucet and successfully deposited into my LND wallet, but for some reason unable to make a payment to Starblocks. See image below... LND is supposedly on "Autopilot" by default so it should be opening channels on its own, yet I don't see any channels open when I enter "lncli --network=testnet listchannels"

You have to fund a channel first. Below you will find an example how to do it. Here you can browse testnet nodes.

Code:
lncli connect 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f@197.155.6.38:9735
Code:
lncli openchannel 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f 20000

20000 is number of satoshis. One satoshi equals 0.00000001 BTC. As far as I remember, six confirmations are needed for channels to work. I might be wrong.
legendary
Activity: 3430
Merit: 3080
You checked that the transaction is confirmed?

Also, you might need to manually initiate the first connection, the lnd autopilot possibly doesn't do that part (but auto opens after the first connection is made).
member
Activity: 112
Merit: 17
When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.


Press Q to get the prompt back


Hmm looks like those files do exist. Not sure why they don't appear when I do "ls -la /home/bitcoin/.lnd/"



Probably a typo in the original guide. Let Stadicus know, he'd appreciate it if that turns out to be the case.

Yeah I think it might be a mistake because I have the macaroon files in testnet just not mainnet. So when I change the command below from mainnet to testnet, I'm able to continue with the rest of the steps

$ cd /home/bitcoin/
$ sudo cp --parents .lnd/data/chain/bitcoin/mainnet/admin.macaroon /home/admin/ (Changed this to testnet)
$ sudo cp /home/bitcoin/.lnd/tls.cert /home/admin/.lnd
$ sudo chown -R admin:admin /home/admin/.lnd/


I got some testnet BTC from a faucet and successfully deposited into my LND wallet, but for some reason unable to make a payment to Starblocks. See image below... LND is supposedly on "Autopilot" by default so it should be opening channels on its own, yet I don't see any channels open when I enter "lncli --network=testnet listchannels"

legendary
Activity: 3430
Merit: 3080
When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.


Press Q to get the prompt back


Hmm looks like those files do exist. Not sure why they don't appear when I do "ls -la /home/bitcoin/.lnd/"



Probably a typo in the original guide. Let Stadicus know, it would be appreciated it if that turns out to be the case.
member
Activity: 112
Merit: 17
Hmm looks like those files do exist. Not sure why they don't appear when I do "ls -la /home/bitcoin/.lnd/"

legendary
Activity: 1876
Merit: 3132
What would the command be to check that directory?

It's very similar to the command you have used previously. The following one will tell you whether or not folders mainnet and testnet exist.

Code:
ls -la /home/bitcoin/.lnd/data/chain/bitcoin/

If these folders exist you can check what's inside them by adding either testnet or mainnet after /bitcoin/. By the way, you were not able to use the touch command earlier because you forgot to add sudo before it.

member
Activity: 112
Merit: 17
Actually have a question about the "Public IP script" portion of the guide. When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.

Everything is fine. You can use the following command to check whether or not your public IP is detected correctly.

Code:
cat /run/publicip

As for the permission files problem, you should have mainnet and testnet folders in the .lnd/data/chain/bitcoin directory. You should find admin.macaroon and other needed files there.

What would the command be to check that directory?
legendary
Activity: 1876
Merit: 3132
Actually have a question about the "Public IP script" portion of the guide. When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.

Everything is fine. You can use the following command to check whether or not your public IP is detected correctly.

Code:
cat /run/publicip

As for the permission files problem, you should have mainnet and testnet folders in the .lnd/data/chain/bitcoin directory. You should find admin.macaroon and other needed files in them.
member
Activity: 112
Merit: 17
ls -la /home/bitcoin/.lnd/

That command just lists files in /home/bitcoin/.lnd/, 'ls' is the list command.

To create those files... either running lnd will do that (i haven't used lnd), or you could do it yourself (the command would be touch /home/bitcoin/.lnd/admin.macaroon). But it makes more sense that lnd would do it, the idea is that a macaroon file is similar to a cookie file (both are biscuits IRL, a curious metaphor IMO). Checking the documentation for lnd should tell you more (at this stage, you've probably done most of what the guide can tell you).

Hmm not sure why the lnd didn't create them. Ran through the steps again just to make sure I didn't miss anything but still not seeing the macaroon files. Actually have a question about the "Public IP script" portion of the guide. When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.

Also, when I tried touch /home/bitcoin/.lnd/admin.macaroon I got "Permission denied"



legendary
Activity: 3430
Merit: 3080
ls -la /home/bitcoin/.lnd/

That command just lists files in /home/bitcoin/.lnd/, 'ls' is the list command.

To create those files... either running lnd will do that (i haven't used lnd), or you could do it yourself (the command would be touch /home/bitcoin/.lnd/admin.macaroon). But it makes more sense that lnd would do it, the idea is that a macaroon file is similar to a cookie file (both are biscuits IRL, a curious metaphor IMO). Checking the documentation for lnd should tell you more (at this stage, you've probably done most of what the guide can tell you).
member
Activity: 112
Merit: 17
I've been cruising through the rest of the guide but just hit another road block (under Lightning > Assign LND permissions to "admin"). It asks us to check to see if files admin.macaroon and readonly.macaroon have been created by using the following command

ls -la /home/bitcoin/.lnd/

When I execute this command I get everything in the screenshot except those two files. Do I have to wait for them to be created or am I doing something wrong?
legendary
Activity: 1624
Merit: 2481
When would I enter that? After the "chmod -R 700 .ssh/" command?

Usually, you shoudn't enter this command at all.
Inside of the .ssh directory, there are files which are fine to be read by non-root users (e.g. known_hosts).

All you have to protect inside of the directory are the private keys of the machine from reading and the public key from connecting clients from manipulation.


Back to your question. Usually you enter this command to move the public key of your machine you use to login into the .ssh directory of your server (the machine you want to connect to).
You just need a valid private-/public- ssh keypair on your machine used to login before executing this command.
legendary
Activity: 3430
Merit: 3080
member
Activity: 112
Merit: 17
Finally got it working! Was able to narrow it down and realized I did something wrong during the "Enabling the Uncomplicated Firewall" step. Should be good for now!
legendary
Activity: 1876
Merit: 3132
Ok I can try again changing the nickname to just LightNode, but what about the "2048 37" at the beginning of the public key. Will the spaces there also create a problem? Also what are your thoughts on just skipping this step altogether?

You can skip this step and use a strong password instead. I have been using only passwords for a long time and nothing bad has happened yet. Here is how my public key looks like in ".ssh/authorized_keys".

Code:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAouIC+YCXpx9dnUsjg6pROV6pTMKJBkoHEB4vy/R9XL+WHdKQbLGm7wt9kQ4soI15oHDAaHScm6lAnAirGzRFIGGLOfgBVGJygaptqz2Q9iw3
+giUoeXvFeluxKtMSEeDfjSH1s1u991/KhWso6N/t5tcqlqB5gurLc5Bc/W7TRTqTnZzAohWOqsm5HYo8F/
0gaHwDCZWb7cKZVJlzVegw1JL40hox0sKnCNV6aooh1Qdog5e1d8m2BKwDasc1mKdcFgg82MB+FmnxlYRTwLi3
dW0hwEC+hIq+vF4AdBGrmskxaI/n1wMxAHJ9egJi5dwzHGCSp0QRlCeFbIIGtWlLw== rsa-key-20181004

Of course it would be better if you managed to get it worked out.
member
Activity: 112
Merit: 17
Once this opened I added the public key, saved by hitting Ctrl + O, enter, and then exiting with Ctrl + X. Below is an example of the public key I put in, I'm wondering if I was supposed to include the entire string?

Yes, you have to include the entire string.

Usually, after creating your keypair you simply move it to your server (your PI in this case).
This works with this command:

Code:
ssh-copy-id -i .ssh/key_rsa.pub [email protected] 

with PI-USERNAME being your username on the PI and 192.168.56.101 being the IP of your PI.


Afterwards you will be able to authenticate using public key cryptography, without entering your password.

When would I enter that? After the "chmod -R 700 .ssh/" command?

chmod -R 700 .ssh/ (Nothing happened after doing this)
exit

chmod doesn't give you any output if it succeeds, so don't worry about that. If you did ls -l before chmod, then again after chmod, you'd notice the file permissions change, which is chmod's purpose.


For example, at the very end it has the nickname I gave the key "LightNode Keys". Should I omit that?

"LightNode Keys" has a space character in it, but you're not using double quotes around the nickname in the example public key string you gave. I'm not saying that's the overall problem, but it's likely a problem. Avoid putting spaces in anything that's going to get parsed by a command line tool, a space is treated like an indication that a new parameter is after the space from the perspective of parsing commands.

Ok I can try again changing the nickname to just LightNode, but what about the "2048 37" at the beginning of the public key. Will the spaces there also create a problem? Also what are your thoughts on just skipping this step altogether?
legendary
Activity: 3430
Merit: 3080
chmod -R 700 .ssh/ (Nothing happened after doing this)
exit

chmod doesn't give you any output if it succeeds, so don't worry about that. If you did ls -l before chmod, then again after chmod, you'd notice the file permissions change, which is chmod's purpose.


For example, at the very end it has the nickname I gave the key "LightNode Keys". Should I omit that?

"LightNode Keys" has a space character in it, but you're not using double quotes around the nickname in the example public key string you gave. I'm not saying that's the overall problem, but it's likely a problem. Avoid putting spaces in anything that's going to get parsed by a command line tool, a space is treated like an indication that a new parameter is after the space from the perspective of parsing commands.
Pages:
Jump to: