Pages:
Author

Topic: [Guide] FULL NODE OpenSUSE 15.3: bitcoind + electrs + c-lightning + RTL (Read 2203 times)

hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
The guide was again updated to the latest version of everything:

Code:
Bitcoin Core v26.0
electrs v0.10.2
Core Lightning v23.11.2
RTL v0.15.0

Upgrading worked mostly as I previously described here:
https://bitcointalksearch.org/topic/m.61920456

However, this time there are a few changes regarding the Lightning REST API. I switched from c-lightning-REST to the new CLNRest API built into Core Lightning since v23.08, because sticking to the old method was giving me some issues when upgrading.

The following changes need to be made. After upgrading Core Lightning, do the following:
Code:
cd /home/bitcoin/lightning
pip install -r plugins/clnrest/requirements.txt
nano /home/bitcoin/.lightning/bitcoin/lightningd.conf

Add the following lines to the end of the file:
Code:
# REST API
clnrest-port=3010

Then, after upgrading RTL, edit this line in /home/bitcoin/RTL/RTL-Config.json and replace CLT with CLN, and port number 3001 with 3010:
Code:
"lnImplementation": "CLN"
[...]
"lnServerUrl": "https://127.0.0.1:3010"

Also, add this element to the Authentication section of this file (look at the updated guide for the whole file):
Code:
"runePath": "/home/bitcoin/RTL/rune0"

Lastly, create a 'rune', which is like an access token in Core Lightning, as follows:
Code:
lightning-cli createrune
lightning-cli showrunes

You'll get an output like this.
Code:
$ lightning-cli showrunes
{
   "runes": [
      {
         "rune": "SGVsbG8gQml0Y29pbnRhbGshIFRoaXMgaXMgYSBkZW1vLg==",
         "last_used": 1199145600.138712375,
         "unique_id": "0",
         "restrictions": [],
         "restrictions_as_english": ""
      }
   ]
}

Create a file /home/bitcoin/RTL/rune0 with the following contents. Paste the rune from above between the quotes, as shown here.
Code:
LIGHTNING_RUNE="SGVsbG8gQml0Y29pbnRhbGshIFRoaXMgaXMgYSBkZW1vLg=="

Now you do a clean restart of your node or restart all the services individually.
Code:
sudo service bitcoind restart
sudo service electrs restart
sudo service lightningd restart
sudo service RTL restart
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
Just a little PSA for everyone updating to Bitcoin Core v25.0 that I just noticed: Since some time in May of this year, it requires GCC version 9 or higher: https://github.com/bitcoin/bitcoin/pull/27662

Therefore, you need to install it as shown here.
Code:
sudo zypper up
sudo zypper -v install gcc9 gcc9-c++

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 30
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 30
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-9 30

Then, proceed with the instructions I have previously given for updating Bitcoin Core.
Bitcoin Core
Code:
su - bitcoin
cd /home/bitcoin/bitcoin
git stash
git checkout master
git pull
git checkout v25.0

./autogen.sh
./configure
make -j $(nproc)
exit
cd /home/bitcoin/bitcoin
sudo make install

sudo service bitcoind restart



Also just finished updating the guide to all latest versions:
Changelog:

[...]
26.06.2023: Update guide -- all latest versions! Bitcoin Core v25.0, electrs 0.9.12, Core Lightning v23.05.1 and RTL v0.14.0.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
Updated the version numbers for Lightning stuff especially.
In general, for updating these components, you should navigate to their respective folders:

  • /home/bitcoin/bitcoin # for Bitcoin Core
  • /home/bitcoin/electrs # for Electrum server
  • /home/bitcoin/lightning # for Core Lightning
  • /home/bitcoin/c-lightning-REST # for CLN Rest API
  • /home/bitcoin/RTL # for RTL GUI

And then for each, as user bitcoin stash changes, switch to master, pull latest version, check it out and rebuild.
Code:
su - bitcoin
cd [insert location here]
git stash
git checkout master
git pull
git checkout [insert latest version here]

[build instructions from the guide]



I decided to type them all out for completeness. I still think it's good to know what the commands do (hence the generic version with explanations above).

Bitcoin Core
Code:
su - bitcoin
cd /home/bitcoin/bitcoin
git stash
git checkout master
git pull
git checkout v25.0

./autogen.sh
./configure
make clean
make -j $(nproc)
exit
cd /home/bitcoin/bitcoin
sudo make install

sudo service bitcoind restart

electrs
Code:
su - bitcoin
cd /home/bitcoin/electrs
git stash
git checkout master
git pull

