mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-20 12:57:23 +02:00
feat: add support for more lightning nodes
This commit is contained in:
parent
36be181e77
commit
f6389c0541
6 changed files with 406 additions and 2 deletions
|
|
@ -14,7 +14,10 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|||
COPY ./app /code/app
|
||||
|
||||
COPY ./docker/regtest/.env.cln1 /code/.env.cln1
|
||||
COPY ./docker/regtest/.env.cln1 /code/.env.cln2
|
||||
COPY ./docker/regtest/.env.lnd1 /code/.env.lnd1
|
||||
COPY ./docker/regtest/.env.lnd1 /code/.env.lnd2
|
||||
COPY ./docker/regtest/.env.lnd1 /code/.env.lnd3
|
||||
COPY ./docker/regtest/entrypoint.sh /code/entrypoint.sh
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ shell_script_path = /root
|
|||
# Redis - uncomment if Redis runs with non standard values (i.e. in Docker etc)
|
||||
redis_host=redis
|
||||
redis_port=6379
|
||||
redis_db=1
|
||||
redis_db=3
|
||||
# leave commented if no password is used
|
||||
# redis_password=my_password
|
||||
|
||||
|
|
|
|||
131
docker/regtest/.env.cln2
Normal file
131
docker/regtest/.env.cln2
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
secret=please_please_update_me_please
|
||||
algorithm=HS256
|
||||
# expiry time in milliseconds (3600000 = 1 hour)
|
||||
jwt_expiry_time=999999999
|
||||
|
||||
# login password
|
||||
login_password=12345678
|
||||
|
||||
# Enable this if you want to run blitz_gui locally.
|
||||
# This will create a file called ~/blitz_api/.cookie with a
|
||||
# JWT token.
|
||||
enable_local_cookie_auth = true
|
||||
|
||||
# Platform tells the backend on what kind of system it is running on.
|
||||
# Different platforms might use different data sources and might yield
|
||||
# different kinds of data. E.g.: If set to "raspiblitz",then hardware
|
||||
# information will be fetched from Redis instead of the native python implementation.
|
||||
# In case of native_python set other optional config vars np_* further below.
|
||||
# supported values: [raspiblitz, native_python]
|
||||
platform=native_python
|
||||
|
||||
# Amount of seconds the app will wait until it'll
|
||||
# send another hardware update
|
||||
# only applies when platform=native_python
|
||||
gather_hw_info_interval = 60
|
||||
|
||||
# Amount of seconds the app will gather CPU usage data for each update
|
||||
# The resulting CPU usage is averaged over this period of time.
|
||||
# To get realistic results at least 0.1 seconds is recommended
|
||||
# must be less than and not equal to gather_hw_info_interval
|
||||
# only applies when platform=native_python
|
||||
cpu_usage_averaging_period = 0.5
|
||||
|
||||
# Poll interval in seconds to gather lightning information and push it via SSE
|
||||
# only applies when platform=native_python
|
||||
gather_ln_info_interval = 5.0
|
||||
|
||||
# Path to the shell script root folder
|
||||
shell_script_path = /root
|
||||
|
||||
# The API can push successfull forwards to SSE client. On big nodes
|
||||
# this can cause lots of traffic. Turn this on if updates are required.
|
||||
# default: false
|
||||
# sse_notify_forward_successes=false
|
||||
|
||||
# If set to 0 all forward event will be sent instantly, otherwise they'll
|
||||
# be gathered and sent as an array of notifications.
|
||||
# This also affects how often the wallet balance is updated (even if sse_notify_forward_successes is false)
|
||||
# default: 2.0 seconds
|
||||
# minimum: 0.3 seconds
|
||||
# forwards_gather_interval=2
|
||||
|
||||
# Redis - uncomment if Redis runs with non standard values (i.e. in Docker etc)
|
||||
redis_host=redis
|
||||
redis_port=6379
|
||||
redis_db=4
|
||||
# leave commented if no password is used
|
||||
# redis_password=my_password
|
||||
|
||||
# mainnet, testnet or regtest
|
||||
network=regtest
|
||||
bitcoind_ip_mainnet=bitcoind
|
||||
bitcoind_ip_testnet=bitcoind
|
||||
bitcoind_ip_regtest=bitcoind
|
||||
bitcoind_port_rpc_mainnet=18443
|
||||
bitcoind_port_rpc_testnet=18443
|
||||
bitcoind_port_rpc_regtest=18443
|
||||
|
||||
|
||||
# The API can either hashblock OR rawblock to be notified of new blocks.
|
||||
# Hashblock is a bit faster, so it should be used if possible.
|
||||
bitcoind_zmq_block_rpc="rawblock"
|
||||
bitcoind_zmq_block_port_mainnet=29001
|
||||
bitcoind_zmq_block_port_testnet=29001
|
||||
bitcoind_zmq_block_port_regtest=29001
|
||||
bitcoind_user=lnbits
|
||||
bitcoind_pw=lnbits
|
||||
|
||||
# lnd_grpc, cln_grpc, none
|
||||
# Please refer to the documentation for the install procedure
|
||||
# for each implementation.
|
||||
ln_node=cln_grpc
|
||||
# LND macaroon in HEX format, or a path to the .macaroon file
|
||||
lnd_macaroon="/root/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon"
|
||||
# LND certificate in HEX format, or a path to the tls.cert file
|
||||
lnd_cert="/root/data/lnd-1/tls.cert"
|
||||
|
||||
lnd_grpc_ip=lnd-1
|
||||
lnd_grpc_port=10009
|
||||
lnd_rest_port=8081
|
||||
|
||||
# cln grpc connection data, cert files are in .lightning data folder
|
||||
# xxd -p -c2000 client.pem
|
||||
cln_grpc_cert="/root/data/clightning-2/regtest/client.pem"
|
||||
# xxd -p -c2000 client-key.pem
|
||||
cln_grpc_key="/root/data/clightning-2/regtest/client-key.pem"
|
||||
# xxd -p -c2000 ca.pem
|
||||
cln_grpc_ca="/root/data/clightning-2/regtest/ca.pem"
|
||||
cln_grpc_ip=clightning-2
|
||||
cln_grpc_port=11109
|
||||
|
||||
# Tor url of this system. Ignored on platform Raspiblitz.
|
||||
# Defaults to empty string
|
||||
# np_tor_address=""
|
||||
|
||||
# Tor url of api endpoint. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_tor_address_api_endpoint="address.onion/api"
|
||||
|
||||
# Tor url of the api docs. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_tor_address_api_docs="address.onion/latest/docs"
|
||||
|
||||
# Local LAN IP. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_ip="192.168.1.50"
|
||||
|
||||
# Local LAN url of api endpoint. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_address_api_endpoint="address.onion/api"
|
||||
|
||||
# Local LAN of the api docs. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_address_api_docs="address.onion/latest/docs"
|
||||
|
||||
# SSH login address. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_ssh_address="username@192.168.1.50"
|
||||
|
||||
# Version of the platform. Ignored on platform Raspiblitz
|
||||
# np_version="v0.5.0beta"
|
||||
131
docker/regtest/.env.lnd2
Normal file
131
docker/regtest/.env.lnd2
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
secret=please_please_update_me_please
|
||||
algorithm=HS256
|
||||
# expiry time in milliseconds (3600000 = 1 hour)
|
||||
jwt_expiry_time=999999999
|
||||
|
||||
# login password
|
||||
login_password=12345678
|
||||
|
||||
# Enable this if you want to run blitz_gui locally.
|
||||
# This will create a file called ~/blitz_api/.cookie with a
|
||||
# JWT token.
|
||||
enable_local_cookie_auth = true
|
||||
|
||||
# Platform tells the backend on what kind of system it is running on.
|
||||
# Different platforms might use different data sources and might yield
|
||||
# different kinds of data. E.g.: If set to "raspiblitz",then hardware
|
||||
# information will be fetched from Redis instead of the native python implementation.
|
||||
# In case of native_python set other optional config vars np_* further below.
|
||||
# supported values: [raspiblitz, native_python]
|
||||
platform=native_python
|
||||
|
||||
# Amount of seconds the app will wait until it'll
|
||||
# send another hardware update
|
||||
# only applies when platform=native_python
|
||||
gather_hw_info_interval = 60
|
||||
|
||||
# Amount of seconds the app will gather CPU usage data for each update
|
||||
# The resulting CPU usage is averaged over this period of time.
|
||||
# To get realistic results at least 0.1 seconds is recommended
|
||||
# must be less than and not equal to gather_hw_info_interval
|
||||
# only applies when platform=native_python
|
||||
cpu_usage_averaging_period = 0.5
|
||||
|
||||
# Poll interval in seconds to gather lightning information and push it via SSE
|
||||
# only applies when platform=native_python
|
||||
gather_ln_info_interval = 5.0
|
||||
|
||||
# Path to the shell script root folder
|
||||
shell_script_path = /root
|
||||
|
||||
# The API can push successfull forwards to SSE client. On big nodes
|
||||
# this can cause lots of traffic. Turn this on if updates are required.
|
||||
# default: false
|
||||
# sse_notify_forward_successes=false
|
||||
|
||||
# If set to 0 all forward event will be sent instantly, otherwise they'll
|
||||
# be gathered and sent as an array of notifications.
|
||||
# This also affects how often the wallet balance is updated (even if sse_notify_forward_successes is false)
|
||||
# default: 2.0 seconds
|
||||
# minimum: 0.3 seconds
|
||||
# forwards_gather_interval=2
|
||||
|
||||
# Redis - uncomment if Redis runs with non standard values (i.e. in Docker etc)
|
||||
redis_host=redis
|
||||
redis_port=6379
|
||||
redis_db=1
|
||||
# leave commented if no password is used
|
||||
# redis_password=my_password
|
||||
|
||||
# mainnet, testnet or regtest
|
||||
network=regtest
|
||||
bitcoind_ip_mainnet=bitcoind
|
||||
bitcoind_ip_testnet=bitcoind
|
||||
bitcoind_ip_regtest=bitcoind
|
||||
bitcoind_port_rpc_mainnet=18443
|
||||
bitcoind_port_rpc_testnet=18443
|
||||
bitcoind_port_rpc_regtest=18443
|
||||
|
||||
|
||||
# The API can either hashblock OR rawblock to be notified of new blocks.
|
||||
# Hashblock is a bit faster, so it should be used if possible.
|
||||
bitcoind_zmq_block_rpc="rawblock"
|
||||
bitcoind_zmq_block_port_mainnet=29001
|
||||
bitcoind_zmq_block_port_testnet=29001
|
||||
bitcoind_zmq_block_port_regtest=29001
|
||||
bitcoind_user=lnbits
|
||||
bitcoind_pw=lnbits
|
||||
|
||||
# lnd_grpc, cln_grpc, none
|
||||
# Please refer to the documentation for the install procedure
|
||||
# for each implementation.
|
||||
ln_node=lnd_grpc
|
||||
# LND macaroon in HEX format, or a path to the .macaroon file
|
||||
lnd_macaroon="/root/data/lnd-2/data/chain/bitcoin/regtest/admin.macaroon"
|
||||
# LND certificate in HEX format, or a path to the tls.cert file
|
||||
lnd_cert="/root/data/lnd-2/tls.cert"
|
||||
|
||||
lnd_grpc_ip=lnd-2
|
||||
lnd_grpc_port=10009
|
||||
lnd_rest_port=8081
|
||||
|
||||
# cln grpc connection data, cert files are in .lightning data folder
|
||||
# xxd -p -c2000 client.pem
|
||||
cln_grpc_cert="/root/data/clightning-1/regtest/client.pem"
|
||||
# xxd -p -c2000 client-key.pem
|
||||
cln_grpc_key="/root/data/clightning-1/regtest/client.pem"
|
||||
# xxd -p -c2000 ca.pem
|
||||
cln_grpc_ca="/root/data/clightning-1/regtest/client.pem"
|
||||
cln_grpc_ip=127.0.0.1
|
||||
cln_grpc_port=9537
|
||||
|
||||
# Tor url of this system. Ignored on platform Raspiblitz.
|
||||
# Defaults to empty string
|
||||
# np_tor_address=""
|
||||
|
||||
# Tor url of api endpoint. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_tor_address_api_endpoint="address.onion/api"
|
||||
|
||||
# Tor url of the api docs. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_tor_address_api_docs="address.onion/latest/docs"
|
||||
|
||||
# Local LAN IP. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_ip="192.168.1.50"
|
||||
|
||||
# Local LAN url of api endpoint. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_address_api_endpoint="address.onion/api"
|
||||
|
||||
# Local LAN of the api docs. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_address_api_docs="address.onion/latest/docs"
|
||||
|
||||
# SSH login address. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_ssh_address="username@192.168.1.50"
|
||||
|
||||
# Version of the platform. Ignored on platform Raspiblitz
|
||||
# np_version="v0.5.0beta"
|
||||
131
docker/regtest/.env.lnd3
Normal file
131
docker/regtest/.env.lnd3
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
secret=please_please_update_me_please
|
||||
algorithm=HS256
|
||||
# expiry time in milliseconds (3600000 = 1 hour)
|
||||
jwt_expiry_time=999999999
|
||||
|
||||
# login password
|
||||
login_password=12345678
|
||||
|
||||
# Enable this if you want to run blitz_gui locally.
|
||||
# This will create a file called ~/blitz_api/.cookie with a
|
||||
# JWT token.
|
||||
enable_local_cookie_auth = true
|
||||
|
||||
# Platform tells the backend on what kind of system it is running on.
|
||||
# Different platforms might use different data sources and might yield
|
||||
# different kinds of data. E.g.: If set to "raspiblitz",then hardware
|
||||
# information will be fetched from Redis instead of the native python implementation.
|
||||
# In case of native_python set other optional config vars np_* further below.
|
||||
# supported values: [raspiblitz, native_python]
|
||||
platform=native_python
|
||||
|
||||
# Amount of seconds the app will wait until it'll
|
||||
# send another hardware update
|
||||
# only applies when platform=native_python
|
||||
gather_hw_info_interval = 60
|
||||
|
||||
# Amount of seconds the app will gather CPU usage data for each update
|
||||
# The resulting CPU usage is averaged over this period of time.
|
||||
# To get realistic results at least 0.1 seconds is recommended
|
||||
# must be less than and not equal to gather_hw_info_interval
|
||||
# only applies when platform=native_python
|
||||
cpu_usage_averaging_period = 0.5
|
||||
|
||||
# Poll interval in seconds to gather lightning information and push it via SSE
|
||||
# only applies when platform=native_python
|
||||
gather_ln_info_interval = 5.0
|
||||
|
||||
# Path to the shell script root folder
|
||||
shell_script_path = /root
|
||||
|
||||
# The API can push successfull forwards to SSE client. On big nodes
|
||||
# this can cause lots of traffic. Turn this on if updates are required.
|
||||
# default: false
|
||||
# sse_notify_forward_successes=false
|
||||
|
||||
# If set to 0 all forward event will be sent instantly, otherwise they'll
|
||||
# be gathered and sent as an array of notifications.
|
||||
# This also affects how often the wallet balance is updated (even if sse_notify_forward_successes is false)
|
||||
# default: 2.0 seconds
|
||||
# minimum: 0.3 seconds
|
||||
# forwards_gather_interval=2
|
||||
|
||||
# Redis - uncomment if Redis runs with non standard values (i.e. in Docker etc)
|
||||
redis_host=redis
|
||||
redis_port=6379
|
||||
redis_db=2
|
||||
# leave commented if no password is used
|
||||
# redis_password=my_password
|
||||
|
||||
# mainnet, testnet or regtest
|
||||
network=regtest
|
||||
bitcoind_ip_mainnet=bitcoind
|
||||
bitcoind_ip_testnet=bitcoind
|
||||
bitcoind_ip_regtest=bitcoind
|
||||
bitcoind_port_rpc_mainnet=18443
|
||||
bitcoind_port_rpc_testnet=18443
|
||||
bitcoind_port_rpc_regtest=18443
|
||||
|
||||
|
||||
# The API can either hashblock OR rawblock to be notified of new blocks.
|
||||
# Hashblock is a bit faster, so it should be used if possible.
|
||||
bitcoind_zmq_block_rpc="rawblock"
|
||||
bitcoind_zmq_block_port_mainnet=29001
|
||||
bitcoind_zmq_block_port_testnet=29001
|
||||
bitcoind_zmq_block_port_regtest=29001
|
||||
bitcoind_user=lnbits
|
||||
bitcoind_pw=lnbits
|
||||
|
||||
# lnd_grpc, cln_grpc, none
|
||||
# Please refer to the documentation for the install procedure
|
||||
# for each implementation.
|
||||
ln_node=lnd_grpc
|
||||
# LND macaroon in HEX format, or a path to the .macaroon file
|
||||
lnd_macaroon="/root/data/lnd-3/data/chain/bitcoin/regtest/admin.macaroon"
|
||||
# LND certificate in HEX format, or a path to the tls.cert file
|
||||
lnd_cert="/root/data/lnd-3/tls.cert"
|
||||
|
||||
lnd_grpc_ip=lnd-2
|
||||
lnd_grpc_port=10009
|
||||
lnd_rest_port=8081
|
||||
|
||||
# cln grpc connection data, cert files are in .lightning data folder
|
||||
# xxd -p -c2000 client.pem
|
||||
cln_grpc_cert="/root/data/clightning-1/regtest/client.pem"
|
||||
# xxd -p -c2000 client-key.pem
|
||||
cln_grpc_key="/root/data/clightning-1/regtest/client.pem"
|
||||
# xxd -p -c2000 ca.pem
|
||||
cln_grpc_ca="/root/data/clightning-1/regtest/client.pem"
|
||||
cln_grpc_ip=127.0.0.1
|
||||
cln_grpc_port=9537
|
||||
|
||||
# Tor url of this system. Ignored on platform Raspiblitz.
|
||||
# Defaults to empty string
|
||||
# np_tor_address=""
|
||||
|
||||
# Tor url of api endpoint. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_tor_address_api_endpoint="address.onion/api"
|
||||
|
||||
# Tor url of the api docs. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_tor_address_api_docs="address.onion/latest/docs"
|
||||
|
||||
# Local LAN IP. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_ip="192.168.1.50"
|
||||
|
||||
# Local LAN url of api endpoint. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_address_api_endpoint="address.onion/api"
|
||||
|
||||
# Local LAN of the api docs. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_local_address_api_docs="address.onion/latest/docs"
|
||||
|
||||
# SSH login address. Ignored on platform Raspiblitz
|
||||
# Defaults to empty string
|
||||
# np_ssh_address="username@192.168.1.50"
|
||||
|
||||
# Version of the platform. Ignored on platform Raspiblitz
|
||||
# np_version="v0.5.0beta"
|
||||
|
|
@ -3,8 +3,16 @@
|
|||
|
||||
if [ "$LN_BACKEND" = "cln-1" ]; then
|
||||
cp /code/.env.cln1 /code/.env
|
||||
else
|
||||
elif [ "$LN_BACKEND" = "cln-2" ]; then
|
||||
cp /code/.env.cln2 /code/.env
|
||||
elif [ "$LN_BACKEND" = "lnd-1" ]; then
|
||||
cp /code/.env.lnd1 /code/.env
|
||||
elif [ "$LN_BACKEND" = "lnd-2" ]; then
|
||||
cp /code/.env.lnd2 /code/.env
|
||||
elif [ "$LN_BACKEND" = "lnd-3" ]; then
|
||||
cp /code/.env.lnd3 /code/.env
|
||||
else
|
||||
echo "Unknown LN_BACKEND: $LN_BACKEND"
|
||||
fi
|
||||
|
||||
# wait until the nodes are ready
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue