Skip to content

Commit

Permalink
Update/eos 0.2/0.10.2 (#21)
Browse files Browse the repository at this point in the history
* add rebalance, summary, and c-lightning-REST

* fix macaroon and update manifest/Dockerfile

* update submodule to 0.10.1

* update rebalance plugin for 0.10.1 compatibility

* address pr comments

* allow disabling of plugins; update c-lightning-REST submodule

* add REST API macaroon to Properties page

* update submodule to 0.10.2, fix build

* update release notes

* rustfmt

* add hex macaroon and port to properties, minor nits, update submodules
  • Loading branch information
chrisguida authored Dec 16, 2021
1 parent 5041d07 commit 2a0a9d1
Show file tree
Hide file tree
Showing 12 changed files with 310 additions and 57 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
[submodule "c-lightning-http-plugin"]
path = c-lightning-http-plugin
url = git@github.com:Start9Labs/c-lightning-http-plugin.git
[submodule "plugins"]
path = plugins
url = https://github.com/lightningd/plugins
[submodule "c-lightning-REST"]
path = c-lightning-REST
url = https://github.com/Ride-The-Lightning/c-lightning-REST
33 changes: 26 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,53 @@ RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/incl
--with-gui=no \
--disable-wallet \
--enable-util-cli
RUN make -j24
RUN make -j$(($(nproc) - 1))
RUN strip ./src/bitcoin-cli

FROM alpine:3.12 as builder

RUN apk add ca-certificates alpine-sdk autoconf automake git libtool gmp-dev \
sqlite-dev python2 python3 py3-pip py3-mako net-tools zlib-dev libsodium gettext
RUN pip3 install mrkd
sqlite-dev python2 python3 py3-pip py3-mako net-tools zlib-dev libsodium gettext jq
RUN pip3 install mrkd mistune==0.8.4

ADD ./.gitmodules /root/.gitmodules
ADD ./.git /root/.git
ADD ./lightning /root/lightning
WORKDIR /root/lightning

RUN rm -rf cli/test/*.c
RUN ./configure
RUN make -j24
RUN make -j$(($(nproc) - 1))
RUN make install

FROM alpine:3.12 as runner
FROM arm32v7/node:12-alpine3.12 as runner

RUN apk update
RUN apk add tini
RUN apk add sqlite-dev gmp libgcc libevent libstdc++ boost-filesystem=1.72.0-r6
RUN apk add sqlite-dev gmp libgcc libevent libstdc++ boost-filesystem=1.72.0-r6 python3 py3-pip nodejs
RUN apk add --update openssl && \
rm -rf /var/cache/apk/*

RUN mkdir -p /usr/local/libexec/c-lightning/plugins

# rebalance
ADD ./plugins/rebalance /usr/local/libexec/c-lightning/plugins/rebalance
RUN pip3 install -r /usr/local/libexec/c-lightning/plugins/rebalance/requirements.txt
RUN chmod a+x /usr/local/libexec/c-lightning/plugins/rebalance/rebalance.py

#summary
ADD ./plugins/summary /usr/local/libexec/c-lightning/plugins/summary
RUN pip3 install -r /usr/local/libexec/c-lightning/plugins/summary/requirements.txt
RUN chmod a+x /usr/local/libexec/c-lightning/plugins/summary/summary.py

#c-lightning-REST
ADD ./c-lightning-REST /usr/local/libexec/c-lightning/plugins/c-lightning-REST
WORKDIR /usr/local/libexec/c-lightning/plugins/c-lightning-REST
RUN npm install --only=production

ARG BITCOIN_VERSION
RUN test -n "$BITCOIN_VERSION"

RUN mkdir -p /usr/local/libexec/c-lightning/plugins
COPY --from=builder /usr/local /usr/local
COPY --from=bitcoin-core /bitcoin-${BITCOIN_VERSION}/src/bitcoin-cli /usr/local/bin
ADD ./c-lightning-http-plugin/target/armv7-unknown-linux-musleabihf/release/c-lightning-http-plugin /usr/local/libexec/c-lightning/plugins/c-lightning-http-plugin
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ BITCOIN_VERSION := "0.21.0"
C_LIGHTNING_GIT_REF := $(shell cat .git/modules/lightning/HEAD)
C_LIGHTNING_GIT_FILE := $(addprefix .git/modules/lightning/,$(if $(filter ref:%,$(C_LIGHTNING_GIT_REF)),$(lastword $(C_LIGHTNING_GIT_REF)),HEAD))
HTTP_PLUGIN_SRC := $(shell find ./c-lightning-http-plugin/src) c-lightning-http-plugin/Cargo.toml c-lightning-http-plugin/Cargo.lock
PLUGINS_SRC := $(shell find ./plugins)
C_LIGHTNING_REST_SRC := $(shell find ./c-lightning-REST)
HTTP_PLUGIN_SRC := $(shell find ./c-lightning-http-plugin/src) c-lightning-http-plugin/Cargo.toml c-lightning-http-plugin/Cargo.lock
CONFIGURATOR_SRC := $(shell find ./configurator/src) configurator/Cargo.toml configurator/Cargo.lock

.DELETE_ON_ERROR:
Expand All @@ -17,7 +20,7 @@ c-lightning.s9pk: manifest.yaml config_spec.yaml config_rules.yaml image.tar ins
appmgr -vv pack $(shell pwd) -o c-lightning.s9pk
appmgr -vv verify c-lightning.s9pk

image.tar: Dockerfile docker_entrypoint.sh configurator/target/armv7-unknown-linux-musleabihf/release/configurator c-lightning-http-plugin/target/armv7-unknown-linux-musleabihf/release/c-lightning-http-plugin $(C_LIGHTNING_GIT_FILE)
image.tar: Dockerfile docker_entrypoint.sh configurator/target/armv7-unknown-linux-musleabihf/release/configurator c-lightning-http-plugin/target/armv7-unknown-linux-musleabihf/release/c-lightning-http-plugin $(C_LIGHTNING_GIT_FILE) $(PLUGINS_SRC) $(C_LIGHTNING_REST_SRC)
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/c-lightning --build-arg BITCOIN_VERSION=$(BITCOIN_VERSION) --platform=linux/arm/v7 -o type=docker,dest=image.tar .

configurator/target/armv7-unknown-linux-musleabihf/release/configurator: $(CONFIGURATOR_SRC)
Expand Down
1 change: 1 addition & 0 deletions c-lightning-REST
Submodule c-lightning-REST added at d9c0a2
45 changes: 45 additions & 0 deletions config_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,48 @@ advanced:
description: |
Allow channel shutdown with alternate txids
default: false
plugins:
type: object
name: Plugins
description: |
Plugins are subprocesses that provide extra functionality and run alongside the lightningd process inside
the main C-Lightning container in order to communicate directly with it.
Their source is maintained separately from that of C-Lightning itself.
nullable: false
nullByDefault: false
spec:
http:
type: boolean
name: Enable C-Lightning-HTTP-Plugin
description: |
This plugin is a direct proxy for the unix domain socket from the HTTP interface.
It is required for Spark Wallet to connect to C-Lightning.
Source: https://github.com/Start9Labs/c-lightning-http-plugin
default: true
rebalance:
type: boolean
name: Enable Rebalance Plugin
description: |
Enables the `rebalance` rpc command, which moves liquidity between your channels using circular payments.
See `help rebalance` on the CLI or in the Spark console for usage instructions.
Source: https://github.com/lightningd/plugins/tree/master/rebalance
default: false
summary:
type: boolean
name: Enable Summary Plugin
description: |
Enables the `summary` rpc command, which outputs a text summary of your node, including fiat amounts.
Can be called via command line or the Spark console.
Source: https://github.com/lightningd/plugins/tree/master/summary
default: false
rest:
type: boolean
name: Enable C-Lightning-REST Plugin
description: |
This plugin exposes an LND-like REST API. It is required for Ride The Lighting to connect to C-Lightning.
Source: https://github.com/Ride-The-Lightning/c-lightning-REST
default: true
16 changes: 16 additions & 0 deletions configurator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions configurator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ edition = "2018"

[dependencies]
anyhow = "1.0.33"
base64 = "0.13.0"
hex = "0.4.3"
http = "0.2.1"
linear-map = { version = "1.2.0", features = ["serde_impl"] }
nix = "0.19.0"
Expand Down
8 changes: 6 additions & 2 deletions configurator/src/config.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ bitcoin-rpcuser={bitcoin_rpc_user}
bitcoin-rpcpassword={bitcoin_rpc_pass}
bitcoin-rpcconnect={bitcoin_rpc_host}
bitcoin-rpcport={bitcoin_rpc_port}
plugin=/usr/local/libexec/c-lightning/plugins/c-lightning-http-plugin

http-user={rpc_user}
http-pass={rpc_pass}
Expand All @@ -26,4 +25,9 @@ cltv-delta={cltv_delta}
{enable_experimental_dual_fund}
{enable_experimental_onion_messages}
{enable_experimental_offers}
{enable_experimental_shutdown_wrong_funding}
{enable_experimental_shutdown_wrong_funding}

{enable_http_plugin}
{enable_rebalance_plugin}
{enable_summary_plugin}
{enable_rest_plugin}
Loading

0 comments on commit 2a0a9d1

Please sign in to comment.