cargo build --locked --release --no-default-features
exit
sudo service electrs restart

Core Lightning
Code:
su - bitcoin
cd /home/bitcoin/lightning
git stash
git checkout master
git pull
git checkout v23.02.2

./configure
make -j $(nproc)
exit
cd /home/bitcoin/lightning
sudo make install

sudo service lightningd restart

CLN REST API
Code:
su - bitcoin
cd /home/bitcoin/c-lightning-REST
git stash
git checkout master
git pull
git checkout v0.10.4

npm install --only=prod
exit
sudo service c-lightning-REST restart

Ride The Lightning
Code:
su - bitcoin
cd /home/bitcoin/RTL
git stash
git checkout master
git pull
git checkout v0.14.0

npm install --only=prod --legacy-peer-deps
exit
sudo service RTL restart
jr. member
Activity: 49
Merit: 11

You installed Bitcoin Core and Core Lightning on your Futurebit Apollo? How is it going?

If you have the Apollo, a Mac Mini and a Threadripper-based PC, I'd absolutely recommend leaving the node on the Apollo (Orange Pi 4), as long as you installed custom OS like described in my guide.


Sorry totally missed this post yes i got it going as you described i didnt install the buster version was that a mistake? im noticing the new version debian 11 is basically ubuntu should i redo it with buster? Everytime i make a change i just copy back over the device tree. I'm wondering now if the original futurebit image is fine as it appears to run alpine linux under the good with ubuntu overtop i may be wrong here.

I like the idea of a SBC so can add a battery backup to keep it going on cellular just incase. My futurebit node has 70-80 peers on average shipping off 14-20 gigs a day of served up blocks. whether it helps or not i have no idea i would assume so it seems node should be more important than miners as they are far less of them in residential as i can tell anyways.

ive given up on making any kind of break even on mining im focusing on the software portion and learning C i always neglected it the past 20 years. When i think of arm i think of software based hardware so when i think of bare metal its a full blown pc. maybe not proper terms.

I have had major tech burnout the last 3 years looking back on all the things i should of been aware of and just ignored. trying to get back on the pony its all ive ever loved a hobby.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!

In the beginning especially, it is a bit of trial and error and you'll figure out which channels are never used (close them), which routes are often long & expensive (open direct / closer channels to the destination) and such.
There are also quite a few guides online, such as here.
I just want to start off trying to route transactions i dont have a specific goal in mind to utilize it myself i dont know enough people into bitcoin they all seen me lose my ass. Thanks for all that guides you put up blockchain has a lot of moving parts and the information is a little hard to sift through.
If you want to set up a node mainly for routing, have a look around for 'Lightning Routing Node' guides, such as this one. I only skimmed it, but the advice there seems reasonable.

I don't think we have a guide for configuring a dedicated routing node here on Bitcointalk, probably because nobody here is running one and can make a well-informed guide about it. Do feel free to create one yourself, after gathering some experience with your own routing node!
jr. member
Activity: 49
Merit: 11

In the beginning especially, it is a bit of trial and error and you'll figure out which channels are never used (close them), which routes are often long & expensive (open direct / closer channels to the destination) and such.
There are also quite a few guides online, such as here.

I just want to start off trying to route transactions i dont have a specific goal in mind to utilize it myself i dont know enough people into bitcoin they all seen me lose my ass. Thanks for all that guides you put up blockchain has a lot of moving parts and the information is a little hard to sift through.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
How do you find other peers to link to? Just got all my lightning node up unsure what steps to do next with it. im also running a seperate bitcoind with no outgoing besides tor is that fine for lightning or should i switch it to my main bitcoin node? i setup second one so i could use bitcoincore with wallet enabled.
You don't need a second instance of Bitcoin Core, because you also don't need the Bitcoin Core wallet.
Core Lightning has its own integrated on-chain wallet, but I know that it is easy to assume that Lightning's on-chain wallet is the Bitcoin Core default wallet.

As for finding peers; there is no real science behind that. I'd advice if there is a service you (plan to) often use, feel free to open a direct channel. Be it a centralized exchange (although I recommend against using those, in general), an online shop or another platform you use regularly like https://www.bitrefill.com/.

You could also open channels with other forum members; just ask in here or here.

In the beginning especially, it is a bit of trial and error and you'll figure out which channels are never used (close them), which routes are often long & expensive (open direct / closer channels to the destination) and such.
There are also quite a few guides online, such as here.
jr. member
Activity: 49
Merit: 11
How do you find other peers to link to? Just got all my lightning node up unsure what steps to do next with it. im also running a seperate bitcoind with no outgoing besides tor is that fine for lightning or should i switch it to my main bitcoin node? i setup second one so i could use bitcoincore with wallet enabled.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
"Many years" might be enough in practice, maybe we can agree on that
Agreed. Wink

