Browse Source

App Submission: Datum (#1661)

Co-authored-by: nmfretz <nmfretz@gmail.com>
main
Léo Haf 3 months ago
committed by GitHub
parent
commit
d68be0b562
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 41
      datum/data/settings/datum_gateway_config.json
  2. 17
      datum/docker-compose.yml
  3. 44
      datum/hooks/pre-start
  4. 69
      datum/umbrel-app.yml

41
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
}
}

17
datum/docker-compose.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
app_proxy:
environment:
APP_HOST: datum_datum_1
APP_PORT: 21000
datum:
image: ghcr.io/retropex/datum:v1.6@sha256:0fb807930f206e618b28f0b9aa82d779787beec1c17b79ca0acd5b3b1e79f3e2
user: 1000:1000
restart: on-failure
volumes:
- ${APP_DATA_DIR}/data/settings/datum_gateway_config.json:/app/datum_gateway_config.json
ports:
# datum gateway port
- 23334:23334

44
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_KNOTS_RPC_USER}" ] || [ -z "${APP_BITCOIN_KNOTS_RPC_PASS}" ] || [ -z "${APP_BITCOIN_KNOTS_NODE_IP}" ] || [ -z "${APP_BITCOIN_KNOTS_INTERNAL_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_KNOTS_RPC_USER" \
--arg pass "$APP_BITCOIN_KNOTS_RPC_PASS" \
--arg url "${APP_BITCOIN_KNOTS_NODE_IP}:${APP_BITCOIN_KNOTS_INTERNAL_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

69
datum/umbrel-app.yml

@ -0,0 +1,69 @@
manifestVersion: 1.1
id: datum
category: bitcoin
name: DATUM
version: "v0.2-beta"
tagline: Self-sovereign Bitcoin mining
description: >-
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.
🛠️ 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:
- bitcoin-knots
repo: https://github.com/OCEAN-xyz/datum_gateway
support: https://ocean.xyz
port: 21000
gallery: []
path: ""
defaultPassword: ""
releaseNotes: ""
submitter: Léo Haf
submission: https://github.com/getumbrel/umbrel-apps/pull/1661
Loading…
Cancel
Save