From c34dec8670bb68858b591b9c9b9822770cc4a0e9 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sat, 28 Jun 2025 17:24:25 -0600 Subject: [PATCH] initial commit --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++ bitcoind.service | 14 +++++++++++ electrumx_server.service | 17 ++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 bitcoind.service create mode 100644 electrumx_server.service diff --git a/README.md b/README.md index 26f63c4..93cba95 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ # bitcoin-fullnode +Install Debian and then prepare the system + +```bash + +# 1. Install dependency packages - as root +apt install btop sudo git vim curl wget tmux python3 python3-pip + +# 2. Add your user to the sudoers +visudo + +# 3. Then switch to your regular user account, root not needed + +# 4. Get and change below the latest tar.gz file from https://bitcoinknots.org/#download +wget -O bitcoin.tar.gz +tar xvfz bitcoin.tar.gz + +# 5. Install ElectrumX server w/ pip +pip install e-x --break-system-packages # don't worry, it just sounds scary +mkdir ~/electrum_db + +# 6. Clone this repo and deploy configurations +git clone https://code.stevenpolley.net/steven/bitcoin-fullnode.git + +``` + +You will need to make some modifications to some of the files + +1. bitcoin-fullnode/electrumx_server.service - Update both the and tags which are used by DAEMON_URL +2. bitcoin/bitcoin.conf - update externalip, and set rpcauth (use the provided script to get salt and hash), use the same password used in the electrumx_server.service file + +Then get the services installed and start them up and monitor them for a bit. + +```bash +# Move bitcoin.conf +mkdir ~/.bitcoin +mv ~/bitcoin/bitcoin.conf ~/.bitcoin + +# Install services +sudo cp bitcoin-fullnode/bitcoind.service /etc/systemd/system/ +sudo cp bitcoin-fullnode/electrumx_server.service /etc/systemd/system/ +sudo systemctl daemon-reload + +# Start things up +sudo systemctl enable bitcoind.service --now +sudo systemctl enable electrumx_server.service --now + +# Monitor journalctl for anything that looks wrong. What is wrong? You're on your own. +sudo journalctl --follow + +``` + diff --git a/bitcoind.service b/bitcoind.service new file mode 100644 index 0000000..5ac3d16 --- /dev/null +++ b/bitcoind.service @@ -0,0 +1,14 @@ +[Unit] +Description=Bitcoin Knots Daemon +After=network.target +Wants=network.target + +[Service] +Type=simple +ExecStart=/home/steven/bitcoin/bin/bitcoind +User=steven +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/electrumx_server.service b/electrumx_server.service new file mode 100644 index 0000000..a8c94ab --- /dev/null +++ b/electrumx_server.service @@ -0,0 +1,17 @@ +[Unit] +Description=ElectrumX RPC Server +After=network.target +Wants=network.target + +[Service] +Type=simple +ExecStart=/home/steven/.local/bin/electrumx_server +User=steven +Restart=on-failure +RestartSec=5 +Environment=COIN=Bitcoin +Environment=DB_DIRECTORY=/home/steven/electrum_db +Environment=DAEMON_URL=http://:@127.0.0.1 + +[Install] +WantedBy=multi-user.target