2021-02-01 17:25:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-01-10 07:19:04 +01:00
|
|
|
# MEMPOOL
|
2022-01-13 06:20:14 +01:00
|
|
|
__MEMPOOL_NETWORK__=${MEMPOOL_NETWORK:=mainnet}
|
2022-01-10 07:19:04 +01:00
|
|
|
__MEMPOOL_BACKEND__=${MEMPOOL_BACKEND:=electrum}
|
2022-01-13 06:20:14 +01:00
|
|
|
__MEMPOOL_HTTP_PORT__=${BACKEND_HTTP_PORT:=8999}
|
2022-01-10 07:19:04 +01:00
|
|
|
__MEMPOOL_SPAWN_CLUSTER_PROCS__=${MEMPOOL_SPAWN_CLUSTER_PROCS:=0}
|
|
|
|
__MEMPOOL_API_URL_PREFIX__=${MEMPOOL_API_URL_PREFIX:=/api/v1/}
|
|
|
|
__MEMPOOL_POLL_RATE_MS__=${MEMPOOL_POLL_RATE_MS:=2000}
|
2022-01-13 06:20:14 +01:00
|
|
|
__MEMPOOL_CACHE_DIR__=${MEMPOOL_CACHE_DIR:=./cache}
|
|
|
|
__MEMPOOL_CLEAR_PROTECTION_MINUTES__=${MEMPOOL_CLEAR_PROTECTION_MINUTES:=20}
|
2022-01-10 07:19:04 +01:00
|
|
|
__MEMPOOL_RECOMMENDED_FEE_PERCENTILE__=${MEMPOOL_RECOMMENDED_FEE_PERCENTILE:=50}
|
2022-01-10 09:42:42 +01:00
|
|
|
__MEMPOOL_BLOCK_WEIGHT_UNITS__=${MEMPOOL_BLOCK_WEIGHT_UNITS:=4000000}
|
2022-01-10 07:19:04 +01:00
|
|
|
__MEMPOOL_INITIAL_BLOCKS_AMOUNT__=${MEMPOOL_INITIAL_BLOCKS_AMOUNT:=8}
|
2022-01-13 06:20:14 +01:00
|
|
|
__MEMPOOL_MEMPOOL_BLOCKS_AMOUNT__=${MEMPOOL_MEMPOOL_BLOCKS_AMOUNT:=8}
|
2022-01-25 10:33:46 +01:00
|
|
|
__MEMPOOL_INDEXING_BLOCKS_AMOUNT__=${MEMPOOL_INDEXING_BLOCKS_AMOUNT:=1100}
|
2022-01-10 07:19:04 +01:00
|
|
|
__MEMPOOL_PRICE_FEED_UPDATE_INTERVAL__=${MEMPOOL_PRICE_FEED_UPDATE_INTERVAL:=3600}
|
|
|
|
__MEMPOOL_USE_SECOND_NODE_FOR_MINFEE__=${MEMPOOL_USE_SECOND_NODE_FOR_MINFEE:=false}
|
|
|
|
__MEMPOOL_EXTERNAL_ASSETS__=${MEMPOOL_EXTERNAL_ASSETS:=[]}
|
|
|
|
|
|
|
|
# CORE_RPC
|
2022-01-13 06:20:14 +01:00
|
|
|
__CORE_RPC_HOST__=${CORE_RPC_HOST:=127.0.0.1}
|
|
|
|
__CORE_RPC_PORT__=${CORE_RPC_PORT:=8332}
|
2022-01-13 09:08:07 +01:00
|
|
|
__CORE_RPC_USERNAME__=${CORE_RPC_USERNAME:=mempool}
|
|
|
|
__CORE_RPC_PASSWORD__=${CORE_RPC_PASSWORD:=mempool}
|
2022-01-10 07:19:04 +01:00
|
|
|
|
2021-02-02 17:54:01 +01:00
|
|
|
# ELECTRUM
|
2022-01-13 06:20:14 +01:00
|
|
|
__ELECTRUM_HOST__=${ELECTRUM_HOST:=127.0.0.1}
|
|
|
|
__ELECTRUM_PORT__=${ELECTRUM_PORT:=50002}
|
|
|
|
__ELECTRUM_TLS_ENABLED__=${ELECTRUM_TLS:=false}
|
2022-01-10 07:19:04 +01:00
|
|
|
|
|
|
|
# ESPLORA
|
|
|
|
__ESPLORA_REST_API_URL__=${ESPLORA_REST_API_URL:=http://127.0.0.1:3000}
|
|
|
|
|
|
|
|
# SECOND_CORE_RPC
|
2022-01-13 09:08:07 +01:00
|
|
|
__SECOND_CORE_RPC_HOST__=${SECOND_CORE_RPC_HOST:=127.0.0.1}
|
|
|
|
__SECOND_CORE_RPC_PORT__=${SECOND_CORE_RPC_PORT:=8332}
|
|
|
|
__SECOND_CORE_RPC_USERNAME__=${SECOND_CORE_RPC_USERNAME:=mempool}
|
|
|
|
__SECOND_CORE_RPC_PASSWORD__=${SECOND_CORE_RPC_PASSWORD:=mempool}
|
2022-01-10 07:19:04 +01:00
|
|
|
|
|
|
|
# DATABASE
|
2022-01-13 06:20:14 +01:00
|
|
|
__DATABASE_ENABLED__=${DATABASE_ENABLED:=true}
|
|
|
|
__DATABASE_HOST__=${DATABASE_HOST:=127.0.0.1}
|
|
|
|
__DATABASE_PORT__=${DATABASE_PORT:=3306}
|
|
|
|
__DATABASE_DATABASE__=${DATABASE_DATABASE:=mempool}
|
|
|
|
__DATABASE_USERNAME__=${DATABASE_USERNAME:=mempool}
|
|
|
|
__DATABASE_PASSWORD__=${DATABASE_PASSWORD:=mempool}
|
2021-02-02 17:54:01 +01:00
|
|
|
|
2022-01-10 07:19:04 +01:00
|
|
|
# SYSLOG
|
|
|
|
__SYSLOG_ENABLED__=${SYSLOG_ENABLED:=false}
|
|
|
|
__SYSLOG_HOST__=${SYSLOG_HOST:=127.0.0.1}
|
|
|
|
__SYSLOG_PORT__=${SYSLOG_PORT:=514}
|
|
|
|
__SYSLOG_MIN_PRIORITY__=${SYSLOG_MIN_PRIORITY:=info}
|
|
|
|
__SYSLOG_FACILITY__=${SYSLOG_FACILITY:=local7}
|
|
|
|
|
|
|
|
# STATISTICS
|
2022-01-11 01:10:34 +01:00
|
|
|
__STATISTICS_ENABLED__=${STATISTICS_ENABLED:=true}
|
2022-01-10 07:19:04 +01:00
|
|
|
__STATISTICS_TX_PER_SECOND_SAMPLE_PERIOD__=${STATISTICS_TX_PER_SECOND_SAMPLE_PERIOD:=150}
|
|
|
|
|
|
|
|
# BISQ
|
|
|
|
__BISQ_ENABLED__=${BISQ_ENABLED:=false}
|
|
|
|
__BISQ_DATA_PATH__=${BISQ_DATA_PATH:=/bisq/statsnode-data/btc_mainnet/db}
|
|
|
|
|
2022-01-13 06:20:14 +01:00
|
|
|
mkdir -p "${__MEMPOOL_CACHE_DIR__}"
|
2021-02-01 17:25:08 +01:00
|
|
|
|
2022-01-13 06:20:14 +01:00
|
|
|
sed -i "s/__MEMPOOL_NETWORK__/${__MEMPOOL_NETWORK__}/g" mempool-config.json
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__MEMPOOL_BACKEND__/${__MEMPOOL_BACKEND__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
sed -i "s/__MEMPOOL_HTTP_PORT__/${__MEMPOOL_HTTP_PORT__}/g" mempool-config.json
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__MEMPOOL_SPAWN_CLUSTER_PROCS__/${__MEMPOOL_SPAWN_CLUSTER_PROCS__}/g" mempool-config.json
|
2022-01-10 09:42:42 +01:00
|
|
|
sed -i "s!__MEMPOOL_API_URL_PREFIX__!${__MEMPOOL_API_URL_PREFIX__}!g" mempool-config.json
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__MEMPOOL_POLL_RATE_MS__/${__MEMPOOL_POLL_RATE_MS__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
sed -i "s!__MEMPOOL_CACHE_DIR__!${__MEMPOOL_CACHE_DIR__}!g" mempool-config.json
|
|
|
|
sed -i "s/__MEMPOOL_CLEAR_PROTECTION_MINUTES__/${__MEMPOOL_CLEAR_PROTECTION_MINUTES__}/g" mempool-config.json
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__MEMPOOL_RECOMMENDED_FEE_PERCENTILE__/${__MEMPOOL_RECOMMENDED_FEE_PERCENTILE__}/g" mempool-config.json
|
|
|
|
sed -i "s/__MEMPOOL_BLOCK_WEIGHT_UNITS__/${__MEMPOOL_BLOCK_WEIGHT_UNITS__}/g" mempool-config.json
|
|
|
|
sed -i "s/__MEMPOOL_INITIAL_BLOCKS_AMOUNT__/${__MEMPOOL_INITIAL_BLOCKS_AMOUNT__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
sed -i "s/__MEMPOOL_MEMPOOL_BLOCKS_AMOUNT__/${__MEMPOOL_MEMPOOL_BLOCKS_AMOUNT__}/g" mempool-config.json
|
2022-01-24 09:43:11 +01:00
|
|
|
sed -i "s/__MEMPOOL_INDEXING_BLOCKS_AMOUNT__/${__MEMPOOL_INDEXING_BLOCKS_AMOUNT__}/g" mempool-config.json
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__MEMPOOL_PRICE_FEED_UPDATE_INTERVAL__/${__MEMPOOL_PRICE_FEED_UPDATE_INTERVAL__}/g" mempool-config.json
|
|
|
|
sed -i "s/__MEMPOOL_USE_SECOND_NODE_FOR_MINFEE__/${__MEMPOOL_USE_SECOND_NODE_FOR_MINFEE__}/g" mempool-config.json
|
|
|
|
sed -i "s/__MEMPOOL_EXTERNAL_ASSETS__/${__MEMPOOL_EXTERNAL_ASSETS__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
|
|
|
|
sed -i "s/__CORE_RPC_HOST__/${__CORE_RPC_HOST__}/g" mempool-config.json
|
|
|
|
sed -i "s/__CORE_RPC_PORT__/${__CORE_RPC_PORT__}/g" mempool-config.json
|
2022-01-13 09:08:07 +01:00
|
|
|
sed -i "s/__CORE_RPC_USERNAME__/${__CORE_RPC_USERNAME__}/g" mempool-config.json
|
|
|
|
sed -i "s/__CORE_RPC_PASSWORD__/${__CORE_RPC_PASSWORD__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
|
2022-01-13 09:08:07 +01:00
|
|
|
sed -i "s/__ELECTRUM_HOST__/${__ELECTRUM_HOST__}/g" mempool-config.json
|
|
|
|
sed -i "s/__ELECTRUM_PORT__/${__ELECTRUM_PORT__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
sed -i "s/__ELECTRUM_TLS_ENABLED__/${__ELECTRUM_TLS_ENABLED__}/g" mempool-config.json
|
|
|
|
|
2022-01-10 09:42:42 +01:00
|
|
|
sed -i "s!__ESPLORA_REST_API_URL__!${__ESPLORA_REST_API_URL__}!g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
|
2022-01-13 09:08:07 +01:00
|
|
|
sed -i "s/__SECOND_CORE_RPC_HOST__/${__SECOND_CORE_RPC_HOST__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SECOND_CORE_RPC_PORT__/${__SECOND_CORE_RPC_PORT__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SECOND_CORE_RPC_USERNAME__/${__SECOND_CORE_RPC_USERNAME__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SECOND_CORE_RPC_PASSWORD__/${__SECOND_CORE_RPC_PASSWORD__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
|
|
|
|
sed -i "s/__DATABASE_ENABLED__/${__DATABASE_ENABLED__}/g" mempool-config.json
|
|
|
|
sed -i "s/__DATABASE_HOST__/${__DATABASE_HOST__}/g" mempool-config.json
|
|
|
|
sed -i "s/__DATABASE_PORT__/${__DATABASE_PORT__}/g" mempool-config.json
|
|
|
|
sed -i "s/__DATABASE_DATABASE__/${__DATABASE_DATABASE__}/g" mempool-config.json
|
|
|
|
sed -i "s/__DATABASE_USERNAME__/${__DATABASE_USERNAME__}/g" mempool-config.json
|
|
|
|
sed -i "s/__DATABASE_PASSWORD__/${__DATABASE_PASSWORD__}/g" mempool-config.json
|
|
|
|
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__SYSLOG_ENABLED__/${__SYSLOG_ENABLED__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SYSLOG_HOST__/${__SYSLOG_HOST__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SYSLOG_PORT__/${__SYSLOG_PORT__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SYSLOG_MIN_PRIORITY__/${__SYSLOG_MIN_PRIORITY__}/g" mempool-config.json
|
|
|
|
sed -i "s/__SYSLOG_FACILITY__/${__SYSLOG_FACILITY__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__STATISTICS_ENABLED__/${__STATISTICS_ENABLED__}/g" mempool-config.json
|
|
|
|
sed -i "s/__STATISTICS_TX_PER_SECOND_SAMPLE_PERIOD__/${__STATISTICS_TX_PER_SECOND_SAMPLE_PERIOD__}/g" mempool-config.json
|
2022-01-13 06:20:14 +01:00
|
|
|
|
2022-01-10 07:19:04 +01:00
|
|
|
sed -i "s/__BISQ_ENABLED__/${__BISQ_ENABLED__}/g" mempool-config.json
|
2022-01-10 09:42:42 +01:00
|
|
|
sed -i "s!__BISQ_DATA_PATH__!${__BISQ_DATA_PATH__}!g" mempool-config.json
|
2021-02-01 17:25:08 +01:00
|
|
|
|
|
|
|
node /backend/dist/index.js
|