├── arm32v6 ├── docker-compose.yml └── docker-compose_spruned_clightning_fulmo.yml ├── arm32v7 └── docker-compose_bitcoin_lnd_rtl.yml ├── arm64v8 └── docker-compose_bitcoin_lnd_rtl.yml ├── btcpay └── docker-compose.yml ├── image ├── fulmo.png ├── rtl.png └── spark.png ├── readme.md ├── setup.sh ├── setup_arm32v6.sh ├── setup_arm32v7.sh ├── setup_arm64v8.sh ├── setup_lnd.sh └── x86_64 ├── docker-compose_bitcoin_clightning_spark.yml ├── docker-compose_bitcoin_lnd_rtl.yml └── docker-compose_lndhub.yml /arm32v6/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | spruned: 4 | restart: unless-stopped 5 | image: lightningcn/spruned:arm32v6 6 | container_name: lightningcn_spruned 7 | command: spruned --rpcbind 0.0.0.0 8 | volumes: 9 | - ./spruned_data:/root/.spruned 10 | ports: 11 | - 8332:8332 12 | 13 | clightning: 14 | image: lightningcn/lightning:arm32v6 15 | container_name: lightningcn_clightning 16 | restart: unless-stopped 17 | entrypoint: > 18 | /bin/bash -c " 19 | while ! nc -z spruned 8332; 20 | do 21 | echo sleeping; 22 | sleep 10; 23 | done; 24 | echo Connected!; 25 | export IP=$$(dig +short spruned); 26 | export PublicIP=$$(curl -s http://v4.ipv6-test.com/api/myip.php) 27 | echo $$IP; 28 | lightningd --bitcoin-rpcconnect=$$IP --bitcoin-rpcuser=rpcuser --bitcoin-rpcpassword=rpcpassword --bitcoin-rpcport=8332 --bind-addr=0.0.0.0:9735 --announce-addr=$$PublicIP:9735 --alias=raspzerow.lightningcn.com --network=bitcoin" 29 | volumes: 30 | - ./clightning_data:/root/.lightning 31 | ports: 32 | - "9735:9735" 33 | links: 34 | - spruned 35 | 36 | fulmo: 37 | restart: unless-stopped 38 | image: lightningcn/fulmo:arm32v6 39 | container_name: lightningcn_fulmo 40 | entrypoint: > 41 | /bin/ash -c " 42 | while ! nc -z clightning 9735; 43 | do 44 | echo sleeping; 45 | sleep 10; 46 | done; 47 | echo Connected!; 48 | /usr/bin/python fulmo.py" 49 | ports: 50 | - "5000:5000" 51 | volumes: 52 | - ./clightning_data/:/root/.lightning/ 53 | depends_on: 54 | - clightning 55 | -------------------------------------------------------------------------------- /arm32v6/docker-compose_spruned_clightning_fulmo.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | spruned: 4 | restart: unless-stopped 5 | image: lightningcn/spruned:arm32v6 6 | container_name: lightningcn_spruned 7 | commond: spruned --rpcbind 0.0.0.0 8 | volumes: 9 | - ./spruned_data:/root/.spruned 10 | ports: 11 | - 8332:8332 12 | 13 | clightning_bitcoin: 14 | image: lightningcn/lightning:v0.6.3.1-arm32v6 15 | container_name: lightningcn_clightning_bitcoin 16 | restart: unless-stopped 17 | environment: 18 | LND_ENVIRONMENT: ${BITCOIN_NETWORK:-testnet} 19 | LIGHTNINGD_CHAIN: btc 20 | LIGHTNINGD_OPT: | 21 | bitcoin-rpcuser=rpcuser 22 | bitcoin-rpcpassword=rpcpassword 23 | bitcoin-rpcconnect=${BITCOIN_NODE:-127.0.0.1}:8332 24 | announce-addr=${LIGHTNING_HOST}:9735 25 | bind-addr=0.0.0.0:9735 26 | network=${LIGHTNING_NETWORK:-testnet} 27 | alias=${LIGHTNING_ALIAS} 28 | chain=btc 29 | volumes: 30 | - ./clightning_data:/root/.lightning 31 | ports: 32 | - "9735:9735" 33 | depends_on: 34 | - spruned 35 | 36 | fulmo: 37 | restart: unless-stopped 38 | image: lightningcn/fulmo:arm32v6 39 | container_name: lightningcn_fulmo 40 | command: "/usr/bin/python fulmo.py" 41 | ports: 42 | - "5000:5000" 43 | volumes: 44 | - ./fulmo_data:/data 45 | - ./clightning_data:/root/.lightning 46 | depends_on: 47 | - clightning_bitcoin 48 | -------------------------------------------------------------------------------- /arm32v7/docker-compose_bitcoin_lnd_rtl.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | bitcoind: 4 | restart: unless-stopped 5 | image: lightningcn/bitcoin:0.17.1-arm32v7 6 | container_name: lightningcn_bitcoind 7 | environment: 8 | BITCOIN_NETWORK: "${BITCOIN_NETWORK:-testnet}" 9 | BITCOIN_DATA: /data 10 | BITCOIN_EXTRA_ARGS: | 11 | disablewallet=1 12 | txindex=1 13 | server=1 14 | rpcuser=rpcuser 15 | rpcpassword=rpcpass 16 | rpcport=43782 17 | port=39388 18 | whitelist=0.0.0.0/0 19 | zmqpubrawblock=tcp://0.0.0.0:28332 20 | zmqpubrawtx=tcp://0.0.0.0:28333 21 | expose: 22 | - "43782" 23 | - "39388" 24 | - "28332" 25 | - "28333" 26 | volumes: 27 | - ./bitcoin_data:/data 28 | 29 | lnd_bitcoin: 30 | image: lightningcn/lnd:v0.6-beta-arm32v7 31 | container_name: lightningcn_lnd_bitcoin 32 | restart: unless-stopped 33 | environment: 34 | LND_CHAIN: "btc" 35 | LND_ENVIRONMENT: ${BITCOIN_NETWORK:-testnet} 36 | LND_DATA: /data 37 | LND_BITCOIND: /btcdata 38 | LND_EXTRA_ARGS: | 39 | restlisten=0.0.0.0:8080 40 | rpclisten=127.0.0.1:10008 41 | rpclisten=0.0.0.0:10009 42 | bitcoin.node=bitcoind 43 | bitcoind.rpcuser=rpcuser 44 | bitcoind.rpcpass=rpcpass 45 | bitcoind.rpchost=bitcoind:43782 46 | bitcoind.zmqpubrawblock=tcp://bitcoind:28332 47 | bitcoind.zmqpubrawtx=tcp://bitcoind:28333 48 | externalip=${LIGHTNING_HOST}:9735 49 | alias=${LIGHTNING_ALIAS} 50 | noseedbackup=1 51 | notls=1 52 | nat=false 53 | volumes: 54 | - ./lnd_data:/data 55 | - ./bitcoin_data:/btcdata 56 | ports: 57 | - "9735:9735" 58 | - "2222:22" 59 | expose: 60 | - "8080" 61 | - "9735" 62 | depends_on: 63 | - bitcoind 64 | 65 | rtl: 66 | restart: unless-stopped 67 | image: shahanafarooqui/rtl:0.2.6-arm32v7 68 | container_name: lightningcn_rtl-wallet 69 | environment: 70 | LND_SERVER_URL: https://lnd_bitcoin:8080/v1 71 | MACAROON_PATH: "/root/.lnd/data/chain/bitcoin/${BITCOIN_NETWORK:-testnet}" 72 | LND_CONFIG_PATH: /root/.lnd/lnd.conf 73 | BITCOIND_CONFIG_PATH: /root/.bitcoin/bitcoin.conf 74 | NODE_AUTH_TYPE: CUSTOM 75 | RTL_CONFIG_PATH: /data/RTL.conf 76 | RTL_PASS: lightningcn 77 | ports: 78 | - "3000:3000" 79 | volumes: 80 | - ./rtldata:/data 81 | - ./lnd_data:/root/.lnd 82 | - ./bitcoin_data:/root/.bitcoin 83 | depends_on: 84 | - lnd_bitcoin 85 | -------------------------------------------------------------------------------- /arm64v8/docker-compose_bitcoin_lnd_rtl.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | bitcoind: 4 | restart: unless-stopped 5 | image: lightningcn/bitcoin:0.17.1-arm64v8 6 | container_name: lightningcn_bitcoind 7 | environment: 8 | BITCOIN_NETWORK: "${BITCOIN_NETWORK:-testnet}" 9 | BITCOIN_DATA: /data 10 | BITCOIN_EXTRA_ARGS: | 11 | disablewallet=1 12 | txindex=1 13 | server=1 14 | rpcuser=rpcuser 15 | rpcpassword=rpcpass 16 | rpcport=43782 17 | port=39388 18 | whitelist=0.0.0.0/0 19 | zmqpubrawblock=tcp://0.0.0.0:28332 20 | zmqpubrawtx=tcp://0.0.0.0:28333 21 | expose: 22 | - "43782" 23 | - "39388" 24 | - "28332" 25 | - "28333" 26 | volumes: 27 | - ./bitcoin_data:/data 28 | 29 | lnd_bitcoin: 30 | image: lightningcn/lnd:v0.6-beta-arm64v8 31 | container_name: lightningcn_lnd_bitcoin 32 | restart: unless-stopped 33 | environment: 34 | LND_CHAIN: "btc" 35 | LND_ENVIRONMENT: ${BITCOIN_NETWORK:-testnet} 36 | LND_DATA: /data 37 | LND_BITCOIND: /btcdata 38 | LND_EXTRA_ARGS: | 39 | restlisten=0.0.0.0:8080 40 | rpclisten=127.0.0.1:10008 41 | rpclisten=0.0.0.0:10009 42 | bitcoin.node=bitcoind 43 | bitcoind.rpchost=bitcoind:43782 44 | bitcoind.rpcuser=rpcuser 45 | bitcoind.rpcpass=rpcpass 46 | bitcoind.zmqpubrawblock=tcp://bitcoind:28332 47 | bitcoind.zmqpubrawtx=tcp://bitcoind:28333 48 | externalip=${LIGHTNING_HOST}:9735 49 | alias=${LIGHTNING_ALIAS} 50 | noseedbackup=1 51 | nat=false 52 | volumes: 53 | - ./lnd_data:/data 54 | - ./bitcoin_data:/btcdata 55 | ports: 56 | - "9735:9735" 57 | - "2222:22" 58 | expose: 59 | - "8080" 60 | - "9735" 61 | depends_on: 62 | - bitcoind 63 | 64 | rtl: 65 | restart: unless-stopped 66 | #image: shahanafarooqui/rtl:0.2.6-arm64v8 67 | image: lightningcn/rtl:arm64v8 68 | container_name: lightningcn_rtl-wallet 69 | environment: 70 | LND_SERVER_URL: https://lnd_bitcoin:8080/v1 71 | MACAROON_PATH: "/root/.lnd/data/chain/bitcoin/${BITCOIN_NETWORK:-testnet}" 72 | LND_CONFIG_PATH: /root/.lnd/lnd.conf 73 | BITCOIND_CONFIG_PATH: /root/.bitcoin/bitcoin.conf 74 | NODE_AUTH_TYPE: CUSTOM 75 | RTL_CONFIG_PATH: /data/RTL.conf 76 | RTL_PASS: lightningcn 77 | ports: 78 | - "3000:3000" 79 | volumes: 80 | - ./rtldata:/data 81 | - ./lnd_data:/root/.lnd 82 | - ./bitcoin_data:/root/.bitcoin 83 | depends_on: 84 | - lnd_bitcoin 85 | -------------------------------------------------------------------------------- /btcpay/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | btcpayserver: 4 | restart: unless-stopped 5 | image: ${BTCPAY_IMAGE:-btcpayserver/btcpayserver:1.0.3.54} 6 | expose: 7 | - "49392" 8 | environment: 9 | BTCPAY_POSTGRES: User ID=postgres;Host=postgres;Port=5432;Database=btcpayserver${NBITCOIN_NETWORK:-regtest} 10 | BTCPAY_NETWORK: ${NBITCOIN_NETWORK:-regtest} 11 | BTCPAY_BIND: 0.0.0.0:49392 12 | BTCPAY_EXTERNALURL: ${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST:-example.com}/ 13 | BTCPAY_ROOTPATH: ${BTCPAY_ROOTPATH:-/} 14 | BTCPAY_SSHTRUSTEDFINGERPRINTS: ${BTCPAY_SSHTRUSTEDFINGERPRINTS} 15 | BTCPAY_SSHKEYFILE: ${BTCPAY_SSHKEYFILE} 16 | BTCPAY_DEBUGLOG: btcpay.log 17 | BTCPAY_CHAINS: "btc" 18 | BTCPAY_BTCEXPLORERURL: http://nbxplorer:32838/ 19 | links: 20 | - postgres 21 | volumes: 22 | - "btcpay_datadir:/datadir" 23 | - "nbxplorer_datadir:/root/.nbxplorer" 24 | ports: 25 | - "80:49392" 26 | nbxplorer: 27 | restart: unless-stopped 28 | image: nicolasdorier/nbxplorer:2.0.0.11 29 | expose: 30 | - "32838" 31 | environment: 32 | NBXPLORER_NETWORK: ${NBITCOIN_NETWORK:-regtest} 33 | NBXPLORER_BIND: 0.0.0.0:32838 34 | NBXPLORER_CHAINS: "btc" 35 | NBXPLORER_BTCRPCURL: http://bitcoind:43782/ 36 | NBXPLORER_BTCNODEENDPOINT: bitcoind:39388 37 | volumes: 38 | - "nbxplorer_datadir:/datadir" 39 | - "bitcoin_datadir:/root/.bitcoin" 40 | postgres: 41 | restart: unless-stopped 42 | image: postgres:9.6.5 43 | volumes: 44 | - "postgres_datadir:/var/lib/postgresql/data" 45 | bitcoind: 46 | restart: unless-stopped 47 | container_name: btcpayserver_bitcoind 48 | image: btcpayserver/bitcoin:0.17.0 49 | environment: 50 | BITCOIN_NETWORK: ${NBITCOIN_NETWORK:-regtest} 51 | BITCOIN_EXTRA_ARGS: | 52 | rpcport=43782 53 | port=39388 54 | disablewallet=1 55 | whitelist=0.0.0.0/0 56 | expose: 57 | - "43782" 58 | - "39388" 59 | volumes: 60 | - "bitcoin_datadir:/data" 61 | volumes: 62 | btcpay_datadir: 63 | nbxplorer_datadir: 64 | postgres_datadir: 65 | bitcoin_datadir: 66 | networks: {} 67 | -------------------------------------------------------------------------------- /image/fulmo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningcn/ln-node/c2e47ae87e43d5bdb80a9664260cbc778190d702/image/fulmo.png -------------------------------------------------------------------------------- /image/rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningcn/ln-node/c2e47ae87e43d5bdb80a9664260cbc778190d702/image/rtl.png -------------------------------------------------------------------------------- /image/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lightningcn/ln-node/c2e47ae87e43d5bdb80a9664260cbc778190d702/image/spark.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # 一键自动安装配置闪电网络节点 2 | 3 | ## 系统需求 4 | 5 | docker 和 docker-compose 6 | 7 | ## 硬件需求 8 | 9 | x86_64 或者arm32v7系统,比如树莓派2, 300G硬盘,内存1G以上 10 | 11 | ## 一键安装 bitcoin + clightning + spark 闪电网络节点 12 | 13 | ``` 14 | sudo bash -c "$(curl -fsSL https://raw.github.com/lightningcn/ln-node/master/setup.sh)" 15 | ``` 16 | 17 | 终端会出现二维码和一个如下url,表示安装完毕,耐心等待同步完毕 18 | 19 | ![spark](image/spark.png) 20 | 21 | 同步完成后, 可以使用spark wallet钱包扫出现的二维码连接节点 22 | 23 | spark wallet 支持windows, macos, linux, android等系统,下载地址 [https://github.com/shesek/spark-wallet/releases/](https://github.com/shesek/spark-wallet/releases) 24 | 25 | [windows系统](https://github.com/shesek/spark-wallet/releases/download/v0.2.4/spark-wallet-0.2.4-win-setup.exe) 26 | 27 | [android系统](https://github.com/shesek/spark-wallet/releases/download/v0.2.4/spark-wallet-0.2.4-android-release.apk) 28 | 29 | [macos系统](https://github.com/shesek/spark-wallet/releases/download/v0.2.4/spark-wallet-0.2.4-mac.zip) 30 | 31 | [linux](https://github.com/shesek/spark-wallet/releases/tag/v0.2.4) 32 | 33 | 34 | ## 一键安装bitcoin + lnd + rtl 闪电网络服务器 35 | 36 | ``` 37 | sudo bash -c "$(curl -fsSL https://raw.github.com/lightningcn/ln-node/master/setup_lnd.sh)" 38 | ``` 39 | 40 | 出现如下结果表示安装完毕,等待同步完成即可 41 | 42 | lightningcn_rtl-wallet1 | Server is up and running, please open the UI at http://localhost:3000 43 | 44 | 可以登陆http://ip:3000查看节点状态 45 | 46 | ![rtl](image/rtl.png) 47 | 48 | 默认登陆密码为lightningcn,可以在docker-compose.yml中修改RTL_PASS, 修改密码后需要重新启动 49 | 50 | ## 树莓派一键安装 bitcoin + lnd + rtl 闪电网络服务器 51 | 52 | ``` 53 | sudo bash -c "$(curl -fsSL https://raw.github.com/lightningcn/ln-node/master/setup_arm32v7.sh)" 54 | ``` 55 | 56 | ## 树莓派zerow 安装 spruned + clightning + fulmo 闪电网络服务器 57 | 58 | download https://github.com/lncm/pi-factory/releases/download/v0.4.1/lncm-box-v0.4.1.img.zip 59 | 60 | ``` 61 | sudo bash -c "$(curl -fsSL https://raw.github.com/lightningcn/ln-node/master/setup_arm32v6.sh)" 62 | ``` 63 | 64 | ![fulmo](image/fulmo.png) 65 | 66 | ## arm64v8 一键安装 bitcoin + lnd + rtl 闪电网络服务器 67 | 68 | ``` 69 | sudo bash -c "$(curl -fsSL https://raw.github.com/lightningcn/ln-node/master/setup_arm64v8.sh)" 70 | ``` 71 | 72 | 73 | ## test btcpay 74 | 75 | ``` 76 | wget https://raw.github.com/lightningcn/ln-node/master/btcpay/docker-compose.yml 77 | docker-compose up 78 | ``` 79 | 80 | ## 其他操作系统 81 | 82 | ubuntu 18.04 上测试通过, 其他liunx版本,需要自己安装docker和docker-compose, 83 | 84 | 下载对应的docker-compose.yml文件, 执行docker-compose up 85 | 86 | 其他支持docker的系统如windows, mac 理论上也可以,没有测试过 87 | 88 | ## NAT 89 | 90 | 如果节点没有公网IP,需要在路由器上配置NAT转换才可以,支持外部访问 91 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $EUID -ne 0 ]]; then 4 | echo "This script must be run as root" 5 | return 6 | fi 7 | 8 | if ! [ -x "$(command -v docker)" ] || ! [ -x "$(command -v docker-compose)" ]; then 9 | if ! [ -x "$(command -v curl)" ]; then 10 | apt-get update 2>error 11 | apt-get install -y \ 12 | curl \ 13 | apt-transport-https \ 14 | ca-certificates \ 15 | software-properties-common \ 16 | 2>error 17 | fi 18 | if ! [ -x "$(command -v docker)" ]; then 19 | if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "armv7l" ]]; then 20 | echo "Trying to install docker..." 21 | curl -fsSL https://get.docker.com -o get-docker.sh 22 | chmod +x get-docker.sh 23 | sh get-docker.sh 24 | rm get-docker.sh 25 | elif [[ "$(uname -m)" == "aarch64" ]]; then 26 | echo "Trying to install docker for armv7 on a aarch64 board..." 27 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - 28 | RELEASE=$(lsb_release -cs) 29 | if [[ "$RELEASE" == "bionic" ]]; then 30 | RELEASE=xenial 31 | fi 32 | add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $RELEASE stable" 33 | apt-get update -y 34 | apt-get install -y docker-ce:armhf 35 | fi 36 | fi 37 | if ! [ -x "$(command -v docker-compose)" ]; then 38 | if [[ "$(uname -m)" == "x86_64" ]]; then 39 | DOCKER_COMPOSE_DOWNLOAD="https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m`" 40 | echo "Trying to install docker-compose by downloading on $DOCKER_COMPOSE_DOWNLOAD ($(uname -m))" 41 | curl -L "$DOCKER_COMPOSE_DOWNLOAD" -o /usr/local/bin/docker-compose 42 | chmod +x /usr/local/bin/docker-compose 43 | else 44 | echo "Trying to install docker-compose by using the docker-compose-builder ($(uname -m))" 45 | ! [ -d "dist" ] && mkdir dist 46 | docker run --rm -ti -v "$(pwd)/dist:/dist" btcpayserver/docker-compose-builder:1.23.2 47 | mv dist/docker-compose /usr/local/bin/docker-compose 48 | chmod +x /usr/local/bin/docker-compose 49 | rm -rf "dist" 50 | fi 51 | fi 52 | fi 53 | 54 | if ! [ -x "$(command -v docker)" ]; then 55 | echo "Failed to install docker" 56 | return 57 | fi 58 | 59 | if ! [ -x "$(command -v docker-compose)" ]; then 60 | echo "Failed to install docker-compose" 61 | return 62 | fi 63 | 64 | # get docker compose yml 65 | DOCKER_COMPOSE_FILE=https://github.com/lightningcn/ln-node/raw/master/x86_64/docker-compose_bitcoin_clightning_spark.yml 66 | curl -L "$DOCKER_COMPOSE_FILE" -o docker-compose.yml 67 | 68 | PublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php) 69 | 70 | export BITCOIN_NETWORK=mainnet 71 | export LIGHTNING_NETWORK=bitcoin 72 | export LIGHTNING_HOST=${PublicIP} 73 | export LIGHTNING_ALIAS=nodex.lightningcn.com 74 | 75 | docker-compose up -d 76 | -------------------------------------------------------------------------------- /setup_arm32v6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $EUID -ne 0 ]]; then 4 | echo "This script must be run as root" 5 | return 6 | fi 7 | 8 | 9 | # get docker compose yml 10 | DOCKER_COMPOSE_FILE=https://github.com/lightningcn/ln-node/raw/master/arm32v6/docker-compose_bitcoin_lnd_rtl.yml 11 | curl -L "$DOCKER_COMPOSE_FILE" -o docker-compose.yml 12 | 13 | docker-compose up -d 14 | -------------------------------------------------------------------------------- /setup_arm32v7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $EUID -ne 0 ]]; then 4 | echo "This script must be run as root" 5 | return 6 | fi 7 | 8 | if ! [ -x "$(command -v docker)" ] || ! [ -x "$(command -v docker-compose)" ]; then 9 | if ! [ -x "$(command -v curl)" ]; then 10 | apt-get update 2>error 11 | apt-get install -y \ 12 | curl \ 13 | apt-transport-https \ 14 | ca-certificates \ 15 | software-properties-common \ 16 | 2>error 17 | fi 18 | if ! [ -x "$(command -v docker)" ]; then 19 | if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "armv7l" ]]; then 20 | echo "Trying to install docker..." 21 | curl -fsSL https://get.docker.com -o get-docker.sh 22 | chmod +x get-docker.sh 23 | sh get-docker.sh 24 | rm get-docker.sh 25 | elif [[ "$(uname -m)" == "aarch64" ]]; then 26 | echo "Trying to install docker for armv7 on a aarch64 board..." 27 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - 28 | RELEASE=$(lsb_release -cs) 29 | if [[ "$RELEASE" == "bionic" ]]; then 30 | RELEASE=xenial 31 | fi 32 | add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $RELEASE stable" 33 | apt-get update -y 34 | apt-get install -y docker-ce:armhf 35 | fi 36 | fi 37 | if ! [ -x "$(command -v docker-compose)" ]; then 38 | if [[ "$(uname -m)" == "x86_64" ]]; then 39 | DOCKER_COMPOSE_DOWNLOAD="https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m`" 40 | echo "Trying to install docker-compose by downloading on $DOCKER_COMPOSE_DOWNLOAD ($(uname -m))" 41 | curl -L "$DOCKER_COMPOSE_DOWNLOAD" -o /usr/local/bin/docker-compose 42 | chmod +x /usr/local/bin/docker-compose 43 | else 44 | echo "Trying to install docker-compose by using the docker-compose-builder ($(uname -m))" 45 | ! [ -d "dist" ] && mkdir dist 46 | docker run --rm -ti -v "$(pwd)/dist:/dist" btcpayserver/docker-compose-builder:1.23.2 47 | mv dist/docker-compose /usr/local/bin/docker-compose 48 | chmod +x /usr/local/bin/docker-compose 49 | rm -rf "dist" 50 | fi 51 | fi 52 | fi 53 | 54 | if ! [ -x "$(command -v docker)" ]; then 55 | echo "Failed to install docker" 56 | return 57 | fi 58 | 59 | if ! [ -x "$(command -v docker-compose)" ]; then 60 | echo "Failed to install docker-compose" 61 | return 62 | fi 63 | 64 | # get docker compose yml 65 | DOCKER_COMPOSE_FILE=https://github.com/lightningcn/ln-node/raw/master/arm32v7/docker-compose_bitcoin_lnd_rtl.yml 66 | curl -L "$DOCKER_COMPOSE_FILE" -o docker-compose.yml 67 | 68 | PublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php) 69 | 70 | export BITCOIN_NETWORK=mainnet 71 | export LIGHTNING_HOST=${PublicIP} 72 | export LIGHTNING_ALIAS=nodex.lightningcn.com 73 | 74 | docker-compose up -d 75 | -------------------------------------------------------------------------------- /setup_arm64v8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $EUID -ne 0 ]]; then 4 | echo "This script must be run as root" 5 | return 6 | fi 7 | 8 | if ! [ -x "$(command -v docker)" ] || ! [ -x "$(command -v docker-compose)" ]; then 9 | if ! [ -x "$(command -v curl)" ]; then 10 | apt-get update 2>error 11 | apt-get install -y \ 12 | curl \ 13 | apt-transport-https \ 14 | ca-certificates \ 15 | software-properties-common \ 16 | 2>error 17 | fi 18 | if ! [ -x "$(command -v docker)" ]; then 19 | if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "armv7l" ]]; then 20 | echo "Trying to install docker..." 21 | curl -fsSL https://get.docker.com -o get-docker.sh 22 | chmod +x get-docker.sh 23 | sh get-docker.sh 24 | rm get-docker.sh 25 | elif [[ "$(uname -m)" == "aarch64" ]]; then 26 | echo "Trying to install docker for armv8 on a aarch64 board..." 27 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - 28 | RELEASE=$(lsb_release -cs) 29 | if [[ "$RELEASE" == "bionic" ]]; then 30 | RELEASE=xenial 31 | fi 32 | add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $RELEASE stable" 33 | apt-get update -y 34 | apt-get install -y docker-ce:armhf 35 | fi 36 | fi 37 | if ! [ -x "$(command -v docker-compose)" ]; then 38 | if [[ "$(uname -m)" == "x86_64" ]]; then 39 | DOCKER_COMPOSE_DOWNLOAD="https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m`" 40 | echo "Trying to install docker-compose by downloading on $DOCKER_COMPOSE_DOWNLOAD ($(uname -m))" 41 | curl -L "$DOCKER_COMPOSE_DOWNLOAD" -o /usr/local/bin/docker-compose 42 | chmod +x /usr/local/bin/docker-compose 43 | else 44 | echo "Trying to install docker-compose by using the docker-compose-builder ($(uname -m))" 45 | ! [ -d "dist" ] && mkdir dist 46 | docker run --rm -ti -v "$(pwd)/dist:/dist" btcpayserver/docker-compose-builder:1.23.2 47 | mv dist/docker-compose /usr/local/bin/docker-compose 48 | chmod +x /usr/local/bin/docker-compose 49 | rm -rf "dist" 50 | fi 51 | fi 52 | fi 53 | 54 | if ! [ -x "$(command -v docker)" ]; then 55 | echo "Failed to install docker" 56 | return 57 | fi 58 | 59 | if ! [ -x "$(command -v docker-compose)" ]; then 60 | echo "Failed to install docker-compose" 61 | return 62 | fi 63 | 64 | # get docker compose yml 65 | DOCKER_COMPOSE_FILE=https://github.com/lightningcn/ln-node/raw/master/arm64v8/docker-compose_bitcoin_lnd_rtl.yml 66 | curl -L "$DOCKER_COMPOSE_FILE" -o docker-compose.yml 67 | 68 | PublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php) 69 | 70 | export BITCOIN_NETWORK=mainnet 71 | export LIGHTNING_HOST=${PublicIP} 72 | export LIGHTNING_ALIAS=arm64v8.lightningcn.com 73 | 74 | docker-compose up -d 75 | -------------------------------------------------------------------------------- /setup_lnd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $EUID -ne 0 ]]; then 4 | echo "This script must be run as root" 5 | return 6 | fi 7 | 8 | if ! [ -x "$(command -v docker)" ] || ! [ -x "$(command -v docker-compose)" ]; then 9 | if ! [ -x "$(command -v curl)" ]; then 10 | apt-get update 2>error 11 | apt-get install -y \ 12 | curl \ 13 | apt-transport-https \ 14 | ca-certificates \ 15 | software-properties-common \ 16 | 2>error 17 | fi 18 | if ! [ -x "$(command -v docker)" ]; then 19 | if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "armv7l" ]]; then 20 | echo "Trying to install docker..." 21 | curl -fsSL https://get.docker.com -o get-docker.sh 22 | chmod +x get-docker.sh 23 | sh get-docker.sh 24 | rm get-docker.sh 25 | elif [[ "$(uname -m)" == "aarch64" ]]; then 26 | echo "Trying to install docker for armv7 on a aarch64 board..." 27 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - 28 | RELEASE=$(lsb_release -cs) 29 | if [[ "$RELEASE" == "bionic" ]]; then 30 | RELEASE=xenial 31 | fi 32 | add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $RELEASE stable" 33 | apt-get update -y 34 | apt-get install -y docker-ce:armhf 35 | fi 36 | fi 37 | if ! [ -x "$(command -v docker-compose)" ]; then 38 | if [[ "$(uname -m)" == "x86_64" ]]; then 39 | DOCKER_COMPOSE_DOWNLOAD="https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m`" 40 | echo "Trying to install docker-compose by downloading on $DOCKER_COMPOSE_DOWNLOAD ($(uname -m))" 41 | curl -L "$DOCKER_COMPOSE_DOWNLOAD" -o /usr/local/bin/docker-compose 42 | chmod +x /usr/local/bin/docker-compose 43 | else 44 | echo "Trying to install docker-compose by using the docker-compose-builder ($(uname -m))" 45 | ! [ -d "dist" ] && mkdir dist 46 | docker run --rm -ti -v "$(pwd)/dist:/dist" btcpayserver/docker-compose-builder:1.23.2 47 | mv dist/docker-compose /usr/local/bin/docker-compose 48 | chmod +x /usr/local/bin/docker-compose 49 | rm -rf "dist" 50 | fi 51 | fi 52 | fi 53 | 54 | if ! [ -x "$(command -v docker)" ]; then 55 | echo "Failed to install docker" 56 | return 57 | fi 58 | 59 | if ! [ -x "$(command -v docker-compose)" ]; then 60 | echo "Failed to install docker-compose" 61 | return 62 | fi 63 | 64 | # get docker compose yml 65 | DOCKER_COMPOSE_FILE=https://github.com/lightningcn/ln-node/raw/master/x86_64/docker-compose_bitcoin_lnd_rtl.yml 66 | curl -L "$DOCKER_COMPOSE_FILE" -o docker-compose.yml 67 | 68 | PublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php) 69 | 70 | export BITCOIN_NETWORK=mainnet 71 | export LIGHTNING_HOST=${PublicIP} 72 | export LIGHTNING_ALIAS=nodex.lightningcn.com 73 | 74 | docker-compose up -d 75 | -------------------------------------------------------------------------------- /x86_64/docker-compose_bitcoin_clightning_spark.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | bitcoind: 4 | restart: unless-stopped 5 | image: lightningcn/bitcoin:0.17.1-amd64 6 | container_name: lightningcn_bitcoind 7 | environment: 8 | BITCOIN_NETWORK: "${BITCOIN_NETWORK:-testnet}" 9 | BITCOIN_EXTRA_ARGS: | 10 | server=1 11 | disablewallet=1 12 | rpcport=43782 13 | port=39388 14 | whitelist=0.0.0.0/0 15 | expose: 16 | - "43782" 17 | - "39388" 18 | volumes: 19 | - ./bitcoin_data:/data 20 | 21 | clightning_bitcoin: 22 | image: lightningcn/lightning:v0.6.3.1-amd64 23 | container_name: lightningcn_clightning_bitcoin 24 | restart: unless-stopped 25 | environment: 26 | LND_ENVIRONMENT: ${BITCOIN_NETWORK:-testnet} 27 | LIGHTNINGD_CHAIN: btc 28 | LIGHTNINGD_OPT: | 29 | bitcoin-datadir=/data 30 | bitcoin-rpcconnect=bitcoind 31 | announce-addr=${LIGHTNING_HOST}:9735 32 | bind-addr=0.0.0.0:9735 33 | network=${LIGHTNING_NETWORK:-testnet} 34 | alias=${LIGHTNING_ALIAS} 35 | chain=btc 36 | volumes: 37 | - ./clightning_data:/root/.lightning 38 | - ./bitcoin_data:/data 39 | ports: 40 | - "9735:9735" 41 | depends_on: 42 | - bitcoind 43 | 44 | spark: 45 | restart: unless-stopped 46 | image: shesek/spark-wallet:standalone 47 | container_name: lightningcn_spark-wallet 48 | environment: 49 | NETWORK: ${BITCOIN_NETWORK:-testnet} 50 | SPARK_OPT: -Q -P --no-tls --public-url http://${LIGHTNING_HOST}:9737 51 | ports: 52 | - "9737:9737" 53 | volumes: 54 | - ./spark_data:/data 55 | - ./clightning_data:/etc/lightning 56 | depends_on: 57 | - clightning_bitcoin 58 | -------------------------------------------------------------------------------- /x86_64/docker-compose_bitcoin_lnd_rtl.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | bitcoind: 4 | restart: unless-stopped 5 | image: lightningcn/bitcoin:0.17.1-amd64 6 | container_name: lightningcn_bitcoind 7 | environment: 8 | BITCOIN_NETWORK: "${BITCOIN_NETWORK:-testnet}" 9 | BITCOIN_DATA: /data 10 | BITCOIN_EXTRA_ARGS: | 11 | disablewallet=1 12 | txindex=1 13 | server=1 14 | rpcuser=rpcuser 15 | rpcpassword=rpcpass 16 | rpcport=43782 17 | port=39388 18 | whitelist=0.0.0.0/0 19 | zmqpubrawblock=tcp://0.0.0.0:28332 20 | zmqpubrawtx=tcp://0.0.0.0:28333 21 | expose: 22 | - "43782" 23 | - "39388" 24 | - "28332" 25 | - "28333" 26 | volumes: 27 | - ./bitcoin_data:/data 28 | 29 | lnd_bitcoin: 30 | image: lightningcn/lnd:v0.8.2-beta-amd64 31 | container_name: lightningcn_lnd_bitcoin 32 | restart: unless-stopped 33 | environment: 34 | LND_CHAIN: "btc" 35 | LND_ENVIRONMENT: ${BITCOIN_NETWORK:-testnet} 36 | LND_DATA: /data 37 | LND_BITCOIND: /btcdata 38 | LND_EXTRA_ARGS: | 39 | restlisten=0.0.0.0:8080 40 | rpclisten=127.0.0.1:10008 41 | rpclisten=0.0.0.0:10009 42 | bitcoin.node=bitcoind 43 | bitcoind.rpchost=bitcoind:43782 44 | bitcoind.rpcuser=rpcuser 45 | bitcoind.rpcpass=rpcpass 46 | bitcoind.zmqpubrawblock=tcp://bitcoind:28332 47 | bitcoind.zmqpubrawtx=tcp://bitcoind:28333 48 | externalip=${LIGHTNING_HOST}:9735 49 | alias=${LIGHTNING_ALIAS} 50 | noseedbackup=1 51 | nat=false 52 | volumes: 53 | - ./lnd_data:/data 54 | - ./bitcoin_data:/btcdata 55 | ports: 56 | - "9735:9735" 57 | - "2222:22" 58 | expose: 59 | - "8080" 60 | - "9735" 61 | depends_on: 62 | - bitcoind 63 | 64 | rtl: 65 | restart: unless-stopped 66 | image: shahanafarooqui/rtl:0.5.4 67 | container_name: lightningcn_rtl-wallet 68 | environment: 69 | LND_SERVER_URL: https://lnd_bitcoin:8080/v1 70 | MACAROON_PATH: "/root/.lnd/data/chain/bitcoin/${BITCOIN_NETWORK:-testnet}" 71 | LND_CONFIG_PATH: /root/.lnd/lnd.conf 72 | BITCOIND_CONFIG_PATH: /root/.bitcoin/bitcoin.conf 73 | NODE_AUTH_TYPE: CUSTOM 74 | RTL_CONFIG_PATH: /data/RTL.conf 75 | RTL_PASS: lightningcn 76 | ports: 77 | - "3000:3000" 78 | volumes: 79 | - ./rtldata:/data 80 | - ./lnd_data:/root/.lnd 81 | - ./bitcoin_data:/root/.bitcoin 82 | depends_on: 83 | - lnd_bitcoin 84 | -------------------------------------------------------------------------------- /x86_64/docker-compose_lndhub.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | bitcoind: 4 | restart: unless-stopped 5 | image: lightningcn/bitcoin:0.17.1-amd64 6 | container_name: lightningcn_bitcoind 7 | environment: 8 | BITCOIN_NETWORK: "${BITCOIN_NETWORK:-testnet}" 9 | BITCOIN_DATA: /data 10 | BITCOIN_EXTRA_ARGS: | 11 | server=1 12 | rpcuser=rpcuser 13 | rpcpassword=rpcpass 14 | rpcport=43785 15 | port=39385 16 | whitelist=0.0.0.0/0 17 | zmqpubrawblock=tcp://0.0.0.0:38332 18 | zmqpubrawtx=tcp://0.0.0.0:38333 19 | expose: 20 | - "43785" 21 | - "39385" 22 | - "38332" 23 | - "38333" 24 | ports: 25 | - "127.0.0.1:43785:43785" 26 | volumes: 27 | - ./bitcoin_data:/data 28 | 29 | lnd_bitcoin: 30 | image: lightningcn/lnd:v0.5.2-beta-amd64 31 | container_name: lightningcn_lnd_bitcoin 32 | restart: unless-stopped 33 | environment: 34 | LND_CHAIN: "btc" 35 | LND_ENVIRONMENT: ${BITCOIN_NETWORK:-testnet} 36 | LND_DATA: /data 37 | LND_BITCOIND: /btcdata 38 | LND_EXTRA_ARGS: | 39 | restlisten=0.0.0.0:8080 40 | rpclisten=127.0.0.1:10008 41 | rpclisten=0.0.0.0:10009 42 | bitcoin.node=bitcoind 43 | bitcoind.rpchost=bitcoind:43785 44 | bitcoind.rpcuser=rpcuser 45 | bitcoind.rpcpass=rpcpass 46 | bitcoind.zmqpubrawblock=tcp://bitcoind:38332 47 | bitcoind.zmqpubrawtx=tcp://bitcoind:38333 48 | externalip=${LIGHTNING_HOST}:9745 49 | tlsextraip=${LIGHTNING_HOST} 50 | #tlsextradomain={LIGHTNING_ALIAS} 51 | alias=${LIGHTNING_ALIAS} 52 | noseedbackup=1 53 | notls=1 54 | volumes: 55 | - ./lnd_data:/data 56 | - ./bitcoin_data:/btcdata 57 | ports: 58 | - "127.0.0.1:10009:10009" 59 | - "9735:9735" 60 | expose: 61 | - "10009" 62 | - "8080" 63 | - "9735" 64 | depends_on: 65 | - bitcoind 66 | 67 | redis: 68 | restart: unless-stopped 69 | image: redis:latest 70 | container_name: lightningcn_redis 71 | command: redis-server --appendonly yes --requirepass password 72 | ports: 73 | - "127.0.0.1:6379:6379" 74 | expose: 75 | - "6379" 76 | volumes: 77 | - ./redis_data:/data 78 | 79 | lndhub: 80 | restart: unless-stopped 81 | image: lightningcn/lndhub:latest 82 | container_name: lightningcn_lndhub 83 | entrypoint: > 84 | /bin/ash -c " 85 | while ! nc -z 127.0.0.1 10009; 86 | do 87 | echo sleeping; 88 | sleep 10; 89 | done; 90 | echo Connected!; 91 | cp /data/lnd_data/tls.cert /data/tls.cert 92 | cp /data/lnd_data/data/chain/bitcoin/regtest/admin.macaroon /data/admin.macaroon 93 | node build/index.js" 94 | environment: 95 | CONFIG: '{"bitcoind": { 96 | "rpc": "http://rpcuser:rpcpass@127.0.0.1:43785" 97 | }, 98 | "redis": { 99 | "port": 6379, 100 | "host": "127.0.0.1", 101 | "family": 4, 102 | "password": "password", 103 | "db": 0 104 | }, 105 | "lnd": { 106 | "url": "127.0.0.1:10009", 107 | "password": "" 108 | } 109 | } 110 | ' 111 | ports: 112 | - "3000:3000" 113 | volumes: 114 | - ./lnd_data:/data/lnd_data 115 | network_mode: host 116 | --------------------------------------------------------------------------------