From 08a0f83b0ae377fa4538a0cdfc6fdb74e3b5a80e Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Fri, 4 Oct 2019 20:30:56 -0500 Subject: [PATCH] Upgrade BTC RPC Explorer to 1.1.1 --- .../systemd/system/btc_rpc_explorer.service | 2 +- .../standard/usr/bin/mynode_post_upgrade.sh | 2 +- rootfs/standard/usr/bin/mynode_startup.sh | 5 ++ .../usr/share/mynode/btc_rpc_explorer_env | 78 +++++++++++++++++++ setup/setup_device.sh | 2 +- 5 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 rootfs/standard/usr/share/mynode/btc_rpc_explorer_env diff --git a/rootfs/standard/etc/systemd/system/btc_rpc_explorer.service b/rootfs/standard/etc/systemd/system/btc_rpc_explorer.service index f3576eed..5d1b080c 100644 --- a/rootfs/standard/etc/systemd/system/btc_rpc_explorer.service +++ b/rootfs/standard/etc/systemd/system/btc_rpc_explorer.service @@ -15,7 +15,7 @@ User=bitcoin Group=bitcoin Type=simple LimitNOFILE=128000 -TimeoutSec=240 +TimeoutSec=120 Restart=always RestartSec=60 StandardOutput=syslog diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index 98d2b287..07e10260 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -117,7 +117,7 @@ if [ "$CURRENT" != "$LNDADMIN_UPGRADE_URL" ]; then fi # Upgrade Bitcoin RPC Explorer -BTCRPCEXPLORER_UPGRADE_URL=https://github.com/janoside/btc-rpc-explorer/archive/v1.0.3.tar.gz +BTCRPCEXPLORER_UPGRADE_URL=https://github.com/janoside/btc-rpc-explorer/archive/v1.1.1.tar.gz BTCRPCEXPLORER_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.btcrpcexplorer_url CURRENT="" if [ -f $BTCRPCEXPLORER_UPGRADE_URL_FILE ]; then diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 05ec5e83..64b37b98 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -136,6 +136,11 @@ if [ ! -f /home/bitcoin/.lnd-admin/credentials.json ]; then chown bitcoin:bitcoin /home/bitcoin/.lnd-admin/credentials.json fi +# BTC RPC Explorer Config +if [ ! -f /opt/mynode/btc-rpc-explorer/.env ]; then + cp /usr/share/mynode/btc_rpc_explorer_env /opt/mynode/btc-rpc-explorer/.env + chown bitcoin:bitcoin /opt/mynode/btc-rpc-explorer/.env +fi # Update files that need RPC password (needed if upgrades overwrite files) PW=$(cat /mnt/hdd/mynode/settings/.btcrpcpw) diff --git a/rootfs/standard/usr/share/mynode/btc_rpc_explorer_env b/rootfs/standard/usr/share/mynode/btc_rpc_explorer_env new file mode 100644 index 00000000..d096ab9e --- /dev/null +++ b/rootfs/standard/usr/share/mynode/btc_rpc_explorer_env @@ -0,0 +1,78 @@ +# The active coin: BTC/LTC +BTCEXP_COIN=BTC + +# Host/Port to bind to +BTCEXP_HOST=0.0.0.0 +BTCEXP_PORT=3002 + +# Bitcoin RPC Credentials (URI -OR- HOST/PORT/USER/PASS) +#BTCEXP_BITCOIND_URI=bitcoin://rpcusername:rpcpassword@127.0.0.1:8332?timeout=10000 +BTCEXP_BITCOIND_HOST=localhost +BTCEXP_BITCOIND_PORT=8332 +BTCEXP_BITCOIND_USER=mynode +BTCEXP_BITCOIND_PASS=bolt +#BTCEXP_BITCOIND_COOKIE=/path/to/bitcoind/.cookie +BTCEXP_BITCOIND_RPC_TIMEOUT=10000 + +# Select optional "address API" to display address tx lists and balances +# Options: electrumx, blockchain.com, blockchair.com, blockcypher.com +# If electrumx set, the BTCEXP_ELECTRUMX_SERVERS variable must also be +# set. +#BTCEXP_ADDRESS_API=(electrumx|blockchain.com|blockcypher.com) +BTCEXP_ADDRESS_API=electrumx + +# Optional ElectrumX Servers. See BTCEXP_ADDRESS_API. This value is only +# used if BTCEXP_ADDRESS_API=electrumx +#BTCEXP_ELECTRUMX_SERVERS=tls://electrumx.server.com:50002,tcp://127.0.0.1:50001,... +BTCEXP_ELECTRUMX_SERVERS=tcp://127.0.0.1:50001 + +# Optional InfluxDB Credentials (URI -OR- HOST/PORT/DBNAME/USER/PASS) +#BTCEXP_ENABLE_INFLUXDB=true +#BTCEXP_INFLUXDB_URI=influx://username:password@127.0.0.1:8086 +#BTCEXP_INFLUXDB_HOST=127.0.0.1 +#BTCEXP_INFLUXDB_PORT=8086 +#BTCEXP_INFLUXDB_DBNAME=influxdb +#BTCEXP_INFLUXDB_USER=dbuser +#BTCEXP_INFLUXDB_PASS=dbpassword + +# Set number of concurrent RPC requests. Should be lower than your node's "rpcworkqueue" value. +# The default for this value is 10, aiming to be less than Bitcoin Core's default rpcworkqueue=16. +#BTCEXP_RPC_CONCURRENCY=10 +BTCEXP_RPC_CONCURRENCY=4 + +# Disable app's in-memory RPC caching to reduce memory usage +#BTCEXP_NO_INMEMORY_RPC_CACHE=true + +# Optional redis server for RPC caching +#BTCEXP_REDIS_URL=redis://localhost:6379 + +#BTCEXP_COOKIE_SECRET=0000aaaafffffgggggg + +# Whether public-demo aspects of the site are active +#BTCEXP_DEMO=true + +# Privacy mode disables: +# Exchange-rate queries, IP-geolocation queries +#BTCEXP_PRIVACY_MODE=true + +# Don't request currency exchange rates +BTCEXP_NO_RATES=true + +# Password protection for site via basic auth (enter any username, only the password is checked) +#BTCEXP_BASIC_AUTH_PASSWORD=mypassword + +# Enable to allow access to all RPC methods +#BTCEXP_RPC_ALLOWALL=true + +# Custom RPC method blacklist +#BTCEXP_RPC_BLACKLIST=signrawtransaction,sendtoaddress,stop,... + +#BTCEXP_GANALYTICS_TRACKING=UA-XXXX-X +#BTCEXP_SENTRY_URL=https://00000fffffff@sentry.io/XXXX +#BTCEXP_IPSTACK_APIKEY=000000fffffaaaaa + +# Optional value for "max_old_space_size", default: 1024 +#BTCEXP_OLD_SPACE_MAX_SIZE=2048 + +# Show tools list in a sub-nav at top of screen (default: true) +BTCEXP_UI_SHOW_TOOLS_SUBHEADER=true \ No newline at end of file diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 9a9dd15e..e4fd8cfa 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -260,7 +260,7 @@ fi # Install Bitcoin RPC Explorer -BTCRPCEXPLORER_UPGRADE_URL=https://github.com/janoside/btc-rpc-explorer/archive/v1.0.3.tar.gz +BTCRPCEXPLORER_UPGRADE_URL=https://github.com/janoside/btc-rpc-explorer/archive/v1.1.1.tar.gz BTCRPCEXPLORER_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.btcrpcexplorer_url CURRENT="" if [ -f $BTCRPCEXPLORER_UPGRADE_URL_FILE ]; then