diff --git a/btc-datum/data/settings/datum_gateway_config.json b/btc-datum/data/settings/datum_gateway_config.json new file mode 100644 index 0000000..1ed9200 --- /dev/null +++ b/btc-datum/data/settings/datum_gateway_config.json @@ -0,0 +1,41 @@ +{ + "bitcoind": { + "rpcuser": "auto-configure-on-install", + "rpcpassword": "auto-configure-on-install", + "rpcurl": "auto-configure-on-install", + "work_update_seconds": 40 + }, + "api": { + "listen_port": 21000 + }, + "mining": { + "pool_address": "enter your bitcoin address", + "coinbase_tag_primary": "DATUM on Umbrel", + "coinbase_tag_secondary": "DATUM on Umbrel", + "coinbase_unique_id": 120 + }, + "stratum": { + "listen_port": 23334, + "max_clients_per_thread": 1000, + "max_threads": 8, + "max_clients": 2048, + "vardiff_min": 16384, + "vardiff_target_shares_min": 8, + "vardiff_quickdiff_count": 8, + "vardiff_quickdiff_delta": 8, + "share_stale_seconds": 120, + "fingerprint_miners": true + }, + "logger": { + "log_level_console": 2 + }, + "datum": { + "pool_host": "datum-beta1.mine.ocean.xyz", + "pool_port": 28915, + "pool_pubkey": "f21f2f0ef0aa1970468f22bad9bb7f4535146f8e4a8f646bebc93da3d89b1406f40d032f09a417d94dc068055df654937922d2c89522e3e8f6f0e649de473003", + "pool_pass_workers": true, + "pool_pass_full_users": true, + "always_pay_self": true, + "pooled_mining_only": true + } +} \ No newline at end of file diff --git a/btc-datum/docker-compose.yml b/btc-datum/docker-compose.yml index fb7e973..4968f89 100644 --- a/btc-datum/docker-compose.yml +++ b/btc-datum/docker-compose.yml @@ -1,11 +1,17 @@ version: "3.7" services: + app_proxy: + environment: + APP_HOST: datum_datum_1 + APP_PORT: 21000 + datum: - image: ghcr.io/retropex/datum:v1.3 + image: ghcr.io/retropex/datum:v1.6@sha256:0fb807930f206e618b28f0b9aa82d779787beec1c17b79ca0acd5b3b1e79f3e2 + user: 1000:1000 + restart: on-failure volumes: - - type: bind - source: ${APP_DATA_DIR}/settings/datum_gateway_config.json - target: /app/datum_gateway_config.json + - ${APP_DATA_DIR}/data/settings/datum_gateway_config.json:/app/datum_gateway_config.json ports: - - 21000:21000 + # datum gateway port + - 23334:23334 diff --git a/btc-datum/hooks/pre-start b/btc-datum/hooks/pre-start new file mode 100755 index 0000000..9693c37 --- /dev/null +++ b/btc-datum/hooks/pre-start @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# This pre-start script updates the datum_gateway_config.json file with the user's Knots RPC configuration + +APP_DATA_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")" +DATUM_CONFIG_FILE="${APP_DATA_DIR}/data/settings/datum_gateway_config.json" +DESIRED_OWNER="1000:1000" + +if [ -f "${DATUM_CONFIG_FILE}" ]; then + echo "Checking DATUM configuration file." + + # Check if Knots environment variables are set + if [ -z "${APP_BITCOIN_RPC_USER}" ] || [ -z "${APP_BITCOIN_RPC_PASS}" ] || [ -z "${APP_BITCOIN_NODE_IP}" ] || [ -z "${APP_BITCOIN_RPC_PORT}" ]; then + echo "Missing Bitcoin Knots environment variables. Exiting." + exit 1 + fi + + # Check if the file contains default placeholder values that we need to configure on install + # These have values of "auto-configure-on-install" + if jq -e '.bitcoind | .rpcuser, .rpcpassword, .rpcurl | select(. == "auto-configure-on-install")' "$DATUM_CONFIG_FILE" > /dev/null; then + + echo "Initializing DATUM config with Bitcoin Knots RPC settings." + + # Update the configuration + jq --arg user "$APP_BITCOIN_RPC_USER" \ + --arg pass "$APP_BITCOIN_RPC_PASS" \ + --arg url "${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_RPC_PORT}" \ + '.bitcoind.rpcuser = $user | + .bitcoind.rpcpassword = $pass | + .bitcoind.rpcurl = $url' \ + "$DATUM_CONFIG_FILE" > "${DATUM_CONFIG_FILE}.tmp" && mv "${DATUM_CONFIG_FILE}.tmp" "$DATUM_CONFIG_FILE" + + # reset permissions + chown "${DESIRED_OWNER}" "$DATUM_CONFIG_FILE" + + echo "DATUM configuration updated successfully." + else + echo "DATUM configuration is up-to-date." + fi + +else + echo "DATUM configuration file not found. Installation incomplete." + exit 1 +fi diff --git a/btc-datum/icon/datum-logo.png b/btc-datum/icon/datum-logo.png deleted file mode 100644 index b667cbe..0000000 Binary files a/btc-datum/icon/datum-logo.png and /dev/null differ diff --git a/btc-datum/icon/datum_logo.svg b/btc-datum/icon/datum_logo.svg deleted file mode 100644 index 9dceab4..0000000 --- a/btc-datum/icon/datum_logo.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/btc-datum/icon/preview.png b/btc-datum/icon/preview.png deleted file mode 100644 index 91c6149..0000000 Binary files a/btc-datum/icon/preview.png and /dev/null differ diff --git a/btc-datum/settings/datum_gateway_config.json b/btc-datum/settings/datum_gateway_config.json deleted file mode 100644 index 8e8a1d5..0000000 --- a/btc-datum/settings/datum_gateway_config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "bitcoind":{ - "rpcuser": "enter your bitcoin RPC user", - "rpcpassword": "enter your bitcoin RPC addres", - "rpcurl": "172.17.0.1:8332" - }, - "api":{ - "listen_port": 21000 - }, - "mining":{ - "pool_address": "enter your bitcoin address", - "coinbase_tag_primary": "enter your block tag", - "coinbase_unique_id": 1 - } -} diff --git a/btc-datum/umbrel-app.yml b/btc-datum/umbrel-app.yml index e1c4d4b..0c74eb6 100644 --- a/btc-datum/umbrel-app.yml +++ b/btc-datum/umbrel-app.yml @@ -1,25 +1,72 @@ manifestVersion: 1.1 id: btc-datum -category: Bitcoin -name: Datum -version: "1" -tagline: Make your own mining template -icon: https://raw.githubusercontent.com/Retropex/Bitcoin-store/refs/heads/datum/btc-datum/icon/datum_logo.svg +category: bitcoin +name: DATUM +version: "v0.2-beta" +tagline: Self-sovereign Bitcoin mining description: >- - Take control of your digital sovereignty by running your own datum server. + DATUM (Decentralized Alternative Templates for Universal Mining) is a brand new bitcoin mining protocol that allows you to create your own block templates using your own Bitcoin node. + + + With DATUM on Umbrel, you gain full control over your Bitcoin mining setup, allowing you to use your own Bitcoin node to generate custom block templates and directly issue work to your miners. + DATUM enables you to either solo mine or participate in pool mining while optimizing block creation without relying on third-party servers. + + + Over the years, mining has drifted toward centralization, with large pools dominating the process and reducing miners to mere sellers of hash power. + DATUM seeks to bring back the core principle of Bitcoin: decentralization, giving miners direct control over the block construction process once again. - Powered by Bitcoin Knots: https://bitcoinknots.org/ -developer: Ocean + 🛠️ SET-UP INSTRUCTIONS + + + ### Bitcoin Node: + + + Datum connects automatically to your Bitcoin Knots app upon installation. A full archival node is not required for mining, so you may wish to prune your node to save disk space. You can adjust this setting under Advanced Settings in the Bitcoin Knots app. + + + ### Connecting Your Miner: + + + Refer to your miner's documentation for specific setup details. Here's a general guide to connect your miner with Datum: + + - Stratum URL/Host/Pool: Use your umbrelOS device’s IP address (found in Settings on the umbrelOS home screen) and port 23334. + e.g., stratum+tcp://192.168.4.56:23334 + + - Username/Worker: Enter the Bitcoin address for receiving OCEAN rewards. Optionally, add a worker name after a period to identify your miner. + e.g., bc1qabcdefghijklmnopqrstuvwxyz or bc1qabcdefghijklmnopqrstuvwxyz.bitaxe + + - Password: Leave blank or enter any value if your miner requires a password. + + + ### Advanced Configuration: + + + Datum is pre-configured to work out-of-the-box on umbrelOS. For custom settings, edit the datum_gateway_config.json file. This option is for advanced users comfortable with the command line. + + 1. From the umbrelOS homescreen, go to Settings > Advanced Settings > Terminal > umbrelOS to open a terminal. + + + 2. Edit the configuration file at /home/umbrel/umbrel/app-data/datum/data/settings/datum_gateway_config.json. + + + 3. Restart Datum from the umbrelOS homescreen by right-clicking the Datum app and selecting Restart. + + + For more information on Datum, please visit https://github.com/OCEAN-xyz/datum_gateway +developer: OCEAN website: https://ocean.xyz -dependencies: [] -repo: https://github.com/ocean-xyz +dependencies: + - bitcoin-knots +repo: https://github.com/OCEAN-xyz/datum_gateway support: https://ocean.xyz port: 21000 gallery: - - https://raw.githubusercontent.com/Retropex/Bitcoin-store/refs/heads/datum/btc-datum/icon/preview.png + - 1.jpg + - 2.jpg + - 3.jpg path: "" defaultPassword: "" -releaseNotes: >- +releaseNotes: "" submitter: Léo Haf -submission: https://github.com/Retropex/Bitcoin-store/pull/1 +submission: https://github.com/getumbrel/umbrel-apps/pull/1661