And lastly, even when that support ends, technically Bitcoin Core will still run on it. Bitcoin Core doesn't really care whether your OS is still updated or not.
sure but some hacker will care about your OS having known security holes: but for the wrong reasons!
Again, though: if you view the Mac Mini as a compact PC with quite a bit more compute power than a Raspberry Pi, that can also runs Linux, it may be a good choice for some. Because you can definitely install latest Linux kernel on old Mac Minis that don't get software support by Apple anymore.

Even the M1 Mac Mini already runs Linux thanks to Asahi Linux.

I'm not sure how it compares price-wise to an Intel Nuc, though. Those seem to fit into a similar niche of laptop-style hardware in a cheaper, headless package. I do think it's a very interesting form factor, because single-board computers often just don't cut it and not everyone wants to keep a power-hungry desktop or server running 24/7 for mostly small tasks.
legendary
Activity: 3430
Merit: 3080
"supported forever" is the most practical point, and servers are all about practicality imo. Look at it this way: you'll need to buy a new Mac, or start using Linux, when Apple cancel support for your hardware. Start today instead.
you can upgrade to a newer version, but even that is not 'forever'.

chack out 'rolling' distributions, it's a concept that suits servers very well (OS/software support forever). you just keep on downloading and installing the updates, and that's it

obviously hardware is not often supported in perpetuity, but if that's the issue, Apple is the last platform to consider


If he does end up choosing a Mac Mini, that's an expensive, but not terrible, relatively low-power, but more capable platform than e.g. a Raspberry Pi, so he would have more computing headroom for other stuff.

One more thing regarding longevity: To the best of my knowledge, Apple hardware gets major version updates for many many years. Even when that stops, similarly to Android, they still ship security updates. For instance, macOS 11 is still supported, with its first release in June 2020.

