diff --git a/electrs/electrs_install_on_RaspiBlitz.sh b/electrs/1_electrs_on_RaspiBlitz.sh similarity index 100% rename from electrs/electrs_install_on_RaspiBlitz.sh rename to electrs/1_electrs_on_RaspiBlitz.sh diff --git a/electrs/2_electrs_systemd_service.sh b/electrs/2_electrs_systemd_service.sh new file mode 100644 index 0000000..32a457c --- /dev/null +++ b/electrs/2_electrs_systemd_service.sh @@ -0,0 +1,35 @@ +# Install the electrs systemd service. +# Prerequisite: 1_electrs_on_RaspiBlitz.sh + +# To download and run: +# $ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/2_electrs_systemd_service.sh && bash 2_electrs_systemd_service.sh + +echo "" +echo "***" +echo "Type the PASSWORD B of your RaspiBlitz followed by [ENTER] for the electrs service:" +read PASSWORD_B + +# sudo nano /etc/systemd/system/electrs.service +echo " +[Unit] +Description=Electrs +After=bitcoind.service + +[Service] +WorkingDirectory=/home/admin/electrs +ExecStart=/home/admin/electrs/target/release/electrs --index-batch-size=10 --jsonrpc-import --db-dir /mnt/hdd/electrs/db --electrum-rpc-addr="0.0.0.0:50001" --cookie="raspibolt:$PASSWORD_B" + +User=admin +Group=admin +Type=simple +KillMode=process +TimeoutSec=60 +Restart=always +RestartSec=60 + +[Install] +WantedBy=multi-user.target +" | sudo tee -a /etc/systemd/system/electrs.service + +sudo systemctl enable electrs +sudo systemctl start electrs \ No newline at end of file diff --git a/electrs/electrs_automation_for_Eclair.sh b/electrs/3_Nginx_and_Certbot_for_SSL.sh similarity index 98% rename from electrs/electrs_automation_for_Eclair.sh rename to electrs/3_Nginx_and_Certbot_for_SSL.sh index 2cc8e3d..b48029f 100644 --- a/electrs/electrs_automation_for_Eclair.sh +++ b/electrs/3_Nginx_and_Certbot_for_SSL.sh @@ -2,7 +2,7 @@ # Sets up the automatic start of electrs and nginx and certbot # To download and run: -# $ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/electrs_automation_for_Eclair.sh && bash electrs_automation_for_Eclair.sh +# $ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/3_Nginx_and_Certbot_for_SSL.sh && bash 3_Nginx_and_Certbot_for_SSL.sh # For the certificate to be obtained successfully a dynamic DNS and port forwarding is needed # Need to forward port 80 to the IP of your RaspiBlitz for certbot diff --git a/electrs/electrum_install_config_and_run.sh b/electrs/4_electrum_install.sh similarity index 90% rename from electrs/electrum_install_config_and_run.sh rename to electrs/4_electrum_install.sh index 3daf022..c231a5a 100644 --- a/electrs/electrum_install_config_and_run.sh +++ b/electrs/4_electrum_install.sh @@ -1,7 +1,5 @@ -# Download this script to your linux desktop: -# $ wget https://gist.github.com/openoms/8d365f330f5e1288933e0f4874b56dbd/raw/2cf47bf5cc629e861540f4dd5fa525fd157fc341/electrum_install_config_and_run.sh -# and run: -# $ bash electrum_install_config_and_run.sh +# Download and run this script to the Linux desktop: +# $ wget https://gist.github.com/openoms/8d365f330f5e1288933e0f4874b56dbd/raw/2cf47bf5cc629e861540f4dd5fa525fd157fc341/4_electrum_install && bash 4_electrum_install.sh # https://electrum.org/#download # Install dependencies: diff --git a/electrs/README.md b/electrs/README.md index 8166ad8..52dbd43 100644 --- a/electrs/README.md +++ b/electrs/README.md @@ -1,6 +1,9 @@ ## RaspiBlitz: install the Electrum Server in Rust (electrs) -Based on https://github.com/romanz/electrs/blob/master/doc/usage.md -Some shared experiences here: https://github.com/rootzoll/raspiblitz/issues/123 +Based on https://github.com/romanz/electrs/blob/master/doc/usage.md +Shared experiences here: https://github.com/rootzoll/raspiblitz/issues/123 and https://github.com/openoms/bitcoin-tutorials/issues/2 + + +\`The server indexes the entire Bitcoin blockchain, and the resulting index enables fast queries for any given user wallet, allowing the user to keep real-time track of his balances and his transaction history using the Electrum wallet. Since it runs on the user's own machine, there is no need for the wallet to communicate with external Electrum servers, thus preserving the privacy of the user's addresses and balances.\` - [https:/github.com/romanz/electrs](https:/github.com/romanz/electrs) Tested on the * Odroid HC1 and XU4 (~18 hours) @@ -8,40 +11,55 @@ Tested on the Requires 47 Gb diskpace (March 2019). -The install instructions adapted to the RaspiBlitz are in this script, take a look: [electrs_install_on_RaspiBlitz.sh](electrs_install_on_RaspiBlitz.sh) +The install instructions adapted to the RaspiBlitz are in this script, take a look: [1_electrs_on_RaspiBlitz.sh](1_electrs_on_RaspiBlitz.sh) To download and run on the RaspiBlitz:: -`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/electrs_install_on_RaspiBlitz.sh && bash electrs_install_on_RaspiBlitz.sh` +`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/1_electrs_on_RaspiBlitz.sh && bash 1_electrs_on_RaspiBlitz.sh` + +This will only run the server until the terminal window is open. +To restart electrs manually run (with your PASSWORD_B filled in): +`/home/admin/electrs/target/release/electrs --index-batch-size=10 --jsonrpc-import --db-dir /mnt/hdd/electrs/db --electrum-rpc-addr="0.0.0.0:50001" --cookie="raspibolt:PASSWORD_B"` --- +## RaspiBlitz: Set up the Electrs systemd service -## RaspiBlitz: Set up the Electrs systemd service and connect over SSL +Set up the systemd service to run electrs continuously in the background. + +Take a look: [2_electrs_systemd_service.sh](2_electrs_systemd_service.sh) + +To download and run: +`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/2_electrs_systemd_service.sh && bash 2_electrs_systemd_service.sh` + +## RaspiBlitz: install Nginx and Certbot to connect over SSL For the SSL certificate to be obtained successfully a **dynamic DNS** and **port forwarding is necessary**. +Forward the port 80 to the IP of your RaspiBlitz for Certbot. +Forward the port 50002 to be able to access electrs from the outside of your LAN (optional). -The script sets up the automatic start of electrs, Nginx and certbot. +The script sets up the automatic start Nginx and Certbot. -Assumes that electrs was installed already with the [latter script](https://github.com/openoms/bitcoin-tutorials/blob/master/electrs/.README.md#raspiblitz-install-the-electrum-server-in-rust-electrs). +Assumes that electrs is already installed. Can be used as a secure backend of: Eclair Mobile Bitcoin and Ligthtning wallet Electrum wallet -Take a look: [electrs_automation_for_Eclair.sh](electrs_automation_for_Eclair.sh) +Take a look: [3_Nginx_and_Certbot_for_SSL](3_Nginx_and_Certbot_for_SSL.sh) To download and run on the RaspiBlitz: -`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/electrs_automation_for_Eclair.sh && bash electrs_automation_for_Eclair.sh` +`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/3_Nginx_and_Certbot_for_SSL.sh && bash 3_Nginx_and_Certbot_for_SSL.sh` + + -For the certificate to be obtained successfully a **dynamic DNS** and **port forwarding is necessary**. -Forward the port 80 to the IP of your RaspiBlitz for certbot. -Forward the port 50002 to be able to access electrs from the outside of your LAN. --- -## Linux desktop: Install, configure and run the Electrum wallet -The instruction are in the script: [electrum_install_config_and_run.sh](electrum_install_config_and_run.sh) +## Linux desktop: install, configure and run the Electrum wallet +The instruction are in the script: [4_electrum_install.sh](4_electrum_install.sh) + +Tested on Ubuntu 18.04. To download and run on the Linux desktop: -`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/electrum_install_config_and_run.sh && bash electrum_install_config_and_run.sh` +`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/4_electrum_install.sh && bash 4_electrum_install.sh` diff --git a/openbazaar/README.md b/openbazaar/README.md new file mode 100644 index 0000000..43a9b84 --- /dev/null +++ b/openbazaar/README.md @@ -0,0 +1,6 @@ +https://openbazaar.zendesk.com/hc/enac-us/articles/115002761352-How-do-I-move-my-OpenBazaar-store-from-one-computer-to-another- + +logs are in the store directory/logs/ob.log + +monitor on linux: +tail -f ~/.openbazaar/logs/ob/log \ No newline at end of file