Giter Club home page Giter Club logo

ln-cluster's Introduction

lightning network

run a few lightning nodes on a local bitcoin regtest network with settings controlled by environment variables.

usage

build

LND

LND_VERSION build arg is the version of the lnd container to use as the base image.

docker build \
  -t anax32/lnd:latest \
  -t anax32/lnd:v0.12.0-beta \
  --build-arg LND_VERSION=v0.12.0-beta \
  -f Dockerfile.lnd \
  .

c-lightning

CLN_VERSION build arg is the version of elementsproject/lightningd container to use as the base image.

docker build \
  -t anax32/cln:latest \
  -t anax32/cln:v0.10.2 \
  --build-arg CLN_VERSION=v0.10.2 \
  -f Dockerfile.clightning \
  .

run

given a running bitcoin node, connect the lnd container to the node with environment variables via:

LND

docker run \
  -d \
  --rm \
  -p 8080:8080 \
  --name lnd-node \
  -e BITCOIN_RPC_HOST=btc-node \
  -e BITCOIN_RPC_USER=me \
  -e BITCOIN_RPC_PASS=mypassword1 \
  -e BITCOIN_ZMQ_IP=127.0.0.1 \
  -e BITCOIN_ZMQ_PUBRAWTX_PORT=28332 \
  -e BITCOIN_ZMQ_PUBRAWBLOCK_PORT=28333 \
  anax32/lnd

c-lightning

docker run \
  -d \
  --rm \
  --name cln-node \
  -e BITCOIN_RPC_HOST=btc-node \
  -e BITCOIN_RPC_USER=me \
  -e BITCOIN_RPC_PASS=mypassword1 \
  -e BITCOIN_RPC_PORT=8332 \
  -e BITCOIN_ZMQ_IP=127.0.0.1 \
  -e BITCOIN_ZMQ_PUBRAWTX_PORT=28332 \
  -e BITCOIN_ZMQ_PUBRAWBLOCK_PORT=28333 \
  -e CLN_NETWORK=regtest \
  -e CLN_WALLET=sqlite3:///data/regtest/lightningd.sqlite3 \
  anax32/cln

cluster

see ./docker-compose.yaml for an example of a bitcoin node and lnd node orchestration.

note that the number of replicas for the lightning nodes should included in the ln-node port range (8080-8080+(num-replicas):8080)

notes

test the connections to the bitcoin node by execing into the container and using nc with the environment variables.

docker exec -it lnd-node /bin/bash
nc -v -z ${BITCOIN_ZMQ_IP}:${BITCOIN_ZMQ_PUBRAWBLOCK_PORT}
nc -v -z ${BITCOIN_ZMQ_IP}:${BITCOIN_ZMQ_PUBRAWTX_PORT}
nc -v -z ${BITCOIN_RCP_HOST}:${BITCOIN_RPC_PORT}

all nc calls should report <ip>:<port> open

ln-cluster's People

Contributors

anax32 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.