Browse Source

Add electrumx

main
nmfretz 1 month ago
parent
commit
a9084db6df
  1. 0
      electrumx/data/electrumx/.gitkeep
  2. 53
      electrumx/docker-compose.yml
  3. 16
      electrumx/exports.sh
  4. 26
      electrumx/hooks/pre-start
  5. 3
      electrumx/torrc.template
  6. 26
      electrumx/umbrel-app.yml

0
electrumx/data/electrumx/.gitkeep

53
electrumx/docker-compose.yml

@ -0,0 +1,53 @@
version: "3.7"
services:
app_proxy:
environment:
APP_HOST: $APP_ELECTRUMX_IP
APP_PORT: 3007
app:
image: nmfretz/electrumx:ui-test@sha256:7c4ad595152bac64f9203c9a32a0940ef68781fb81975b2638ddf796afb59218
depends_on:
- electrumx
restart: on-failure
environment:
ELECTRUM_HIDDEN_SERVICE: "${APP_ELECTRUMX_RPC_HIDDEN_SERVICE}"
ELECTRUM_LOCAL_SERVICE: "${DEVICE_DOMAIN_NAME}"
ELECTRUM_HOST: "${APP_ELECTRUMX_NODE_IP}"
ELECTRUM_PUBLIC_CONNECTION_PORT: "${APP_ELECTRUMX_PUBLIC_CONNECTION_PORT}"
ELECTRUM_RPC_PORT: "${APP_ELECTRUMX_RPC_PORT}"
BITCOIN_HOST: "${APP_BITCOIN_NODE_IP}"
RPC_USER: "${APP_BITCOIN_RPC_USER}"
RPC_PASSWORD: "${APP_BITCOIN_RPC_PASS}"
RPC_PORT: "${APP_BITCOIN_RPC_PORT}"
networks:
default:
ipv4_address: $APP_ELECTRUMX_IP
electrumx:
image: lukechilds/electrumx:v1.16.0@sha256:2949784536f8f85af229004e12e5b5c3a1d7428918a492f77b4e958035c2ae2a
restart: always
init: true
environment:
DAEMON_URL: "http://${APP_BITCOIN_RPC_USER}:${APP_BITCOIN_RPC_PASS}@${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_RPC_PORT}"
COIN: "BitcoinSegwit"
# https://github.com/spesmilo/electrumx/blob/master/electrumx/lib/coins.py
NET: $APP_ELECTRUMX_BITCOIN_NETWORK
volumes:
- "${APP_DATA_DIR}/data/electrumx:/data"
ports:
- "${APP_ELECTRUMX_PUBLIC_CONNECTION_PORT}:${APP_ELECTRUMX_NODE_PORT}"
networks:
default:
ipv4_address: $APP_ELECTRUMX_NODE_IP
tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"

16
electrumx/exports.sh

@ -0,0 +1,16 @@
export APP_ELECTRUMX_IP="10.21.22.199"
export APP_ELECTRUMX_NODE_IP="10.21.21.199"
export APP_ELECTRUMX_NODE_PORT="50001"
export APP_ELECTRUMX_PUBLIC_CONNECTION_PORT="50003"
export APP_ELECTRUMX_RPC_PORT="8000"
# ElectrumX NET takes: mainnet, testnet, signet, regtest, testnet4
# electrumx 1.16.0 does not support signet or testnet4 (latest commits in repo do however)
export APP_ELECTRUMX_BITCOIN_NETWORK=$APP_BITCOIN_NETWORK
if [[ "${BITCOIN_NETWORK}" == "testnet3" ]]; then
export APP_ELECTRUMX_BITCOIN_NETWORK="testnet"
fi
rpc_hidden_service_file="${EXPORTS_TOR_DATA_DIR}/app-${EXPORTS_APP_ID}-tpc/hostname"
export APP_ELECTRUMX_RPC_HIDDEN_SERVICE="$(cat "${rpc_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")"

26
electrumx/hooks/pre-start

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Delay booting ElectrumX until the RPC Tor Hidden Service is ready
HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-tpc/hostname"
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach electrumx
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach tor
echo "App: ${APP_ID} - Generating Tor Hidden Service..."
for attempt in $(seq 1 100); do
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file created successfully!"
break
fi
sleep 0.1
done
if [[ ! -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file wasn't created"
fi

3
electrumx/torrc.template

@ -0,0 +1,3 @@
# ElectrumX RPC Hidden Service
HiddenServiceDir /data/app-$APP_ID-tpc
HiddenServicePort $APP_ELECTRUMX_NODE_PORT $APP_ELECTRUMX_NODE_IP:$APP_ELECTRUMX_NODE_PORT

26
electrumx/umbrel-app.yml

@ -0,0 +1,26 @@
manifestVersion: 1.1
id: electrumx
implements:
- electrs
category: bitcoin
name: ElectrumX
version: "latest"
tagline: ElectrumX Yo
description: >
blah blah blah
developer: Umbrel
website: https://umbrel.com/
dependencies:
- bitcoin
repo: https://github.com/getumbrel/umbrel-electrs
support: https://community.getumbrel.com/c/bitcoin-and-lightning
port: 1999
gallery:
- 1.jpg
- 2.jpg
- 3.jpg
path: ""
defaultPassword: ""
releaseNotes: ""
submitter: Umbrel
submission: https://github.com/getumbrel/umbrel/pull/xxx
Loading…
Cancel
Save