mirror of
https://github.com/mempool/mempool.git
synced 2024-11-19 01:41:01 +01:00
Add new production installation script and related files
This commit is contained in:
parent
09e3791cee
commit
1e87c3857b
56
production/bitcoin.conf
Normal file
56
production/bitcoin.conf
Normal file
@ -0,0 +1,56 @@
|
||||
datadir=/bitcoin
|
||||
server=1
|
||||
txindex=1
|
||||
listen=1
|
||||
discover=1
|
||||
par=16
|
||||
dbcache=8192
|
||||
maxmempool=1337
|
||||
mempoolexpiry=999999
|
||||
maxconnections=42
|
||||
onion=127.0.0.1:9050
|
||||
rpcallowip=127.0.0.1
|
||||
rpcuser=__BITCOIN_RPC_USER__
|
||||
rpcpassword=__BITCOIN_RPC_PASS__
|
||||
whitelist=127.0.0.1
|
||||
whitelist=103.99.168.0/22
|
||||
whitelist=2401:b140::/32
|
||||
#uacomment=@wiz
|
||||
|
||||
[main]
|
||||
bind=0.0.0.0:8333
|
||||
bind=[::]:8333
|
||||
rpcbind=127.0.0.1:8332
|
||||
rpcbind=[::1]:8332
|
||||
#addnode=103.99.171.201:8333
|
||||
#addnode=103.99.171.202:8333
|
||||
#addnode=103.99.171.203:8333
|
||||
#addnode=103.99.171.204:8333
|
||||
#addnode=103.99.171.205:8333
|
||||
#addnode=103.99.171.206:8333
|
||||
|
||||
[test]
|
||||
daemon=1
|
||||
bind=0.0.0.0:18333
|
||||
bind=[::]:18333
|
||||
rpcbind=127.0.0.1:18332
|
||||
rpcbind=[::1]:18332
|
||||
#addnode=103.99.171.201:18333
|
||||
#addnode=103.99.171.202:18333
|
||||
#addnode=103.99.171.203:18333
|
||||
#addnode=103.99.171.204:18333
|
||||
#addnode=103.99.171.205:18333
|
||||
#addnode=103.99.171.206:18333
|
||||
|
||||
[signet]
|
||||
daemon=1
|
||||
bind=0.0.0.0:38333
|
||||
bind=[::]:38333
|
||||
rpcbind=127.0.0.1:38332
|
||||
rpcbind=[::1]:38332
|
||||
#addnode=103.99.171.201:38333
|
||||
#addnode=103.99.171.202:38333
|
||||
#addnode=103.99.171.203:38333
|
||||
#addnode=103.99.171.204:38333
|
||||
#addnode=103.99.171.205:38333
|
||||
#addnode=103.99.171.206:38333
|
5
production/bitcoin.crontab
Normal file
5
production/bitcoin.crontab
Normal file
@ -0,0 +1,5 @@
|
||||
@reboot sleep 30 ; screen -dmS mainnet /bitcoin/electrs/electrs-start-mainnet
|
||||
@reboot sleep 60 ; /usr/local/bin/bitcoind -testnet >/dev/null 2>&1
|
||||
@reboot sleep 70 ; screen -dmS testnet /bitcoin/electrs/electrs-start-testnet
|
||||
@reboot sleep 80 ; /usr/local/bin/bitcoind -signet >/dev/null 2>&1
|
||||
@reboot sleep 90 ; screen -dmS signet /bitcoin/electrs/electrs-start-signet
|
@ -1,32 +1,24 @@
|
||||
#!/usr/local/bin/zsh
|
||||
cd "$HOME/electrs"
|
||||
#source $HOME/.cargo/env
|
||||
#export PATH=$HOME/.cargo/bin:$PATH
|
||||
cd "${HOME}/electrs"
|
||||
#source "${HOME}/.cargo/env"
|
||||
#export PATH="${HOME}/.cargo/bin:${PATH}"
|
||||
|
||||
until false
|
||||
do
|
||||
# patch code for FreeBSD
|
||||
if grep XBS5 "$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs" ; then
|
||||
echo patching sysconf
|
||||
grep -v XBS5 /elements/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs > /tmp/foo && \
|
||||
mv /tmp/foo /elements/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs
|
||||
fi
|
||||
|
||||
cargo run \
|
||||
--release \
|
||||
--features liquid \
|
||||
--bin electrs \
|
||||
-- \
|
||||
-vvv \
|
||||
--asset-db-path "$HOME/asset_registry_db" \
|
||||
--asset-db-path "${HOME}/asset_registry_db" \
|
||||
--address-search \
|
||||
--cors '*' \
|
||||
--db-dir /electrs \
|
||||
--db-dir __ELECTRS_DATA_ROOT__ \
|
||||
--network liquid \
|
||||
--daemon-dir /elements \
|
||||
--daemon-dir "${HOME}" \
|
||||
--http-addr '[::]:3001' \
|
||||
--monitoring-addr '127.0.0.1:4225' \
|
||||
--cookie 'user:pass' \
|
||||
--precache-scripts $HOME/electrs/contrib/popular-scripts.txt
|
||||
--cookie '__ELEMENTS_RPC_USER__:__ELEMENTS_RPC_PASS__' \
|
||||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
|
||||
sleep 1
|
||||
done
|
||||
|
22
production/electrs-start-liquidtestnet
Normal file → Executable file
22
production/electrs-start-liquidtestnet
Normal file → Executable file
@ -1,30 +1,24 @@
|
||||
#!/usr/local/bin/zsh
|
||||
cd "$HOME/electrs"
|
||||
#source $HOME/.cargo/env
|
||||
#export PATH=$HOME/.cargo/bin:$PATH
|
||||
cd "${HOME}/electrs"
|
||||
#source "${HOME}/.cargo/env"
|
||||
#export PATH="${HOME}/.cargo/bin:${PATH}"
|
||||
|
||||
until false
|
||||
do
|
||||
# patch code for FreeBSD
|
||||
if grep XBS5 "$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs" ; then
|
||||
grep -v XBS5 $HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs > /tmp/foo && \
|
||||
mv /tmp/foo $HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs
|
||||
fi
|
||||
|
||||
cargo run \
|
||||
--release \
|
||||
--features liquid \
|
||||
--bin electrs \
|
||||
-- \
|
||||
-vv \
|
||||
--asset-db-path "$HOME/asset_registry_testnet_db" \
|
||||
--asset-db-path "${HOME}/asset_registry_testnet_db" \
|
||||
--address-search \
|
||||
--cors '*' \
|
||||
--db-dir /electrs \
|
||||
--db-dir __ELECTRS_DATA_ROOT__ \
|
||||
--network liquidtestnet \
|
||||
--daemon-dir $HOME \
|
||||
--daemon-dir "${HOME}" \
|
||||
--http-addr '[::]:3004' \
|
||||
--cookie 'foo:bar' \
|
||||
--precache-scripts $HOME/electrs/contrib/popular-scripts.txt
|
||||
--cookie '__ELEMENTS_RPC_USER__:__ELEMENTS_RPC_PASS__' \
|
||||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
|
||||
sleep 1
|
||||
done
|
||||
|
@ -1,17 +1,10 @@
|
||||
#!/usr/local/bin/zsh
|
||||
cd "$HOME/electrs"
|
||||
#source $HOME/.cargo/env
|
||||
#export PATH=$HOME/.cargo/bin:$PATH
|
||||
cd "${HOME}/electrs"
|
||||
#source "${HOME}/.cargo/env"
|
||||
#export PATH="${HOME}/.cargo/bin:${PATH}"
|
||||
|
||||
until false
|
||||
do
|
||||
# patch code for FreeBSD
|
||||
if grep XBS5 "$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs" ; then
|
||||
echo patching sysconf
|
||||
grep -v XBS5 /elements/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs > /tmp/foo && \
|
||||
mv /tmp/foo /elements/.cargo/registry/src/github.com-1ecc6299db9ec823/sysconf-0.3.4/src/raw.rs
|
||||
fi
|
||||
|
||||
cargo run \
|
||||
--release \
|
||||
--bin electrs \
|
||||
@ -19,11 +12,11 @@ do
|
||||
-vvvv \
|
||||
--address-search \
|
||||
--cors '*' \
|
||||
--db-dir /electrs \
|
||||
--daemon-dir $HOME \
|
||||
--db-dir __ELECTRS_DATA_ROOT__ \
|
||||
--daemon-dir "${HOME}" \
|
||||
--http-addr '[::]:3000' \
|
||||
--cookie 'user:pass' \
|
||||
--precache-scripts $HOME/electrs/contrib/popular-scripts.txt
|
||||
--cookie '__BITCOIN_RPC_USER__:__BITCOIN_RPC_PASS__' \
|
||||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
|
||||
|
||||
sleep 3
|
||||
done
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/local/bin/zsh
|
||||
cd /bitcoin/electrs
|
||||
#source $HOME/.cargo/env
|
||||
#export PATH=$HOME/.cargo/bin:$PATH
|
||||
cd "${HOME}/electrs"
|
||||
#source "${HOME}/.cargo/env"
|
||||
#export PATH="${HOME}/.cargo/bin:${PATH}"
|
||||
|
||||
until false
|
||||
do
|
||||
@ -13,11 +13,11 @@ do
|
||||
--network signet \
|
||||
--address-search \
|
||||
--cors '*' \
|
||||
--db-dir /electrs \
|
||||
--db-dir __ELECTRS_DATA_ROOT__ \
|
||||
--daemon-rpc-addr '127.0.0.1:38332' \
|
||||
--daemon-dir /bitcoin \
|
||||
--daemon-dir "${HOME}" \
|
||||
--http-addr '[::]:3003' \
|
||||
--cookie 'user:pass' \
|
||||
--precache-scripts /bitcoin/electrs/contrib/popular-scripts.txt
|
||||
--cookie '__BITCOIN_RPC_USER__:__BITCOIN_RPC_PASS__' \
|
||||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
|
||||
sleep 1
|
||||
done
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/local/bin/zsh
|
||||
cd $HOME/electrs
|
||||
cd "${HOME}/electrs"
|
||||
#source $HOME/.cargo/env
|
||||
#export PATH=$HOME/.cargo/bin:$PATH
|
||||
|
||||
@ -13,11 +13,11 @@ do
|
||||
--network testnet \
|
||||
--address-search \
|
||||
--cors '*' \
|
||||
--db-dir /electrs \
|
||||
--daemon-dir $HOME \
|
||||
--db-dir __ELECTRS_DATA_ROOT__ \
|
||||
--daemon-dir "${HOME}" \
|
||||
--http-addr '[::]:3002' \
|
||||
--cookie 'user:pass' \
|
||||
--precache-scripts $HOME/electrs/contrib/popular-scripts.txt
|
||||
--cookie '__BITCOIN_RPC_USER__:__BITCOIN_RPC_PASS__' \
|
||||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
|
||||
|
||||
sleep 3
|
||||
done
|
||||
|
35
production/elements.conf
Normal file
35
production/elements.conf
Normal file
@ -0,0 +1,35 @@
|
||||
server=1
|
||||
daemon=1
|
||||
listen=1
|
||||
rpcuser=__ELEMENTS_RPC_USER__
|
||||
rpcpassword=__ELEMENTS_RPC_PASS__
|
||||
mainchainrpchost=127.0.0.1
|
||||
mainchainrpcuser=__BITCOIN_RPC_USER__
|
||||
mainchainrpcpassword=__BITCOIN_RPC_PASS__
|
||||
txindex=1
|
||||
|
||||
[liquidv1]
|
||||
validatepegin=1
|
||||
mainchainrpcport=8332
|
||||
|
||||
[liquidtestnet]
|
||||
validatepegin=0
|
||||
anyonecanspendaremine=0
|
||||
initialfreecoins=2100000000000000
|
||||
con_dyna_deploy_start=0
|
||||
con_max_block_sig_size=150
|
||||
checkblockindex=0
|
||||
fallbackfee=0.00000100
|
||||
con_has_parent_chain=0
|
||||
parentgenesisblockhash=NULL
|
||||
pubkeyprefix=36
|
||||
scriptprefix=19
|
||||
blindedprefix=23
|
||||
bech32_hrp=tex
|
||||
blech32_hrp=tlq
|
||||
pchmessagestart=410edd62
|
||||
dynamic_epoch_length=1000
|
||||
signblockscript=51210217e403ddb181872c32a0cd468c710040b2f53d8cac69f18dad07985ee37e9a7151ae
|
||||
evbparams=dynafed:0:::
|
||||
addnode=liquid-testnet.blockstream.com:18892
|
||||
addnode=liquidtestnet.com:18891
|
6
production/elements.crontab
Normal file
6
production/elements.crontab
Normal file
@ -0,0 +1,6 @@
|
||||
@reboot sleep 60 ; /usr/local/bin/elementsd -chain=liquidv1 >/dev/null 2>&1
|
||||
@reboot sleep 60 ; /usr/local/bin/elementsd -chain=liquidtestnet >/dev/null 2>&1
|
||||
@reboot sleep 90 ; screen -dmS liquidv1 /elements/electrs/electrs-start-liquid
|
||||
@reboot sleep 90 ; screen -dmS liquidtestnet /elements/electrs/electrs-start-liquidtestnet
|
||||
6 * * * * cd $HOME/asset_registry_db && git pull origin master >/dev/null 2>&1
|
||||
6 * * * * cd $HOME/asset_registry_testnet_db && git pull origin master >/dev/null 2>&1
|
39
production/freebsd/rc.conf
Normal file
39
production/freebsd/rc.conf
Normal file
@ -0,0 +1,39 @@
|
||||
zfs_enable="YES"
|
||||
sendmail_enable="NONE"
|
||||
clear_tmp_enable="YES"
|
||||
syslogd_flags="-b 127.0.0.1"
|
||||
dumpdev="NO"
|
||||
|
||||
hostname="mempool.local"
|
||||
ifconfig_genet0="DHCP"
|
||||
local_unbound_enable="YES"
|
||||
|
||||
ntpdate_enable="YES"
|
||||
ntpdate_hosts="time.nist.gov"
|
||||
|
||||
sshd_enable="NO"
|
||||
openssh_enable="YES"
|
||||
openssh_flags=" \
|
||||
-o 'Port 22' \
|
||||
-o 'UseDNS no' \
|
||||
-o 'KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256' \
|
||||
-o 'AuthenticationMethods publickey,keyboard-interactive' \
|
||||
-o 'PermitRootLogin no' \
|
||||
"
|
||||
|
||||
firewall_enable="YES"
|
||||
firewall_quiet="YES"
|
||||
firewall_type="workstation"
|
||||
firewall_myservices="8333/tcp"
|
||||
firewall_allowservices="any"
|
||||
firewall_logdeny="YES"
|
||||
firewall_trusted="192.168.0.0/16,172.16.0.0/12,10.0.0.0/8"
|
||||
|
||||
bitcoin_enable="YES"
|
||||
bitcoin_testnet_enable="YES"
|
||||
|
||||
nginx_enable="YES"
|
||||
tor_enable="YES"
|
||||
|
||||
mysql_enable="YES"
|
||||
mysql_dbdir="/mysql"
|
179
production/freebsd/rc.d/bitcoin
Normal file
179
production/freebsd/rc.d/bitcoin
Normal file
@ -0,0 +1,179 @@
|
||||
#!/bin/sh
|
||||
# PROVIDE: bitcoin
|
||||
# REQUIRE: LOGIN cleanvar
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to enable :
|
||||
# bitcoin_enable (bool): Set to "NO" by default.
|
||||
# Set it to "YES" to enable bitcoin
|
||||
# bitcoin_user (str) Set to "bitcoin" by default.
|
||||
# bitcoin_group (str) Set to "bitcoin" by default.
|
||||
# bitcoin_conf (str) Set to "/bitcoin/bitcoin.conf" by default.
|
||||
# bitcoin_data_dir (str) Set to "/bitcoin" by default.
|
||||
# bitcoin_syslog_facility(str) Set to "local0" by default.
|
||||
# bitcoin_syslog_priority(str) Set to "info" by default.
|
||||
# bitcoinlimits_enable (bool) Set to "NO" by default.
|
||||
# Set it to "YES" to enable bitcoinlimits
|
||||
# bitcoinlimits_args Set to "-e -U ${bitcoin_user}" by default
|
||||
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="bitcoin"
|
||||
rcvar=bitcoin_enable
|
||||
|
||||
start_precmd="bitcoin_precmd"
|
||||
start_cmd="bitcoin_start"
|
||||
restart_precmd="bitcoin_checkconfig"
|
||||
reload_precmd="bitcoin_checkconfig"
|
||||
configtest_cmd="bitcoin_checkconfig"
|
||||
status_cmd="bitcoin_status"
|
||||
stop_cmd="bitcoin_stop"
|
||||
stop_postcmd="bitcoin_wait"
|
||||
command="/usr/local/bin/bitcoind"
|
||||
daemon_command="/usr/sbin/daemon"
|
||||
extra_commands="configtest"
|
||||
pidfile="/bitcoin/bitcoind.pid"
|
||||
|
||||
: ${bitcoin_enable:="NO"}
|
||||
: ${bitcoinlimits_enable:="NO"}
|
||||
|
||||
load_rc_config ${name}
|
||||
|
||||
: ${bitcoin_user:="bitcoin"}
|
||||
: ${bitcoin_group:="bitcoin"}
|
||||
: ${bitcoin_data_dir:="/bitcoin"}
|
||||
: ${bitcoin_config_file:="/bitcoin/bitcoin.conf"}
|
||||
: ${bitcoin_syslog_facility:="local0"}
|
||||
: ${bitcoin_syslog_priority:="info"}
|
||||
: ${bitcoin_syslog_tag:="bitcoin"}
|
||||
: ${bitcoin_kill_after:="300"}
|
||||
: ${bitcoinlimits_args:="-e -U ${bitcoin_user}"}
|
||||
|
||||
# set up dependant variables
|
||||
procname="${command}"
|
||||
required_files="${bitcoin_config_file}"
|
||||
pidfile="${bitcoin_data_dir}/bitcoind.pid"
|
||||
|
||||
bitcoin_checkconfig()
|
||||
{
|
||||
echo "Performing sanity check on bitcoin configuration:"
|
||||
if [ ! -d "${bitcoin_data_dir}" ]
|
||||
then
|
||||
echo "Missing data directory: ${bitcoin_data_dir}"
|
||||
exit 1
|
||||
fi
|
||||
chown -R "${bitcoin_user}:${bitcoin_group}" "${bitcoin_data_dir}"
|
||||
|
||||
if [ ! -f "${bitcoin_config_file}" ]
|
||||
then
|
||||
echo "Missing configuration file: ${bitcoin_config_file}"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "${command}" ]
|
||||
then
|
||||
echo "Missing executable: ${command}"
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
bitcoin_cleanup()
|
||||
{
|
||||
rm -f "${pidfile}"
|
||||
}
|
||||
|
||||
bitcoin_precmd()
|
||||
{
|
||||
bitcoin_checkconfig
|
||||
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
echo "Bitcoind is not running"
|
||||
rm -f "${pidfile}"
|
||||
fi
|
||||
|
||||
if checkyesno bitcoinlimits_enable
|
||||
then
|
||||
eval $(/usr/bin/limits ${bitcoinlimits_args}) 2>/dev/null
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
bitcoin_status()
|
||||
{
|
||||
local pid
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
echo "Bitcoind is not running"
|
||||
return 1
|
||||
else
|
||||
echo "Bitcoind running, pid: ${pid}"
|
||||
fi
|
||||
}
|
||||
|
||||
bitcoin_start()
|
||||
{
|
||||
echo "Starting bitcoin:"
|
||||
cd "${bitcoin_data_dir}" || return 1
|
||||
${daemon_command} \
|
||||
-u "${bitcoin_user}" \
|
||||
-l "${bitcoin_syslog_facility}" \
|
||||
-s "${bitcoin_syslog_priority}" \
|
||||
-T "${bitcoin_syslog_tag}" \
|
||||
${command} \
|
||||
-printtoconsole=1 \
|
||||
-conf="${bitcoin_config_file}" \
|
||||
-datadir="${bitcoin_data_dir}"
|
||||
}
|
||||
|
||||
bitcoin_stop()
|
||||
{
|
||||
echo "Stopping bitcoin:"
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
echo "Bitcoind is not running"
|
||||
return 1
|
||||
else
|
||||
kill ${pid}
|
||||
fi
|
||||
}
|
||||
|
||||
bitcoin_wait()
|
||||
{
|
||||
local n="${bitcoin_kill_after}"
|
||||
echo "Waiting for bitcoin shutdown:"
|
||||
while :
|
||||
do
|
||||
printf '.'
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
printf '\n'
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
n=$((${n} - 1))
|
||||
if [ ${n} -eq 0 -a -f "${pidfile}" ]
|
||||
then
|
||||
printf "\nForce shutdown"
|
||||
kill -9 $(cat "${pidfile}")
|
||||
for n in 1 2 3
|
||||
do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
printf '\n'
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -f "${pidfile}"
|
||||
echo "Shutdown complete"
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
180
production/freebsd/rc.d/bitcoin_testnet
Normal file
180
production/freebsd/rc.d/bitcoin_testnet
Normal file
@ -0,0 +1,180 @@
|
||||
#!/bin/sh
|
||||
# PROVIDE: bitcoin_testnet
|
||||
# REQUIRE: LOGIN cleanvar
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to enable :
|
||||
# bitcoin_testnet_enable (bool): Set to "NO" by default.
|
||||
# Set it to "YES" to enable bitcoin
|
||||
# bitcoin_testnet_user (str) Set to "bitcoin" by default.
|
||||
# bitcoin_testnet_group (str) Set to "bitcoin" by default.
|
||||
# bitcoin_testnet_conf (str) Set to "/bitcoin/bitcoin.conf" by default.
|
||||
# bitcoin_testnet_data_dir (str) Set to "/var/db/bitcoin" by default.
|
||||
# bitcoin_testnet_syslog_facility(str) Set to "local0" by default.
|
||||
# bitcoin_testnet_syslog_priority(str) Set to "info" by default.
|
||||
# bitcoinlimits_enable (bool) Set to "NO" by default.
|
||||
# Set it to "YES" to enable bitcoinlimits
|
||||
# bitcoinlimits_args Set to "-e -U ${bitcoin_testnet_user}" by default
|
||||
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="bitcoin_testnet"
|
||||
rcvar=bitcoin_testnet_enable
|
||||
|
||||
start_precmd="bitcoin_testnet_precmd"
|
||||
start_cmd="bitcoin_testnet_start"
|
||||
restart_precmd="bitcoin_testnet_checkconfig"
|
||||
reload_precmd="bitcoin_testnet_checkconfig"
|
||||
configtest_cmd="bitcoin_testnet_checkconfig"
|
||||
status_cmd="bitcoin_testnet_status"
|
||||
stop_cmd="bitcoin_testnet_stop"
|
||||
stop_postcmd="bitcoin_testnet_wait"
|
||||
command="/usr/local/bin/bitcoind"
|
||||
daemon_command="/usr/sbin/daemon"
|
||||
extra_commands="configtest"
|
||||
pidfile="/bitcoin/bitcoin.pid"
|
||||
|
||||
: ${bitcoin_testnet_enable:="NO"}
|
||||
: ${bitcoinlimits_enable:="NO"}
|
||||
|
||||
load_rc_config ${name}
|
||||
|
||||
: ${bitcoin_testnet_user:="bitcoin"}
|
||||
: ${bitcoin_testnet_group:="bitcoin"}
|
||||
: ${bitcoin_testnet_data_dir:="/bitcoin"}
|
||||
: ${bitcoin_testnet_config_file:="/bitcoin/bitcoin.conf"}
|
||||
: ${bitcoin_testnet_syslog_facility:="local0"}
|
||||
: ${bitcoin_testnet_syslog_priority:="info"}
|
||||
: ${bitcoin_testnet_syslog_tag:="bitcoin"}
|
||||
: ${bitcoin_testnet_kill_after:="300"}
|
||||
: ${bitcoinlimits_args:="-e -U ${bitcoin_testnet_user}"}
|
||||
|
||||
# set up dependant variables
|
||||
procname="${command}"
|
||||
required_files="${bitcoin_testnet_config_file}"
|
||||
pidfile="${bitcoin_testnet_data_dir}/testnet3/bitcoind.pid"
|
||||
|
||||
bitcoin_testnet_checkconfig()
|
||||
{
|
||||
echo "Performing sanity check on bitcoin configuration:"
|
||||
if [ ! -d "${bitcoin_testnet_data_dir}" ]
|
||||
then
|
||||
echo "Missing data directory: ${bitcoin_testnet_data_dir}"
|
||||
exit 1
|
||||
fi
|
||||
chown -R "${bitcoin_testnet_user}:${bitcoin_testnet_group}" "${bitcoin_testnet_data_dir}"
|
||||
|
||||
if [ ! -f "${bitcoin_testnet_config_file}" ]
|
||||
then
|
||||
echo "Missing configuration file: ${bitcoin_testnet_config_file}"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "${command}" ]
|
||||
then
|
||||
echo "Missing executable: ${command}"
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
bitcoin_testnet_cleanup()
|
||||
{
|
||||
rm -f "${pidfile}"
|
||||
}
|
||||
|
||||
bitcoin_testnet_precmd()
|
||||
{
|
||||
bitcoin_testnet_checkconfig
|
||||
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
echo "Bitcoind is not running"
|
||||
rm -f "${pidfile}"
|
||||
fi
|
||||
|
||||
if checkyesno bitcoinlimits_enable
|
||||
then
|
||||
eval $(/usr/bin/limits ${bitcoinlimits_args}) 2>/dev/null
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
bitcoin_testnet_status()
|
||||
{
|
||||
local pid
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
echo "Bitcoind is not running"
|
||||
return 1
|
||||
else
|
||||
echo "Bitcoind running, pid: ${pid}"
|
||||
fi
|
||||
}
|
||||
|
||||
bitcoin_testnet_start()
|
||||
{
|
||||
echo "Starting bitcoin:"
|
||||
cd "${bitcoin_testnet_data_dir}" || return 1
|
||||
${daemon_command} \
|
||||
-u "${bitcoin_testnet_user}" \
|
||||
-l "${bitcoin_testnet_syslog_facility}" \
|
||||
-s "${bitcoin_testnet_syslog_priority}" \
|
||||
-T "${bitcoin_testnet_syslog_tag}" \
|
||||
${command} \
|
||||
-testnet \
|
||||
-printtoconsole=1 \
|
||||
-conf="${bitcoin_testnet_config_file}" \
|
||||
-datadir="${bitcoin_testnet_data_dir}"
|
||||
}
|
||||
|
||||
bitcoin_testnet_stop()
|
||||
{
|
||||
echo "Stopping bitcoin:"
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
echo "Bitcoind is not running"
|
||||
return 1
|
||||
else
|
||||
kill ${pid}
|
||||
fi
|
||||
}
|
||||
|
||||
bitcoin_testnet_wait()
|
||||
{
|
||||
local n="${bitcoin_testnet_kill_after}"
|
||||
echo "Waiting for bitcoin shutdown:"
|
||||
while :
|
||||
do
|
||||
printf '.'
|
||||
pid=$(check_pidfile "${pidfile}" "${procname}")
|
||||
if [ -z "${pid}" ]
|
||||
then
|
||||
printf '\n'
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
n=$((${n} - 1))
|
||||
if [ ${n} -eq 0 -a -f "${pidfile}" ]
|
||||
then
|
||||
printf "\nForce shutdown"
|
||||
kill -9 $(cat "${pidfile}")
|
||||
for n in 1 2 3
|
||||
do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
printf '\n'
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -f "${pidfile}"
|
||||
echo "Shutdown complete"
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
12
production/freebsd/sysconf.patch
Normal file
12
production/freebsd/sysconf.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/src/raw.rs 2020-10-22 05:59:43.747207000 +0000
|
||||
+++ b/src/raw2.rs 2020-10-22 06:00:04.016688000 +0000
|
||||
@@ -82,9 +82,6 @@
|
||||
Sc2CharTerm = sc!(_SC_2_CHAR_TERM),
|
||||
Sc2CVersion = 96, // TODO(joshlf): Switch to a libc constant once it's added
|
||||
Sc2Upe = sc!(_SC_2_UPE),
|
||||
- ScXbs5Ilp32Off32 = sc!(_SC_XBS5_ILP32_OFF32),
|
||||
- ScXbs5Ilp32Offbig = sc!(_SC_XBS5_ILP32_OFFBIG),
|
||||
- ScXbs5LpbigOffbig = sc!(_SC_XBS5_LPBIG_OFFBIG),
|
||||
}
|
||||
|
||||
/// Query the system's configuration.
|
3
production/freebsd/syslog.d/bitcoin.conf
Normal file
3
production/freebsd/syslog.d/bitcoin.conf
Normal file
@ -0,0 +1,3 @@
|
||||
local0.info /var/log/bitcoind.mainnet
|
||||
local1.info /var/log/bitcoind.testnet
|
||||
local2.info /var/log/elementsd.liquid
|
1277
production/install
Executable file
1277
production/install
Executable file
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ export NVM_DIR="$HOME/.nvm"
|
||||
source "$NVM_DIR/nvm.sh"
|
||||
for site in mainnet liquid testnet bisq signet liquidtestnet
|
||||
do
|
||||
git clone https://github.com/mempool/mempool "${HOME}/${site}"
|
||||
#git clone https://github.com/mempool/mempool "${HOME}/${site}"
|
||||
mkdir -p "${HOME}/public_html/${site}/"
|
||||
|
||||
cd "${HOME}/${site}/backend/"
|
||||
|
Loading…
Reference in New Issue
Block a user