Browse Source

Expose Bitcoin Core ZMQ ports via environment variables (#468)

update-security
Lounès Ksouri 4 years ago
committed by GitHub
parent
commit
9a67ed3e37
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      scripts/configure
  2. 3
      templates/.env-sample
  3. 5
      templates/bitcoin-sample.conf
  4. 4
      templates/lnd-sample.conf

8
scripts/configure

@ -113,6 +113,9 @@ FRONTAIL_IP="10.21.21.7"
BITCOIN_IP="10.21.21.8"
BITCOIN_RPC_PORT="8332"
BITCOIN_P2P_PORT="8333"
BITCOIN_ZMQ_RAWBLOCK_PORT="28332"
BITCOIN_ZMQ_RAWTX_PORT="28333"
BITCOIN_ZMQ_HASHBLOCK_PORT="28334"
LND_IP="10.21.21.9"
LND_GRPC_PORT="10009"
LND_REST_PORT="8080"
@ -195,7 +198,7 @@ if [ "$BITCOIN_NETWORK" == "regtest" ]; then
sed -i "s/network = \"bitcoin\"/network = \"regtest\"/g;" "$ELECTRS_CONF_FILE"
fi
# Update RPC and P2P Ports
# Update RPC, P2P and ZMQ Ports
sed -i "s/rpcport=<port>/rpcport=$BITCOIN_RPC_PORT/g;" "$BITCOIN_CONF_FILE"
sed -i "s/port=<port>/port=$BITCOIN_P2P_PORT/g;" "$BITCOIN_CONF_FILE"
sed -i "s/<bitcoin-rpc-port>/$BITCOIN_RPC_PORT/g;" "$TOR_CONF_FILE"
@ -259,6 +262,9 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" "
sed -i "s/<electrum-port>/${ELECTRUM_PORT}/g" "${template}"
sed -i "s/<tor-proxy-ip>/${TOR_PROXY_IP}/g" "${template}"
sed -i "s/<tor-proxy-port>/${TOR_PROXY_PORT}/g" "${template}"
sed -i "s/<zmq-rawblock-port>/${BITCOIN_ZMQ_RAWBLOCK_PORT}/g;" "${template}"
sed -i "s/<zmq-rawtx-port>/${BITCOIN_ZMQ_RAWTX_PORT}/g;" "${template}"
sed -i "s/<zmq-hashblock-port>/${BITCOIN_ZMQ_HASHBLOCK_PORT}/g;" "${template}"
# Apps
sed -i "s/<app-btc-rpc-explorer-ip>/${APP_BTC_RPC_EXPLORER_IP}/g" "${template}"

3
templates/.env-sample

@ -11,6 +11,9 @@ BITCOIN_NETWORK=<network>
BITCOIN_IP=<bitcoin-ip>
BITCOIN_RPC_PORT=<port>
BITCOIN_P2P_PORT=<port>
BITCOIN_ZMQ_RAWBLOCK_PORT=<zmq-rawblock-port>
BITCOIN_ZMQ_RAWTX_PORT=<zmq-rawtx-port>
BITCOIN_ZMQ_HASHBLOCK_PORT=<zmq-hashblock-port>
BITCOIN_RPC_USER=<username>
BITCOIN_RPC_PASS=<password>
BITCOIN_RPC_AUTH=<rpcauth>

5
templates/bitcoin-sample.conf

@ -19,8 +19,9 @@ maxconnections=40
maxuploadtarget=1000
# zmq
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
zmqpubrawblock=tcp://0.0.0.0:<zmq-rawblock-port>
zmqpubrawtx=tcp://0.0.0.0:<zmq-rawtx-port>
zmqpubhashblock=tcp://0.0.0.0:<zmq-hashblock-port>
# Indexes
txindex=1

4
templates/lnd-sample.conf

@ -14,8 +14,8 @@ tlsdisableautofill=1
bitcoind.rpchost=<bitcoin-ip>
bitcoind.rpcuser=<username>
bitcoind.rpcpass=<password>
bitcoind.zmqpubrawblock=tcp://<bitcoin-ip>:28332
bitcoind.zmqpubrawtx=tcp://<bitcoin-ip>:28333
bitcoind.zmqpubrawblock=tcp://<bitcoin-ip>:<zmq-rawblock-port>
bitcoind.zmqpubrawtx=tcp://<bitcoin-ip>:<zmq-rawtx-port>
[Bitcoin]
bitcoin.active=1

Loading…
Cancel
Save