docker-bitcoind/bitcoin.run

24 lines
551 B
Bash

#!/bin/bash
export HOME="/var/lib/bitcoin"
# gen random pw for rpc server
RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20)
cat <<EOF > $HOME/bitcoin.conf
rpcuser=${BITCOIND_RPCUSER:-rpcuser}
rpcpassword=${BITCOIND_RPCPASSWORD:-$RANDOMPW}
EOF
chown -R bitcoin:bitcoin $HOME
exec chpst -ubitcoin \
bitcoind \
-printtoconsole \
-disablewallet \
-datadir=/var/lib/bitcoin \
-conf=/var/lib/bitcoin/bitcoin.conf \
-rpcallowip=::/0 \
$BITCOIND_EXTRA_OPTS \
2>&1