Skip to content

Commit

Permalink
App Submission: Fulcrum (#1531)
Browse files Browse the repository at this point in the history
Co-authored-by: nmfretz <[email protected]>
  • Loading branch information
sahilph and nmfretz authored Oct 30, 2024
1 parent c29703f commit 1affa7b
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
Empty file added fulcrum/data/fulcrum/.gitkeep
Empty file.
56 changes: 56 additions & 0 deletions fulcrum/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: "3.7"

services:
app_proxy:
environment:
APP_HOST: $APP_FULCRUM_IP
APP_PORT: 3006

app:
image: ghcr.io/sahilph/umbrel-fulcrum:sha-349e246@sha256:5d565f3b15f7bbeab28c027320ffc84d647e7816cd007fd84077c0db05c15393
depends_on:
- fulcrum
restart: on-failure
environment:
ELECTRUM_HIDDEN_SERVICE: "${APP_FULCRUM_RPC_HIDDEN_SERVICE}"
ELECTRUM_LOCAL_SERVICE: "${DEVICE_DOMAIN_NAME}"
ELECTRUM_PORT: ${APP_FULCRUM_NODE_PORT}
FULCRUM_HOST: "${APP_FULCRUM_NODE_IP}"
FULCRUM_PORT: "${APP_FULCRUM_NODE_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_FULCRUM_IP

fulcrum:
image: cculianu/fulcrum:v1.11.1@sha256:70f06b93ab5863997992d4b4508312fe81ce576017e16ecc7e69c7d38165bdf2
restart: on-failure
user: "1000:1000"
environment:
TCP: 0.0.0.0:${APP_FULCRUM_NODE_PORT}
BITCOIND: ${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_RPC_PORT}
RPCUSER: ${APP_BITCOIN_RPC_USER}
RPCPASSWORD: ${APP_BITCOIN_RPC_PASS}
PEERING: "false"
ANNOUNCE: "false"
command: Fulcrum _ENV_
volumes:
- "${APP_DATA_DIR}/data/fulcrum:/data"
ports:
- "${APP_FULCRUM_NODE_PORT}:${APP_FULCRUM_NODE_PORT}"
networks:
default:
ipv4_address: $APP_FULCRUM_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"
7 changes: 7 additions & 0 deletions fulcrum/exports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export APP_FULCRUM_IP="10.21.22.200"
export APP_FULCRUM_NODE_IP="10.21.21.200"

export APP_FULCRUM_NODE_PORT="50002"

rpc_hidden_service_file="${EXPORTS_TOR_DATA_DIR}/app-${EXPORTS_APP_ID}-rpc/hostname"
export APP_FULCRUM_RPC_HIDDEN_SERVICE="$(cat "${rpc_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")"
26 changes: 26 additions & 0 deletions fulcrum/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Delay booting Fulcrum until the RPC Tor Hidden Service is ready

HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-rpc/hostname"

if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi

"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach fulcrum
"${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 changes: 3 additions & 0 deletions fulcrum/torrc.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Fulcrum RPC Hidden Service
HiddenServiceDir /data/app-$APP_ID-rpc
HiddenServicePort $APP_FULCRUM_NODE_PORT $APP_FULCRUM_NODE_IP:$APP_FULCRUM_NODE_PORT
33 changes: 33 additions & 0 deletions fulcrum/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
manifestVersion: 1.1
id: fulcrum
category: bitcoin
name: Fulcrum
version: "1.11.1"
tagline: A fast and nimble Electrum Server
description: >-
Run your personal Electrum server and connect your Electrum-compatible wallet,
including BitBoxApp, BlueWallet, Electrum Wallet (Android and Desktop), Nunchuk
(Desktop), Phoenix, and Sparrow Wallet to it instead of using a third-party
Electrum server.
Powered by Fulcrum from Calin Culianu
⚠️ Fulcrum does not yet automatically integrate with other apps in the Bitcoin ecosystem on Umbrel. However, in a future umbrelOS update, users will be able to choose which Electrum Server app they want to use to connect with other apps.
developer: Calin Culianu
website: https://fulcrumserver.org/
submitter: Sahil Phule
submission: https://github.com/getumbrel/umbrel-apps/pull/1531
dependencies:
- bitcoin
repo: https://github.com/cculianu/Fulcrum
support: https://github.com/cculianu/Fulcrum/issues
port: 2107
gallery:
- 1.jpg
- 2.jpg
- 3.jpg
path: ""
defaultPassword: ""
releaseNotes: ""

0 comments on commit 1affa7b

Please sign in to comment.