Bitcoin Forum
May 04, 2024, 08:34:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: c-lightning on ubuntu  (Read 166 times)
lapidary (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 4


View Profile
November 06, 2020, 01:40:06 PM
Merited by ABCbits (1), DarkStar_ (1), Husna QA (1), Heisenberg_Hunter (1)
 #1

Hello all,

I have Ubuntu 20, I did snap install bitcoin-core, now I want c-lightning, but can't see to make it work.  I can add the PPA for lightning network, install it; but it can't find bitcoin. 
Quote
bitcoin-cli not found.
  Do I need to reinstall bitcoin in a different way than snap? I would like to preserve my blockchain and bitcoin.conf (yes I have a backup of that)

Does anyone have a tutorial I can follow?
1714811642
Hero Member
*
Offline Offline

Posts: 1714811642

View Profile Personal Message (Offline)

Ignore
1714811642
Reply with quote  #2

1714811642
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Rath_
aka BitCryptex
Legendary
*
Offline Offline

Activity: 1876
Merit: 3131



View Profile
November 06, 2020, 01:45:21 PM
Merited by Carlton Banks (1), ABCbits (1)
 #2

Does anyone have a tutorial I can follow?

What instructions have you followed so far? You can try following these instructions instead. Bitcoin Core installation using snap is also described there. The following command might help you with your error.

Code: (https://github.com/ElementsProject/lightning/blob/master/doc/INSTALL.md#to-build-on-ubuntu)
# Snap does some weird things with binary names; you'll
# want to add a link to them so everything works as expected
sudo ln -s /snap/bitcoin-core/current/bin/bitcoin{d,-cli} /usr/local/bin/
Carlton Banks
Legendary
*
Offline Offline

Activity: 3430
Merit: 3071



View Profile
November 06, 2020, 04:20:33 PM
 #3

^ good advice


You need to find where snap has put bitcoin-cli, as lightningd is looking for it in the wrong place

/usr/bin or /usr/local/bin are typical directories (folders) for installing programs, but it seems snap puts programs installed using it in a different place

...and...

Beware! Don't be surprised in the future if snap "updates" the place where bitcoin-cli etc is installed, then the link in @Rath's post will stop working (the ln -s terminal command)


My advice: learn how to install programs _without_ snap packages, the sooner you do it, the faster you can say goodbye to this kind of problem

Vires in numeris
Carlton Banks
Legendary
*
Offline Offline

Activity: 3430
Merit: 3071



View Profile
November 06, 2020, 04:33:59 PM
 #4

Does anyone have a tutorial I can follow?

so here is my tutorial Cheesy

1. Open Terminal, do sudo find / -name bitcoin-cli
2. Take the result, and do ln -s /usr/local/bin <result>
3. Don't forget that Snap might change all this later! Then you have the fun of doing it all again

Vires in numeris
lapidary (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 4


View Profile
November 06, 2020, 08:54:56 PM
 #5

I'm getting closer; making a link is good; but my node rpc listens on my local IPv4 address and not on localhost.  so I think that is why it still is complaining about not finding bitcoin-cli.  Does c-lighting have a config setting for host user and password?
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
November 06, 2020, 08:59:47 PM
Last edit: November 06, 2020, 09:20:43 PM by AdolfinWolf
Merited by ABCbits (1)
 #6

I'm getting closer; making a link is good; but my node rpc listens on my local IPv4 address and not on localhost.  so I think that is why it still is complaining about not finding bitcoin-cli.  Does c-lighting have a config setting for host user and password?
I don't use C-Lightning, but did you check out this documentation here? https://lightning.readthedocs.io/lightningd-config.5.html

lapidary (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 4


View Profile
November 06, 2020, 09:54:50 PM
 #7

ah, thanks!

nothing as good as proper documentation.  --bitcoin-cli --bitcoin-rpcuser and --bitcoin-rpcpassword; now it's happy!!  So much more to learn; but at least it's running
ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7463


Crypto Swap Exchange


View Profile
November 07, 2020, 10:13:55 AM
Merited by Husna QA (1), Heisenberg_Hunter (1)
 #8

For future reference, you can run Bitcoin Core directly with these command

Code:
snap run bitcoin-core.cli
snap run bitcoin-core.daemon
snap run bitcoin-core.qt

/usr/bin or /usr/local/bin are typical directories (folders) for installing programs, but it seems snap puts programs installed using it in a different place

Some documentation mention it's on /snap/bin. It store all application installed by Snap, but if you run ls -l, you will find out,
1. The application actually only act as symbolic links.
2. Snap change default binary name of an application (e.g. bitcoin-cli become bitcoin-core.cli)

But alternatively you could find the executable by using command lsblk, then see which mountpoint belong to application (e.g. Bitcoin Core at /snap/bitcoin-core/319).

Code:
$ cd /snap/bitcoin-core/319
$ ls
bin  command-cli.wrapper  command-daemon.wrapper  command-qt.wrapper  etc  flavor-select  lib  meta  share  snap  usr  var
$ cd bin
$ ls
bitcoin-cli  bitcoind  bitcoin-qt  desktop-launch

TLDR, snap provide easy installation, but annoying for everything else.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!