Dockerfile

This commit is contained in:
2022-03-10 07:33:15 -06:00
parent 74c79d676e
commit 33a3846cd8
2 changed files with 22 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ DM_CONF_FILE="/etc/dm/dm.conf"
OAUTH_CONF_FILE="/etc/dm/oauth2/default.json"
PGP_PUB_FILE="/etc/dm/pgp.pub"
PGP_SEC_FILE="/etc/dm/pgp.sec"
BX_CONF_FILE="/usr/local/etc/libbitcoin/bx.cfg"
## Write a variables to config file
sed -i "/\[main\]/,/\[/ s/user=.*/user=module/" "$DM_CONF_FILE"
@@ -83,6 +84,23 @@ then
B=$(tput bold)
N=$(tput sgr0)
## Setup testnet settings in libbitcoin-explorer config
test $TESTNET -eq 1 && \
sed -i -e "/\[wallet\]/,/\[/ s/wif_version? =.*/wif_version = 239/" \
-e "/\[wallet\]/,/\[/ s/hd_public_version =.*/hd_public_version = 70617039/" \
-e "/\[wallet\]/,/\[/ s/hd_secret_version =.*/hd_secret_version = 70615956/" \
-e "/\[wallet\]/,/\[/ s/pay_to_public_key_hash_version =.*/pay_to_public_key_hash_version = 111/" \
-e "/\[wallet\]/,/\[/ s/pay_to_script_hash_version =.*/pay_to_script_hash_version = 196/" \
-e "/\[network\]/,/\[/ s/identifier =.*/identifier = 118034699/" \
-e "/seed = mainnet[0-9].libbitcoin.net:8333/ s/^/#/" \
-e "/url = tcp:\/\/mainnet.libbitcoin.net:9091/ s/^/#/" \
-e "/block_url = tcp:\/\/mainnet.libbitcoin.net:9093/ s/^/#/" \
-e "/transaction_url = tcp:\/\/mainnet.libbitcoin.net:9094/ s/^/#/" \
-e "/#seed = testnet[0-9].libbitcoin.net:18333/ s/^#//" \
-e "/#url = tcp:\/\/testnet.libbitcoin.net:19091/ s/^#//" \
-e "/#block_url = tcp:\/\/testnet.libbitcoin.net:19093/ s/^#//" \
-e "/#transaction_url = tcp:\/\/testnet.libbitcoin.net:19094/ s/^#//" "$BX_CONF_FILE"
## Generate bitcoin keys
PRIVKEY="$(cat /dev/random | tr -cd "[:digit:]" | head -c 64)"
PUBKEY="$(bx ec-to-public $PRIVKEY)"