From 8da65c318d30f4595631d4f949dde7fd3b8e68ef Mon Sep 17 00:00:00 2001 From: mstrofnone <264851574+mstrofnone@users.noreply.github.com> Date: Mon, 30 Nov 2026 13:36:43 +1100 Subject: [PATCH] Add Namecoin Core (#4962) Co-authored-by: M Co-authored-by: mstrofnone Co-authored-by: al-lac Co-authored-by: nmfretz --- namecoin/data/i2pd/.gitkeep | 0 namecoin/data/namecoind/.gitkeep | 0 namecoin/docker-compose.yml | 84 +++++++++++++++++++++++++ namecoin/exports.sh | 19 ++++++ namecoin/hooks/pre-start | 27 ++++++++ namecoin/torrc.template | 13 ++++ namecoin/umbrel-app.yml | 105 +++++++++++++++++++++++++++++++ 7 files changed, 248 insertions(+) create mode 100644 namecoin/data/i2pd/.gitkeep create mode 100644 namecoin/data/namecoind/.gitkeep create mode 100644 namecoin/docker-compose.yml create mode 100644 namecoin/exports.sh create mode 100755 namecoin/hooks/pre-start create mode 100644 namecoin/torrc.template create mode 100644 namecoin/umbrel-app.yml diff --git a/namecoin/data/i2pd/.gitkeep b/namecoin/data/i2pd/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/namecoin/data/namecoind/.gitkeep b/namecoin/data/namecoind/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/namecoin/docker-compose.yml b/namecoin/docker-compose.yml new file mode 100644 index 000000000..e1c3c00fe --- /dev/null +++ b/namecoin/docker-compose.yml @@ -0,0 +1,84 @@ +version: "3.7" + +services: + app_proxy: + environment: + APP_HOST: $APP_NAMECOIN_WEB_IP + APP_PORT: 18080 + + namecoind: + image: ghcr.io/mstrofnone/namecoin-core-umbrel:32.1-umbrel.ci.2@sha256:84934418cd1dc2f8849730eb813dc104abf77147cd6c364cb69a571f29748bbb + user: "1000:1000" + restart: on-failure + stop_grace_period: 15m30s + ports: + - "${APP_NAMECOIN_P2P_PORT}:${APP_NAMECOIN_P2P_PORT}" + - "${APP_NAMECOIN_RPC_PORT}:${APP_NAMECOIN_RPC_PORT}" + volumes: + - ${APP_DATA_DIR}/data/namecoind:/data/.namecoin + environment: + NAMECOIN_RPC_USER: "${APP_NAMECOIN_RPC_USER}" + NAMECOIN_RPC_PASS: "${APP_NAMECOIN_RPC_PASS}" + # Network settings + NAMECOIND_IP: "${APP_NAMECOIN_NODE_IP}" + P2P_PORT: "${APP_NAMECOIN_P2P_PORT}" + RPC_PORT: "${APP_NAMECOIN_RPC_PORT}" + TOR_PORT: "${APP_NAMECOIN_TOR_PORT}" + # Tor proxy settings + TOR_HOST: "${APP_NAMECOIN_TOR_PROXY_IP}" + TOR_SOCKS_PORT: "9050" + TOR_CONTROL_PORT: "9051" + TOR_CONTROL_PASSWORD: "moneyprintergobrrr" + # I2P settings + I2P_HOST: "${APP_NAMECOIN_I2P_DAEMON_IP}" + I2P_SAM_PORT: "7656" + # Hidden services + P2P_HIDDEN_SERVICE: "${APP_NAMECOIN_P2P_HIDDEN_SERVICE}" + RPC_HIDDEN_SERVICE: "${APP_NAMECOIN_RPC_HIDDEN_SERVICE}" + networks: + default: + ipv4_address: $APP_NAMECOIN_NODE_IP + + web: + image: ghcr.io/mstrofnone/namecoin-core-umbrel-web:32.1-umbrel.ci.2@sha256:cb8b56f8a40948071a7976b50714e3cd94a1f8d04e3e917b72568ad586a61d42 + user: "1000:1000" + restart: on-failure + environment: + NAMECOIND_HOST: $APP_NAMECOIN_NODE_IP + NAMECOIND_RPC_PORT: "${APP_NAMECOIN_RPC_PORT}" + NAMECOIND_RPC_USER: "${APP_NAMECOIN_RPC_USER}" + NAMECOIND_RPC_PASS: "${APP_NAMECOIN_RPC_PASS}" + PORT: 18080 + P2P_PORT: "${APP_NAMECOIN_P2P_PORT}" + P2P_HIDDEN_SERVICE: "${APP_NAMECOIN_P2P_HIDDEN_SERVICE}" + RPC_HIDDEN_SERVICE: "${APP_NAMECOIN_RPC_HIDDEN_SERVICE}" + DEVICE_DOMAIN_NAME: "${DEVICE_DOMAIN_NAME}" + depends_on: + - namecoind + networks: + default: + ipv4_address: $APP_NAMECOIN_WEB_IP + + tor: + image: ghcr.io/getumbrel/tor:0.4.9.11@sha256:e382b8629c0dfef6ceb396b062622d4e4e955b19d6f16b883fd2c0723ad5671a + user: "1000:1000" + restart: on-failure + volumes: + - ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro + - ${TOR_DATA_DIR}:/data + environment: + HOME: "/tmp" + networks: + default: + ipv4_address: "${APP_NAMECOIN_TOR_PROXY_IP}" + + i2pd_daemon: + image: purplei2p/i2pd:release-2.61.0@sha256:422f6715f635d1af0a6ae4937447471477deb6e6719bf5935029be674e4f4cdd + user: "root" + command: --sam.enabled=true --sam.address=0.0.0.0 --sam.port=7656 --loglevel=error + restart: on-failure + volumes: + - ${APP_DATA_DIR}/data/i2pd:/home/i2pd/data + networks: + default: + ipv4_address: "${APP_NAMECOIN_I2P_DAEMON_IP}" diff --git a/namecoin/exports.sh b/namecoin/exports.sh new file mode 100644 index 000000000..e32098146 --- /dev/null +++ b/namecoin/exports.sh @@ -0,0 +1,19 @@ +export APP_NAMECOIN_NODE_IP="10.21.21.30" +export APP_NAMECOIN_WEB_IP="10.21.21.31" +export APP_NAMECOIN_TOR_PROXY_IP="10.21.22.30" +export APP_NAMECOIN_I2P_DAEMON_IP="10.21.22.31" + +export APP_NAMECOIN_DATA_DIR="${EXPORTS_APP_DATA_DIR}/namecoind" + +export APP_NAMECOIN_RPC_PORT="8336" +export APP_NAMECOIN_P2P_PORT="8334" +# Inbound P2P over Tor; the P2P hidden service forwards here +export APP_NAMECOIN_TOR_PORT="8335" + +export APP_NAMECOIN_RPC_USER="umbrel" +export APP_NAMECOIN_RPC_PASS="$(derive_entropy "namecoin-rpc-pass")" + +rpc_hidden_service_file="${EXPORTS_TOR_DATA_DIR}/app-${EXPORTS_APP_ID}-rpc/hostname" +p2p_hidden_service_file="${EXPORTS_TOR_DATA_DIR}/app-${EXPORTS_APP_ID}-p2p/hostname" +export APP_NAMECOIN_RPC_HIDDEN_SERVICE="$(cat "${rpc_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" +export APP_NAMECOIN_P2P_HIDDEN_SERVICE="$(cat "${p2p_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" diff --git a/namecoin/hooks/pre-start b/namecoin/hooks/pre-start new file mode 100755 index 000000000..0334b58f6 --- /dev/null +++ b/namecoin/hooks/pre-start @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Delay booting the full app until the RPC and P2P Tor hidden services are ready, +# so the dashboard and dependent apps get the real onion addresses on first start + +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 namecoind +"${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 diff --git a/namecoin/torrc.template b/namecoin/torrc.template new file mode 100644 index 000000000..076f55df4 --- /dev/null +++ b/namecoin/torrc.template @@ -0,0 +1,13 @@ +SocksPort 0.0.0.0:9050 +ControlPort 0.0.0.0:9051 +CookieAuthentication 1 +CookieAuthFileGroupReadable 1 +HashedControlPassword 16:39AF5EEFA4FC1D986022FDFB13663669FE50FB6DE9A3B4FE4FC7D82010 # moneyprintergobrrr + +# Namecoin Core P2P Hidden Service +HiddenServiceDir /data/app-$APP_ID-p2p +HiddenServicePort $APP_NAMECOIN_P2P_PORT $APP_NAMECOIN_NODE_IP:$APP_NAMECOIN_TOR_PORT + +# Namecoin Core RPC Hidden Service +HiddenServiceDir /data/app-$APP_ID-rpc +HiddenServicePort $APP_NAMECOIN_RPC_PORT $APP_NAMECOIN_NODE_IP:$APP_NAMECOIN_RPC_PORT diff --git a/namecoin/umbrel-app.yml b/namecoin/umbrel-app.yml new file mode 100644 index 000000000..77f5c7b6b --- /dev/null +++ b/namecoin/umbrel-app.yml @@ -0,0 +1,105 @@ +manifestVersion: 1.1 +id: namecoin +storage: + dataRoot: data +category: bitcoin +name: Namecoin Core +version: "32.1" +tagline: Run a Namecoin full node — the first Bitcoin fork, powering decentralized DNS and identity +description: >- + Namecoin is a decentralized, open source information registration and transfer system based on + the Bitcoin cryptocurrency. It was the first fork of Bitcoin and the first to implement merged + mining and a decentralized DNS. + + + Namecoin Core is the reference full node implementation. Running your own Namecoin node allows + you to independently verify the Namecoin blockchain, register and manage .bit domain names, + store identity information, and transact NMC without trusting any third party. + + + Key features: + + - Full blockchain validation and peer-to-peer networking + + - Automatic peer discovery over Tor, I2P, and clearnet + + - Name registration, lookup, update, and renewal via RPC + + - Built-in wallet for NMC transactions + + - Merged mining support (mine NMC alongside BTC) + + + The Namecoin blockchain is significantly smaller than Bitcoin's, making it practical to run + a full archival node even on modest hardware like a Raspberry Pi. +releaseNotes: "" +developer: Namecoin Developers +website: https://www.namecoin.org/ +dependencies: [] +repo: https://github.com/namecoin/namecoin-core +support: https://github.com/namecoin/namecoin-core/issues +port: 18082 +gallery: + - 1.webp + - 2.webp + - 3.webp +path: "" +defaultUsername: "" +defaultPassword: "" +torOnly: false +widgets: + - id: "stats" + type: "four-stats" + refresh: "5s" + endpoint: "web:18080/api/widget/stats" + link: "" + example: + type: "four-stats" + link: "" + items: + - title: "Connections" + text: "12" + subtext: "peers" + - title: "Block height" + text: "826569" + subtext: "blocks" + - title: "Mempool" + text: "3" + subtext: "MB" + - title: "Chain size" + text: "15.2" + subtext: "GB" + - id: "sync" + type: "text-with-progress" + refresh: "2s" + endpoint: "web:18080/api/widget/sync" + link: "" + example: + type: "text-with-progress" + link: "" + title: "Blockchain sync" + text: "83%" + progressLabel: "In progress" + progress: 0.83 + - id: "connect" + type: "list" + refresh: "60s" + endpoint: "web:18080/api/widget/connect" + link: "" + example: + type: "list" + link: "" + items: + - text: "abcdef1234567890.onion:8336" + subtext: "RPC over Tor" + - text: "umbrel" + subtext: "RPC username" + - text: "••••••••••••••••••••" + subtext: "RPC password (view in app)" +submitter: mstrofnone +submission: https://github.com/getumbrel/umbrel-apps/pull/4962 +backupIgnore: + - data/namecoind/blocks + - data/namecoind/chainstate + - data/namecoind/indexes + - data/i2pd