no. although Apple provide some long-term hardware support, they have the worst record in the industry when it comes to supporting old hardware (and that's a significant part of their business model).
"Many years" might be enough in practice, maybe we can agree on that


And lastly, even when that support ends, technically Bitcoin Core will still run on it. Bitcoin Core doesn't really care whether your OS is still updated or not.

sure but some hacker will care about your OS having known security holes: for the wrong reasons!
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
"supported forever" is the most practical point, and servers are all about practicality imo. Look at it this way: you'll need to buy a new Mac, or start using Linux, when Apple cancel support for your hardware. Start today instead.
That's not entirely correct, to be honest. Every Linux LTS version has some kind of end date. Sometimes modern packages start getting unavailable even long before that and you need to install custom sources and whatever.
Of course, you can upgrade to a newer version, but even that is not 'forever'. See: https://linuxiac.com/linux-kernel-developers-discuss-dropping-old-cpu-platforms/

If he does end up choosing a Mac Mini, that's an expensive, but not terrible, relatively low-power, but more capable platform than e.g. a Raspberry Pi, so he would have more computing headroom for other stuff.

One more thing regarding longevity: To the best of my knowledge, Apple hardware gets major version updates for many many years. Even when that stops, similarly to Android, they still ship security updates. For instance, macOS 11 is still supported, with its first release in June 2020.

And lastly, even when that support ends, technically Bitcoin Core will still run on it. Bitcoin Core doesn't really care whether your OS is still updated or not. Although there may be security concerns at that point. Even then, the Mac Mini buyer can still always install some nice, modern LTS Linux distro on that hardware... Wink
legendary
Activity: 3430
Merit: 3080
i prefer mac os i know its a walled garden but most things are just done right in the os.

linux is:
  • much leaner (you won't need even 4GB RAM)
  • done right (+ macOS is not as good as it used to be)
  • supported forever
  • no surveillance mysteries (do Apple suck your data or not? they seem to try very hard to convince you that they could... but don't Undecided Roll Eyes )

"supported forever" is the most practical point, and servers are all about practicality imo. Look at it this way: you'll need to buy a new Mac, or start using Linux, when Apple cancel support for your hardware. Start today instead.

I'd absolutely recommend leaving the node on the Apollo (Orange Pi 4), as long as you installed custom OS like described in my guide.

right, the least powerful node I'm running is a Raspberry Pi 3 (1GB RAM, 1.5GHz processor). With all the software upgrades (to linux + all bitcoin upgrades), it now runs better than it did when I bought it 5 years ago.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
n0nce thanks for taking the time to make the guides they are very useful as im learning the rest of how bitcoin operates. I think i like baremetal as opposed to arm is there a benefit? What about Mac Mini the latest versions with 16g of ram? i prefer mac os i know its a walled garden but most things are just done right in the os.
You're confusing some terms here. Bare-metal refers to installing software directly on the base OS without any virtualization layer like a VirtualBox VM or Docker.
ARM is a processor architecture; used for instance in Raspberry Pi SoCs, but also in Apple mobile chips and lately the M1 and M2 families of laptop and desktop chips.

You absolutely don't need a Mac Mini with 16GB to run a full node. Something cheap with 8GB totally suffices. For a server application like a Bitcoin full node with Electrum and Lightning on it, I do recommend sticking to Linux. If you want to use that Mac Mini for personal stuff, too, you may want to look into running the Bitcoin stuff in a VirtualBox VM with OpenSUSE.

I'm hopeful i will get to do my first lightning transaction sometime tonight! everything is done except RTL doing it on futurebit for now but will probably migrate it to a thread ripper that i have sitting for the past 2 years or is that overkill?
You installed Bitcoin Core and Core Lightning on your Futurebit Apollo? How is it going?

If you have the Apollo, a Mac Mini and a Threadripper-based PC, I'd absolutely recommend leaving the node on the Apollo (Orange Pi 4), as long as you installed custom OS like described in my guide.

It pulls the least amount of power and runs Linux by default. So it's kind of an easy choice.
legendary
Activity: 3430
Merit: 3080
Part 3 (optional): Hardening
This is a version 3 hidden service, so it cannot be found in any way unlike servers in the clearnet or Tor v2.

not sure if this is altogether true.

The tor project people advise to defend against side-channel attacks that can (supposedly) discover the IP of hidden services, they have an add-on (vanguards) to mitigate the issue.

not sure if more recent versions of tor daemon manage the side-channel attacks better, although a "lite" version of the add-on has been part of the main tor daemon, since last year I think. The recommendation at that time was that any serious hidden service should continue to use the full vanguards add-on.
jr. member
Activity: 49
Merit: 11
n0nce thanks for taking the time to make the guides they are very useful as im learning the rest of how bitcoin operates. I think i like baremetal as opposed to arm is there a benefit? What about Mac Mini the latest versions with 16g of ram? i prefer mac os i know its a walled garden but most things are just done right in the os.

I'm hopeful i will get to do my first lightning transaction sometime tonight! everything is done except RTL doing it on futurebit for now but will probably migrate it to a thread ripper that i have sitting for the past 2 years or is that overkill?
newbie
Activity: 2
Merit: 0
Awesome, I postponed updating to v22 to not screw something up, it works just installing over old files as you said. Thanks!
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
Do you also maybe have a guide for updating core lightning node without losing funds/channels?
I had at least considered making one, but I believe I've never gotten around to doing it.
Usually, I put links to my guides on my webpage so they can be found easily.

But in essence, you can just install the new version (just like in the guide, but checking out latest version number) 'on top' of the old installation and it will just replace the binary; not touching your seed, channels and other existing data.
newbie
Activity: 2
Merit: 0
Do you also maybe have a guide for updating core lightning node without losing funds/channels?
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
I have a question. How does lightning daemon works normally when I've renamed the lightning directory? (lightning is the v0.11.2 directory, lightning2 is the old v0.10.2 directory which is running at the moment)

What binary does it run when I execute lightningd?

For location either of these:
Code:
whereis lightningd
which lightningd

For version:
Code:
lightningd --version

What binary does it run when I execute lightningd?
Probably the one you compiled more recently. You probably used "sudo make install" after the compilation which should have replaced old binaries.
Correct; sudo make install actually just copies the binary you just compiled into a default location on your PATH, such as /usr/local/bin/.
If there's another binary there with the same name, it is indeed replaced.

You could work around that by either renaming the old binary before sudo make install, such that it's not overwritten.
Or you could also start lightningd directly from the build directory.

Code:
bitcoin@localhost:~/lightning> ./lightningd/lightningd --version
v0.11.2
legendary
Activity: 1612
Merit: 1608
精神分析的爸
I have a question. How does lightning daemon works normally when I've renamed the lightning directory? (lightning is the v0.11.2 directory, lightning2 is the old v0.10.2 directory which is running at the moment)

What binary does it run when I execute lightningd?

Maybe try
Code:
whereis lightningd
in a shell (assuming it is in your $PATH when you execute it like that).
Pages:
Jump to: