Compare commits

...

3 Commits

Author SHA1 Message Date
wiz
ed1e159e4e
ops: Set wiz coinbase payout address for testnet4 2025-04-08 18:38:35 +09:00
Portland.HODL
16df18d193 [Config] Remove payout address arg (usless) bump (port) 2025-04-06 01:11:54 +00:00
Portland.HODL
36bceb6b76 [Ft.] Default ports + overrides at $3 2025-04-05 18:22:39 +00:00

28
start
View File

@ -4,25 +4,28 @@
#
# Options for base CKSolo config [No Failover / Proxy]
# $1 - NETWORK
# $2 - Payout Address
# $3 - Port
# $2 - Port (optional, defaults to 3333)
# Initialize variables
DAEMON=$1
NETWORK=${DAEMON} # Context Alias
COINBASE_PAYOUT_ADDRESS=$2
COINBASE_PAYOUT_ADDRESS="" # Empty payout address because it will be overwritten by network based config,
PORT=${2:-3333} # Use port provided as 3rd argument, or default to 3333 if not specified
RPC_PORT=8332 # Default to mainnet RPC port, will be updated based on network
# Check that the NETWORK provided is correct
# 'bitcoin' is mainnet and needs an mainnet address
if [ "$NETWORK" = "bitcoin" ] || [ "$NETWORK" = "testnet3" ] || [ "$NETWORK" = "testnet4" ]; then
echo "Setting up Mempool.space CKPool with NETWORK $NETWORK"
if [ "$NETWORK" = "bitcoin" ]; then
RPC_PORT=8332 # Mainnet RPC port
COINBASE_PAYOUT_ADDRESS="1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC"
elif [ "$NETWORK" = "testnet3" ]; then
RPC_PORT=18332 # Testnet3 RPC port
COINBASE_PAYOUT_ADDRESS="tb1qjfplwf7a2dpjj04cx96rysqeastvycc0j50cch"
elif [ "$NETWORK" = "testnet4" ]; then
COINBASE_PAYOUT_ADDRESS="tb1qjfplwf7a2dpjj04cx96rysqeastvycc0j50cch"
RPC_PORT=48332 # Testnet4 RPC port
COINBASE_PAYOUT_ADDRESS="tb1q548z58kqvwyjqwy8vc2ntmg33d7s2wyfv7ukq4"
else
echo "Network setting unsupported for magic coinbase payout address replacement"
fi
@ -31,7 +34,8 @@ else
exit 1
fi
echo "Starting Mempool.space CKSolo using ${NETWORK} network with payout address i${COINBASE_PAYOUT_ADDRESS}"
echo "Starting Mempool.space CKSolo using ${NETWORK} network with payout address ${COINBASE_PAYOUT_ADDRESS}"
echo "Using Bitcoin RPC port: ${RPC_PORT} and CKPool port: ${PORT}"
# Fetch Bitcoin node credentials from the Bitcoin.conf file
DAEMON_CONF="/bitcoin/${DAEMON}.conf"
@ -49,7 +53,7 @@ cat > "${CONFIG_FILE}" << EOF
{
"btcd" : [
{
"url" : "127.0.0.1:8332",
"url" : "127.0.0.1:${RPC_PORT}",
"auth" : "${RPC_USER}",
"pass" : "${RPC_PASS}",
"notify" : true
@ -63,7 +67,7 @@ cat > "${CONFIG_FILE}" << EOF
"update_interval" : 30,
"version_mask" : "1fffe000",
"serverurl" : [
"127.0.0.1:3333"
"127.0.0.1:${PORT}"
],
"mindiff" : 1,
"startdiff" : 42,
@ -79,15 +83,15 @@ until false
do
# reset CWD
cd "${CONFIG_DIR}"
# disable making core files
ulimit -c 0
echo "[*] Starting ckpool..."
# Run ckpool with the config
ckpool "${CONFIG_FILE}"
# Wait a bit before restarting
echo "[*] ckpool exited, restarting in 1 second..."
sleep 1