diff --git a/.gitignore b/.gitignore index ebd21e89a..c76d6d905 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .sass-cache _site +cast/tmp* +*.xcf diff --git a/_config.yml b/_config.yml index 43951948f..f3d489201 100644 --- a/_config.yml +++ b/_config.yml @@ -8,4 +8,4 @@ aux_links: - "https://github.com/Stadicus/RaspiBolt/" # enable theme for local usage -#theme: "just-the-docs" \ No newline at end of file +#theme: "just-the-docs" diff --git a/images/00_raspibolt_v2_banner.png b/images/00_raspibolt_v2_banner.png new file mode 100644 index 000000000..ac69440f0 Binary files /dev/null and b/images/00_raspibolt_v2_banner.png differ diff --git a/images/00_raspibolt_v2_banner_440.png b/images/00_raspibolt_v2_banner_440.png new file mode 100644 index 000000000..810093067 Binary files /dev/null and b/images/00_raspibolt_v2_banner_440.png differ diff --git a/images/00_raspibolt_v2_banner_700.png b/images/00_raspibolt_v2_banner_700.png new file mode 100644 index 000000000..fd4da204a Binary files /dev/null and b/images/00_raspibolt_v2_banner_700.png differ diff --git a/images/10_bitcoinqt_directory.png b/images/10_bitcoinqt_directory.png deleted file mode 100644 index 78a732149..000000000 Binary files a/images/10_bitcoinqt_directory.png and /dev/null differ diff --git a/images/10_blockchain_wincheck.png b/images/10_blockchain_wincheck.png deleted file mode 100644 index b998a1336..000000000 Binary files a/images/10_blockchain_wincheck.png and /dev/null differ diff --git a/images/20_command_ls-la.png b/images/20_command_ls-la.png deleted file mode 100644 index e6261be5f..000000000 Binary files a/images/20_command_ls-la.png and /dev/null differ diff --git a/images/20_login.png b/images/20_login.png deleted file mode 100644 index 04a44a66f..000000000 Binary files a/images/20_login.png and /dev/null differ diff --git a/images/20_motd_welcome.png b/images/20_motd_welcome.png deleted file mode 100644 index d7d1beac0..000000000 Binary files a/images/20_motd_welcome.png and /dev/null differ diff --git a/images/20_net1_clientlist.png b/images/20_net1_clientlist.png deleted file mode 100644 index 19e5409ec..000000000 Binary files a/images/20_net1_clientlist.png and /dev/null differ diff --git a/images/20_net2_fixedip.png b/images/20_net2_fixedip.png deleted file mode 100644 index 0638cf4c8..000000000 Binary files a/images/20_net2_fixedip.png and /dev/null differ diff --git a/images/20_nofile_common-session-noninteractive.png b/images/20_nofile_common-session-noninteractive.png deleted file mode 100644 index 3418e56c5..000000000 Binary files a/images/20_nofile_common-session-noninteractive.png and /dev/null differ diff --git a/images/20_nofile_common-session.png b/images/20_nofile_common-session.png deleted file mode 100644 index aaf2ca9ac..000000000 Binary files a/images/20_nofile_common-session.png and /dev/null differ diff --git a/images/20_nofile_limits.png b/images/20_nofile_limits.png deleted file mode 100644 index 03788cb6c..000000000 Binary files a/images/20_nofile_limits.png and /dev/null differ diff --git a/images/20_pimp_prompt.png b/images/20_pimp_prompt.png deleted file mode 100644 index 23c42a4bb..000000000 Binary files a/images/20_pimp_prompt.png and /dev/null differ diff --git a/images/20_raspi-config.png b/images/20_raspi-config.png deleted file mode 100644 index 817d252bd..000000000 Binary files a/images/20_raspi-config.png and /dev/null differ diff --git a/images/20_ssh_config.png b/images/20_ssh_config.png deleted file mode 100644 index 5d82e9244..000000000 Binary files a/images/20_ssh_config.png and /dev/null differ diff --git a/images/20_ufw_status.png b/images/20_ufw_status.png deleted file mode 100644 index 39047475e..000000000 Binary files a/images/20_ufw_status.png and /dev/null differ diff --git a/images/30_checksum.png b/images/30_checksum.png deleted file mode 100644 index e973e5fcf..000000000 Binary files a/images/30_checksum.png and /dev/null differ diff --git a/images/30_show_symlink.png b/images/30_show_symlink.png deleted file mode 100644 index bbf63c413..000000000 Binary files a/images/30_show_symlink.png and /dev/null differ diff --git a/images/30_status_bitcoind.png b/images/30_status_bitcoind.png deleted file mode 100644 index 74bf816ac..000000000 Binary files a/images/30_status_bitcoind.png and /dev/null differ diff --git a/images/40_blockchain_explorer.png b/images/40_blockchain_explorer.png deleted file mode 100644 index d2c5ef771..000000000 Binary files a/images/40_blockchain_explorer.png and /dev/null differ diff --git a/images/40_checksum_lnd.png b/images/40_checksum_lnd.png deleted file mode 100644 index d9422bf7d..000000000 Binary files a/images/40_checksum_lnd.png and /dev/null differ diff --git a/images/40_cipher_seed.png b/images/40_cipher_seed.png deleted file mode 100644 index 4f1dc39f0..000000000 Binary files a/images/40_cipher_seed.png and /dev/null differ diff --git a/images/40_faucet.png b/images/40_faucet.png deleted file mode 100644 index 9b0fc998f..000000000 Binary files a/images/40_faucet.png and /dev/null differ diff --git a/images/40_ls_macaroon.png b/images/40_ls_macaroon.png deleted file mode 100644 index 02554d7ee..000000000 Binary files a/images/40_ls_macaroon.png and /dev/null differ diff --git a/images/40_start_lnd.png b/images/40_start_lnd.png deleted file mode 100644 index 10de5c95f..000000000 Binary files a/images/40_start_lnd.png and /dev/null differ diff --git a/images/40_symlink_lnd.png b/images/40_symlink_lnd.png deleted file mode 100644 index 15c12ae63..000000000 Binary files a/images/40_symlink_lnd.png and /dev/null differ diff --git a/images/50_WinSCP_connection.png b/images/50_WinSCP_connection.png deleted file mode 100644 index 039a71bfd..000000000 Binary files a/images/50_WinSCP_connection.png and /dev/null differ diff --git a/images/50_WinSCP_copy.png b/images/50_WinSCP_copy.png deleted file mode 100644 index 6018b4af7..000000000 Binary files a/images/50_WinSCP_copy.png and /dev/null differ diff --git a/images/60_eps_first-start.png b/images/60_eps_first-start.png deleted file mode 100644 index cc240b779..000000000 Binary files a/images/60_eps_first-start.png and /dev/null differ diff --git a/images/60_eps_pip_install.png b/images/60_eps_pip_install.png deleted file mode 100644 index bc304c5fa..000000000 Binary files a/images/60_eps_pip_install.png and /dev/null differ diff --git a/images/60_eps_rescan.png b/images/60_eps_rescan.png deleted file mode 100644 index daee44b8f..000000000 Binary files a/images/60_eps_rescan.png and /dev/null differ diff --git a/images/60_eps_signature.png b/images/60_eps_signature.png deleted file mode 100644 index cbb0308f9..000000000 Binary files a/images/60_eps_signature.png and /dev/null differ diff --git a/images/7_WinSCP_error_timestamp.png b/images/7_WinSCP_error_timestamp.png deleted file mode 100644 index d96284359..000000000 Binary files a/images/7_WinSCP_error_timestamp.png and /dev/null differ diff --git a/index.md b/index.md index 61ede56d9..7d3dba2a3 100644 --- a/index.md +++ b/index.md @@ -12,7 +12,11 @@ I love to tinker and build stuff. I am also fascinated with digital currencies, so I recently built my own Bitcoin / Lightning Full Node with a simple low-cost Raspberry Pi. I now basically run my own bank using free open-source software and some cheap hardware. -![RaspiBolt Logo](images/00_raspibolt_banner_440.png) +![RaspiBolt Logo](images/00_raspibolt_v2_banner_440.png){:target="_blank"} + +--- + +The **RaspiBolt version 2** builds on the Raspberry Pi 4. If you're looking for the old version: [check out the old source files on GitHub](https://github.com/Stadicus/RaspiBolt/blob/1.0/index.md). --- @@ -62,8 +66,9 @@ I am not a systems specialist, so please feel free to point out improvements. 1. [Raspberry Pi](raspibolt_20_pi.md): set up and configure the Pi as a Linux server 1. [Security](raspibolt_21_security.md): secure and harden your installation 1. [Privacy](raspibolt_22_privacy.md): configure Tor networking for improved privacy -1. [Bitcoin](raspibolt_30_bitcoin.md): install and configure Bitcoin Core as a fully validating node -1. [Lightning](raspibolt_40_lnd.md): install and configure the Lightning Network Daemon (LND) +1. [Bitcoin](raspibolt_30_bitcoin.md): run Bitcoin Core as a fully validating node +1. [Lightning](raspibolt_40_lnd.md): spin up the Lightning Network Daemon (LND) +1. [Electrum](raspibolt_50_electrs.md): use your node with Hardware Wallets 1. [FAQ](raspibolt_faq.md): frequently asked questions and further reading 1. [Updates](raspibolt_updates.md): keep track of changes @@ -80,7 +85,7 @@ This server is set up without graphical user interface and is used remotely usin **The good old days**: this was the original goal of this guide, back in 2017, simply buying a Blockaccino. -[![Buying a Blockaccino](images/00_blockaccino_goal.png)](https://vimeo.com/258395303) +[![Buying a Blockaccino](images/00_blockaccino_goal.png)](https://vimeo.com/258395303){:target="_blank"} ### Target audience diff --git a/raspibolt_10_preparations.md b/raspibolt_10_preparations.md index 2cbf5149e..5b0ccae53 100644 --- a/raspibolt_10_preparations.md +++ b/raspibolt_10_preparations.md @@ -26,22 +26,21 @@ This amazing piece of hardware is a tiny computer-on-a-chip, costs about $35 and It is advisable to get the latest Raspberry Pi for good performance: -* Raspberry Pi 4, 2+ GB RAM +* Raspberry Pi 4, with 4 GB RAM * Micro SD card: 8 GB or more, incl. adapter to your regular computer * strong USB power adapter: 5V/3A + USB-C cable -* External hard disk: 500 GB or more -* Optional: Raspberry Pi case +* external hard disk: 500 GB or more +* optional: Raspberry Pi case ![Raspberry Pi](images/10_raspberrypi_hardware.png) -*Raspberry Pi 4: a tiny computer for $50* + +*Raspberry Pi 4: a tiny but quite powerful computer for $50* To run a Lightning node, the full Bitcoin blockchain must be stored locally, which is ~250 GB and growing. You can buy a cheap hard disk enclosure and reuse an old 500 GB hard disk. I recommend getting a modern 2.5" SSD that can be powered through the USB connection to the Pi directly, which also speeds up initial sync time significantly. -## Assembly - -TODO +--- ## Write down your passwords diff --git a/raspibolt_20_pi.md b/raspibolt_20_pi.md index 3118ee510..a5cf643b7 100644 --- a/raspibolt_20_pi.md +++ b/raspibolt_20_pi.md @@ -24,8 +24,8 @@ We configure the Raspberry Pi and install the Linux operating system. The node runs headless, that means without keyboard or display, so the operating system Raspbian Buster Lite is used. -1. Download the [Raspbian Buster Lite](https://www.raspberrypi.org/downloads/raspbian/) disk image -2. Write the disk image to your SD card with [this guide](https://www.raspberrypi.org/documentation/installation/installing-images/README.md) +1. Download the [Raspbian Buster Lite](https://www.raspberrypi.org/downloads/raspbian/){:target="_blank"} disk image +2. Write the disk image to your SD card with [this guide](https://www.raspberrypi.org/documentation/installation/installing-images/README.md){:target="_blank"} ### Enable Secure Shell @@ -53,7 +53,7 @@ To avoid using a network cable for the initial setup, you can pre-configure the } ``` -* Replace `[COUNTRY_CODE]` with the [ISO2 code](https://www.iso.org/obp/ui/#search) of your country (eg. `US`) +* Replace `[COUNTRY_CODE]` with the [ISO2 code](https://www.iso.org/obp/ui/#search){:target="_blank"} of your country (eg. `US`) * Replace `[WIFI_SSID]` and `[WIFI_PASSWORD]` with the credentials for your own WiFi. ### Start your Pi @@ -74,7 +74,7 @@ Finding it can be a bit tricky without a screen. If you're lucky, you don't need to know this address and can just connect using mDNS. * On your regular computer, open the Terminal (also known as "command line"). - Here are a few links with additional details for [Windows](https://www.computerhope.com/issues/chusedos.htm), [MacOS](https://macpaw.com/how-to/use-terminal-on-mac) and [Linux](https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/). + Here are a few links with additional details for [Windows](https://www.computerhope.com/issues/chusedos.htm), [MacOS](https://macpaw.com/how-to/use-terminal-on-mac){:target="_blank"} and [Linux](https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/){:target="_blank"}. * Try to ping the Raspberry Pi local hostname (press `Ctrl`-`C` to ) @@ -89,7 +89,7 @@ If you're lucky, you don't need to know this address and can just connect using Proceed directly to the next section. * If the `ping` command fails or does not return anything, you need to manually look for your Pi. - As this is a common challenge, just follow the official Raspberry Pi guideance on how to find your [IP Address](https://www.raspberrypi.org/documentation/remote-access/ip-address.md.) + As this is a common challenge, just follow the official Raspberry Pi guideance on how to find your [IP Address](https://www.raspberrypi.org/documentation/remote-access/ip-address.md.){:target="_blank"}. * You should now be able to reach your Pi, either with the hostname `raspberrypi.local` or an IP address like `192.168.0.20`. @@ -107,14 +107,14 @@ If you need to provide connection details, use the following settings: Install and start the SSH client for your operating system: -* Windows: PuTTY ([Website](https://www.putty.org)) +* Windows: PuTTY ([Website](https://www.putty.org){:target="_blank"}) * MacOS and Linux: from the Terminal, use the native command: * `ssh pi@raspberrypi.local` or * `ssh pi@192.168.0.20` -🔍 *more: [using SSH with Raspberry Pi](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md)* +🔍 *more: [using SSH with Raspberry Pi](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md){:target="_blank"}* --- @@ -215,7 +215,7 @@ $ sudo apt install htop git curl bash-completion jq qrencode dphys-swapfile hdpa -### Add user "admin" +### Add users This guide uses the main user "admin" instead of "pi" to make it more reusable with other platforms. @@ -232,8 +232,6 @@ This guide uses the main user "admin" instead of "pi" to make it more reusable w $ sudo passwd root ``` -### Add the service user “bitcoin” - The bitcoin and lightning processes will run in the background (as a "daemon") and use the separate user “bitcoin” for security reasons. This user does not have admin rights and cannot change the system configuration. @@ -280,7 +278,7 @@ The Raspberry Pi 4 supports USB3 drives, but is very picky. A lot of USB3 adapters for external drives are not compatible and need a manual workaround to be usable. We will now check if your drive works well as-is, or if additional configuration is needed. -🔍 *more: [Raspberry Pi forum: bad performance with USB3 SSDs](https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931)* +🔍 *more: [Raspberry Pi forum: bad performance with USB3 SSDs](https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931){:target="_blank"}* * First, lets get some information about your drive from the kernel messages. Clear the kernel buffer, and follow the new messages (let the last command run): @@ -382,7 +380,7 @@ We will now check if your drive works well as-is, or if additional configuration * You should see a significant increase in performance. If the test still shows a very slow read speed, your drive or USB adapter might not be compatible with the Raspberry Pi. - In that case I recommend visiting the Raspberry Pi [Troubleshooting forum](https://www.raspberrypi.org/forums/viewforum.php?f=28&sid=5ec5f1c6932c834c8222dfbbb3d5c9ef) or simply try out hardware alternatives. + In that case I recommend visiting the Raspberry Pi [Troubleshooting forum](https://www.raspberrypi.org/forums/viewforum.php?f=28&sid=5ec5f1c6932c834c8222dfbbb3d5c9ef){:target="_blank"} or simply try out hardware alternatives. @@ -410,7 +408,7 @@ We will now check if your drive works well as-is, or if additional configuration UUID=123456 /mnt/ext ext4 rw,nosuid,dev,noexec,noatime,nodiratime,auto,nouser,async,nofail 0 2 ``` - 🔍 *more: [complete fstab guide](http://www.linuxstall.com/fstab)* + 🔍 *more: [complete fstab guide](http://www.linuxstall.com/fstab){:target="_blank"}* * Create the directory to add the hard disk and set the correct owner @@ -468,7 +466,7 @@ We will now check if your drive works well as-is, or if additional configuration -🔍 *more: [external storage configuration](https://www.raspberrypi.org/documentation/configuration/external-storage.md)* +🔍 *more: [external storage configuration](https://www.raspberrypi.org/documentation/configuration/external-storage.md){:target="_blank"}* --- diff --git a/raspibolt_21_security.md b/raspibolt_21_security.md index 3c5a29153..0ebf94c69 100644 --- a/raspibolt_21_security.md +++ b/raspibolt_21_security.md @@ -52,7 +52,7 @@ $ exit -🔍 *more: [UFW Essentials](https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands)* +🔍 *more: [UFW Essentials](https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands){:target="_blank"}* 💡 If you find yourself locked out by mistake, you can connect keyboard and screen to your Pi to log in locally and fix these settings (especially for the SSH port 22). @@ -66,7 +66,7 @@ The firewall blocks all login attempts from outside your network, but additional The first measure is to install “fail2ban”, a service that cuts off any system with five failed login attempts for ten minutes. This makes a brute-force attack unfeasible, as it would simply take too long. -![fail2ban](images/20_fail2ban.png) +![fail2ban](images/20_fail2ban.png){:target="_blank"} *Me locking myself out by entering wrong passwords* ```sh @@ -77,7 +77,7 @@ The initial configuration should be fine as it is enabled for SSH by default. -🔍 *more: [customize fail2ban configuration](https://linode.com/docs/security/using-fail2ban-for-security/)* +🔍 *more: [customize fail2ban configuration](https://linode.com/docs/security/using-fail2ban-for-security/){:target="_blank"}* --- @@ -88,11 +88,11 @@ Only someone with physical possession of the private key can login. ### Generate keys on Windows -Follow this guide [Configure “No Password SSH Keys Authentication” with PuTTY on Linux Servers](https://www.tecmint.com/ssh-passwordless-login-with-putty) +Follow this guide [Configure “No Password SSH Keys Authentication” with PuTTY on Linux Servers](https://www.tecmint.com/ssh-passwordless-login-with-putty){:target="_blank"} * You should have generated three new files. Keep them safe! - ![SSH keys files](images/20_ssh_keys_filelist.png) + ![SSH keys files](images/20_ssh_keys_filelist.png){:target="_blank"} ### Generate keys on Mac / Linux @@ -165,21 +165,21 @@ root soft nofile 128000 root hard nofile 128000 ``` -![Edit pam.d/limits.conf](images/20_nofile_limits.png) +![Edit pam.d/limits.conf](images/20_nofile_limits.png){:target="_blank"} ```sh $ sudo nano /etc/pam.d/common-session session required pam_limits.so ``` -![Edit pam.d/common-session](images/20_nofile_common-session.png) +![Edit pam.d/common-session](images/20_nofile_common-session.png){:target="_blank"} ```sh $ sudo nano /etc/pam.d/common-session-noninteractive session required pam_limits.so ``` -![Edit pam.d/common-session-noninteractive](images/20_nofile_common-session-noninteractive.png) +![Edit pam.d/common-session-noninteractive](images/20_nofile_common-session-noninteractive.png){:target="_blank"} --- diff --git a/raspibolt_22_privacy.md b/raspibolt_22_privacy.md index 8699a027a..811040dbd 100644 --- a/raspibolt_22_privacy.md +++ b/raspibolt_22_privacy.md @@ -21,7 +21,7 @@ We configure Tor to run your node anonymously. Running your own Bitcoin and Lightning node at home makes you a direct, sovereign peer on the Bitcoin network. If not configured without privacy in mind, it also tells the world that there is someone with Bitcoin at that address. -True, it's only your IP address that is visible to others, but using services like [iplocation.net](https://www.iplocation.net), your physical address can be determined quite accurately. +True, it's only your IP address that is visible to others, but using services like [iplocation.net](https://www.iplocation.net){:target="_blank"}, your physical address can be determined quite accurately. Especially with Lightning, your IP address is widely used, so we need to make sure that you keep your privacy. @@ -29,7 +29,7 @@ Especially with Lightning, your IP address is widely used, so we need to make su ## Tor Project -We will use Tor, a free software built by the [Tor Project](https://www.torproject.org), that allows you to anonymize internet traffic by routing it through a network of nodes, hiding your location and usage profile. +We will use Tor, a free software built by the [Tor Project](https://www.torproject.org){:target="_blank"}, that allows you to anonymize internet traffic by routing it through a network of nodes, hiding your location and usage profile. It is called "Tor" for "The Onion Router": information is encrypted multiple times with the public keys of the nodes it passes through. Each node decrypts the layer of information that corresponds to its own private key, knowing only the last and next hop of the route, like peeling an onion, until the data reaches its destination. diff --git a/raspibolt_30_bitcoin.md b/raspibolt_30_bitcoin.md index c7f2cc9fe..6c8dcb7f9 100644 --- a/raspibolt_30_bitcoin.md +++ b/raspibolt_30_bitcoin.md @@ -22,7 +22,7 @@ Let's get your Bitcoin full node operational. ## Bitcoin Core The base of a sovereign Bitcoin node is a fully validating Bitcoin client. -We are using [Bitcoin Core](https://bitcoin.org/en/bitcoin-core/), the reference implementation, but not the only option available. +We are using [Bitcoin Core](https://bitcoin.org/en/bitcoin-core/){:target="_blank"}, the reference implementation, but not the only option available. This application will download the whole blockchain from other peers and validate every single transaction that ever happened. After validation, the client can check all future transactions whether they are valid or not. @@ -44,7 +44,7 @@ This is a precaution to make sure that this is an official release and not a mal cd /tmp ``` -* Get the latest download links at [bitcoincore.org/en/download](https://bitcoincore.org/en/download) (ARM Linux 32 bit), they change with each update. +* Get the latest download links at [bitcoincore.org/en/download](https://bitcoincore.org/en/download){:target="_blank"} (ARM Linux 32 bit), they change with each update. Then run the following commands (with adjusted filenames) and check the output where indicated: ```sh @@ -137,7 +137,7 @@ maxuploadtarget=5000 -🔍 *more: [configuration options](https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments) in Bitcoin Wiki* +🔍 *more: [configuration options](https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments){:target="_blank"} in Bitcoin Wiki* --- @@ -304,17 +304,17 @@ This can take up to a week when using a Raspberry Pi 4, depending mostly on your If everything is running smoothly, this is the perfect time to familiarize yourself with Bitcoin, the technical aspects of Bitcoin Core and play around with `bitcoin-cli` until the blockchain is up-to-date. -* [**The Little Bitcoin Book**](https://littlebitcoinbook.com) is a fantastic introduction to Bitcoin, focusing on the "why" and less on the "how". +* [**The Little Bitcoin Book**](https://littlebitcoinbook.com){:target="_blank"} is a fantastic introduction to Bitcoin, focusing on the "why" and less on the "how". -* [**Mastering Bitcoin**](https://bitcoinbook.info) by Andreas Antonopoulos is a great point to start, especially chapter 3 (ignore the first part how to compile from source code): - * you definitely need to have a [real copy](https://bitcoinbook.info/) of this book! - * read it online on [Github](https://github.com/bitcoinbook/bitcoinbook) +* [**Mastering Bitcoin**](https://bitcoinbook.info){:target="_blank"} by Andreas Antonopoulos is a great point to start, especially chapter 3 (ignore the first part how to compile from source code): + * you definitely need to have a [real copy](https://bitcoinbook.info/){:target="_blank"} of this book! + * read it online on [Github](https://github.com/bitcoinbook/bitcoinbook){:target="_blank"} - ![Mastering Bitcoin](images/30_mastering_bitcoin_book.jpg) + ![Mastering Bitcoin](images/30_mastering_bitcoin_book.jpg){:target="_blank"} -* [**Learning Bitcoin from the Command Line**](https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/README.md) by Christopher Allen gives a thorough deep dive into understanding the technical aspects of Bitcoin. +* [**Learning Bitcoin from the Command Line**](https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line/blob/master/README.md){:target="_blank"} by Christopher Allen gives a thorough deep dive into understanding the technical aspects of Bitcoin. -* Also, check out the [bitcoin-cli reference](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) +* Also, check out the [bitcoin-cli reference](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list){:target="_blank"} --- diff --git a/raspibolt_40_lnd.md b/raspibolt_40_lnd.md index 8b5b300da..ca5b135fb 100644 --- a/raspibolt_40_lnd.md +++ b/raspibolt_40_lnd.md @@ -7,7 +7,7 @@ nav_order: 40 # Lightning: LND {: .no_toc } -We set up LND, the Lightning Network Daemon by [Lightning Labs](http://lightning.engineering/). +We set up LND, the Lightning Network Daemon by [Lightning Labs](http://lightning.engineering/){:target="_blank"}. --- @@ -21,7 +21,7 @@ We set up LND, the Lightning Network Daemon by [Lightning Labs](http://lightning ## Installation -The installation of LND is straight-forward, but the application is quite powerful and capable of things not explained here. Check out their [Github repository](https://github.com/lightningnetwork/lnd/blob/master/README.md) for a wealth of information about their open-source project and Lightning in general. +The installation of LND is straight-forward, but the application is quite powerful and capable of things not explained here. Check out their [Github repository](https://github.com/lightningnetwork/lnd/blob/master/README.md){:target="_blank"} for a wealth of information about their open-source project and Lightning in general. ### Dowload @@ -99,7 +99,7 @@ Now that LND is installed, we need to configure it to work with Bitcoin Core and tor.streamisolation=true ``` -🔍 *more: [sample-lnd.conf](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf) with all possible options in the LND project repository* +🔍 *more: [sample-lnd.conf](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf){:target="_blank"} with all possible options in the LND project repository* @@ -150,7 +150,7 @@ These 24 words, combined with your passphrase (optional `password [D]`) is all -💡 _In this screencast I use the awesome [`tmux`](https://www.ocf.berkeley.edu/~ckuehl/tmux/) to run multiple Terminal sessions in parallel. +💡 _In this screencast I use the awesome [`tmux`](https://www.ocf.berkeley.edu/~ckuehl/tmux/){:target="_blank"} to run multiple Terminal sessions in parallel. But you can just connect to your RaspiBolt with two separate SSH sessions._ ### Authorization for "admin" @@ -310,7 +310,7 @@ Up until now, you can just start over. Once you send real bitcoin to your RaspiBolt, you have "skin in the game". * Make sure your RaspiBolt is working as expected. -* Get a little practice with `bitcoin-cli` and its options (see [Bitcoin Core RPC documentation](https://bitcoin-rpc.github.io/)) +* Get a little practice with `bitcoin-cli` and its options (see [Bitcoin Core RPC documentation](https://bitcoin-rpc.github.io/){:target="_blank"}) * Try a few restarts (`sudo reboot`), is everything starting fine? ### Funding your Lightning node diff --git a/raspibolt_50_mainnet.md b/raspibolt_50_mainnet.md deleted file mode 100644 index 1d500ace1..000000000 --- a/raspibolt_50_mainnet.md +++ /dev/null @@ -1,260 +0,0 @@ ---- -layout: default -title: Mainnet -nav_order: 50 ---- -# Mainnet -{: .no_toc } - -## Table of contents -{: .no_toc .text-delta } - -1. TOC -{:toc} - -Are you feeling comfortable to put real bitcoin on the line? Here's how to do it. - -⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ - -But first: if you are not comfortable with learning Linux more in-depth on your own or even compile a program from source, chances are that you lose some funds sooner or later. The Lightning Network is not production-ready yet and LND is still in beta. - -``` -Personal disclaimer: This guide is provided as-is and without any guarantees. Most components are -under development and this guide may contain factual errors that result in the loss of your bitcoin. -Use this guide at your own risk. -``` -``` -Lightning Labs disclaimer: As this is the first mainnet release of lnd, we recommend that users -experiment with only small amounts (#craefulgang #craefulgang #craefulgang). -``` - -⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ - -Still want to try it? Proceed at your own risk. - -## Copy the mainnet blockchain - -The current setup runs on Bitcoin testnet. Right at the beginning, however, we started downloading the Bitcoin mainnet blockchain on your regular computer. Check the verification progress directly in Bitcoin Core on this computer. To proceed, it should be fully synced (see status bar). - -As soon as the verification is finished, shut down Bitcoin Core on Windows. We will now copy the whole data structure to the RaspiBolt. This takes about 6 hours. - -### Temporarily enable password login -In order to copy the data with the user "bitcoin", we need to temporarily enable the password login. - -* As user "admin", edit the SSH config file and put a `#` in front of "PasswordAuthentication no" to disable the whole line. Save and exit. - `$ sudo nano /etc/ssh/sshd_config` - `# PasswordAuthentication no` - -* Restart the SSH daemon. - `$ sudo systemctl restart ssh` - -### Copy using WinSCP -We are using "Secure Copy" (SCP), so [download and install WinSCP](https://winscp.net), a free open-source program. - -* With WinSCP, you can now connect to your Pi with the user "bitcoin". -![WinSCP connection settings](images/50_WinSCP_connection.png) - -* Accept the server certificate and navigate to the local and remote bitcoin directories: - * Local: `d:\bitcoin\bitcoin_mainnet\` - * Remote: `\mnt\hdd\bitcoin\` - -* You can now copy the two subdirectories `blocks` and `chainstate` from Local to Remote. This will take about 6 hours. -![WinSCP copy](images/50_WinSCP_copy.png) - -:warning: The transfer must not be interupted. Make sure your computer does not go to sleep. - -:point_right:_ Additional information: [Bitcoin Core data directory structure](https://en.bitcoin.it/wiki/Data_directory) - -### Disable password login again -* As user "admin", remove the `#` in front of "PasswordAuthentication no" to enable the line. Save and exit. - `$ sudo nano /etc/ssh/sshd_config` - `PasswordAuthentication no` - -* Restart the SSH daemon. - `$ sudo systemctl restart ssh` - -## Send back your testnet Bitcoin - -To avoid burning our testnet Bitcoin, and as a courtesy to the next testers, we close all our channels and withdraw the funds to the address stated on the website of the [Bitcoin Testnet Faucet](https://testnet.manu.backend.hamburg/faucet). - -* `$ lncli --network=testnet closeallchannels` - -* Wait unitl the the channel balance is zero and the funds to be back in our on-chain wallet. - `$ lncli --network=testnet channelbalance` - `$ lncli --network=testnet walletbalance` - -- Send the amount provided by `walletbalance` minus 500 satoshis to account for fees. If you get an "insufficient funds" error, deduct a bit more until the transaction gets broadcasted. - `$ lncli --network=testnet sendcoins 2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF [amount]` - -## Adjust configuration - -* Stop the Bitcoin and Lightning services. - `$ sudo systemctl stop lnd` - `$ sudo systemctl stop bitcoind` - -* Edit "bitcoin.conf" file by commenting `testnet=1` out. Save and exit. - `$ sudo nano /home/bitcoin/.bitcoin/bitcoin.conf` -``` -# remove the following line to enable Bitcoin mainnet -#testnet=1 -``` - -* Copy updated "bitcoin.conf" to user "admin" for credentials - `$ sudo cp /home/bitcoin/.bitcoin/bitcoin.conf /home/admin/.bitcoin/` - - -* Edit "lnd.conf" file by switching from `bitcoin.testnet=1` to `bitcoin.mainnet=1`. Save and exit. - `$ sudo nano /home/bitcoin/.lnd/lnd.conf` -``` -# enable either testnet or mainnet -#bitcoin.testnet=1 -bitcoin.mainnet=1 -``` -## Restart bitcoind & lnd for mainnet - -:warning: **Do not proceed** until the copy task of the mainnet blockchain is completely finished. - -* Start Bitcoind and check if it's operating on mainnet (you can exit the debug.log with `Ctrl-C`) - - ``` - $ sudo systemctl start bitcoind - $ systemctl status bitcoind.service - $ sudo tail -f /home/bitcoin/.bitcoin/debug.log - $ bitcoin-cli getblockchaininfo - ``` - -* **Wait until the blockchain is fully synced**: "blocks" = "headers", otherwise you might run into performance / memory issues when creating a new lnd mainnet wallet. - -* Start LND and check its operation - - ``` - $ sudo systemctl start lnd - $ systemctl status lnd - $ sudo journalctl -f -u lnd - ``` - - If everything works fine, restart the RaspiBolt and check the operations again. - `$ sudo shutdown -r now` - -* Monitor the startup process of first `bitcoind` and then `lnd` - - ``` - $ sudo tail -f /home/bitcoin/.bitcoin/debug.log - $ sudo journalctl -f -u lnd - ``` - -* Create the mainnet wallet with the **exact same** `password [C]` as on testnet. If you use another password, you need to recreate your access credentials. - `$ lncli create ` - -* Copy permission files and TLS cert to user "admin" to use `lncli` - - ``` - $ sudo cp /home/bitcoin/.lnd/tls.cert /home/admin/.lnd - $ cd /home/bitcoin/ - $ sudo cp --parents .lnd/data/chain/bitcoin/mainnet/admin.macaroon /home/admin/ - $ sudo chown admin:admin /home/admin/.lnd/ -R - ``` - -* Restart `lnd` and unlock your wallet (enter `password [C]` ) - - ``` - $ sudo systemctl restart lnd - $ lncli unlock - ``` - -* Monitor the LND startup progress until it caught up with the mainnet blockchain (about 515k blocks at the moment). This can take up to 2 hours, then you see a lot of very fast chatter (exit with `Ctrl-C`). - `$ sudo journalctl -f -u lnd` - -* Make sure that `lncli` works by getting some node infos - `$ lncli getinfo` - -:point_right: **Important**: you need to manually unlock the lnd wallet after each restart of the lnd service! - -## Start using the Lightning Network - -### Fund your node - -Congratulations, your RaspiBolt is live on the Bitcoin mainnet! To open channels and start using it, you need to fund it with some bitcoin. For starters, put only on your node what you are willing to lose. Monopoly money. - -* Generate a new Bitcoin address to receive funds on-chain - `$ lncli newaddress np2wkh` - `> "address": "3.........................."` - -* From your regular Bitcoin wallet, send a small amount of bitcoin to this address - -* Check your LND wallet balance - `$ lncli walletbalance` - -* Monitor your transaction on a Blockchain explorer: - https://smartbit.com.au - -### LND in action - -As soon as your funding transaction is mined and confirmed, LND will start to open and maintain channels. This feature is called "Autopilot" and is configured in the "lnd.conf" file. If you would like to maintain your channels manually, you can disable the autopilot. - -Some commands to try: - -* list all arguments for the command line interface (cli) - `$ lncli` - -* get help for a specific argument - `$ lncli help [ARGUMENT]` - -* find out some general stats about your node: - `$ lncli getinfo` - -* connect to a peer (you can find some nodes to connect to here: https://1ml.com/): - `$ lncli connect [NODE_URI]` - -* check the peers you are currently connected to: - `$ lncli listpeers` - -* open a channel with a peer: - `$ lncli openchannel [NODE_PUBKEY] [AMOUNT_IN_SATOSHIS] 0` - *keep in mind that [NODE_URI] includes @IP:PORT at the end, while [NODE_PUBKEY] doesn't* - -* check the status of your pending channels: - `$ lncli pendingchannels` - -* check the status of your active channels: - `$ lncli listchannels` - -* before paying an invoice, you should decode it to check if the amount and other infos are correct: - `$ lncli decodepayreq [INVOICE]` - -* pay an invoice: - `$ lncli payinvoice [INVOICE]` - -* check the payments that you sent: - `$ lncli listpayments` - -* create an invoice: - `$ lncli addinvoice [AMOUNT_IN_SATOSHIS]` - -* list all invoices: - `$ lncli listinvoices` - -* to close a channel, you need the following two arguments that can be determined with `listchannels` and are listed as "channelpoint": `FUNDING_TXID` : `OUTPUT_INDEX` . - `$ lncli listchannels` - `$ lncli closechannel [FUNDING_TXID] [OUTPUT_INDEX]` - -* to force close a channel (if your peer is offline or not cooperative), use - `$ lncli closechannel --force [FUNDING_TXID] [OUTPUT_INDEX] ` - -👉 see [LND API reference](http://api.lightning.community/) for additional information - -### Try it out -If you enjoyed this guide, take your new shiny Lightning node for a spin and send me a little tip! - -
- - -### Explore Lightning mainnet -There are a lot of great resources to explore the Lightning mainnet in regard to your own node. - -* [Recksplorer](https://rompert.com/recksplorer/): Lightning Network Map -* [1ML](https://1ml.com): Lightning Network Search and Analysis Engine -* [lnroute.com](http://lnroute.com): comprehensive Lightning Network resources list - ---- -Next: [Bonus >>](raspibolt_60_bonus.md) diff --git a/raspibolt_60_bonus.md b/raspibolt_60_bonus.md index b22003270..ea82a7460 100644 --- a/raspibolt_60_bonus.md +++ b/raspibolt_60_bonus.md @@ -5,15 +5,25 @@ nav_order: 60 has_children: true has_toc: false --- + + # Bonus Section {: .no_toc } +--- + +🚨 This section has not been updated to **RaspiBolt v2** yet. +There might be some inconsistencies with the updated configuration, so handle with care! + +--- ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} +--- + In this section, you can find various optional topics that make your RaspiBolt running even smoother. I split this up in various subsections, as the individual tasks can be quite long. ## [System overview](raspibolt_61_system-overview.md) diff --git a/raspibolt_72_zap-ios.md b/raspibolt_72_zap-ios.md index ceff1a5c4..0717d9a9e 100644 --- a/raspibolt_72_zap-ios.md +++ b/raspibolt_72_zap-ios.md @@ -90,7 +90,7 @@ The nifty helper tool LND Connect helps to pair the RaspiBolt with the iPhone, e 🚨 REMEMBER: If you change `lnd.conf` you need to delete & recreate the `tls.cert`, and also re-create and re-scan the QR code from the Zap iOS app. Do not forget to copy the new `tls.cert` and `admin.macaroon` files to the admin user. -👉 It is perfectly possible to use Zap iOS on-the-go (from the public internet) and connect to your node at home, but this involves creating new TLS certificates and reduces security. You need to set `tlsextraip=