diff --git a/Dockerfile b/Dockerfile index e282a4e..4747446 100644 --- a/Dockerfile +++ b/Dockerfile @@ -133,9 +133,11 @@ RUN cargo install --locked --path watchtower-plugin WORKDIR /opt/lightningd COPY lightning/. /tmp/lightning-wrapper/lightning COPY ./.git/modules/lightning /tmp/lightning-wrapper/lightning/.git/ + RUN git clone --recursive /tmp/lightning-wrapper/lightning . && \ git checkout $(git --work-tree=/tmp/lightning-wrapper/lightning --git-dir=/tmp/lightning-wrapper/lightning/.git rev-parse HEAD) +ENV PYTHON_VERSION=3 RUN curl -sSL https://install.python-poetry.org | python3 - RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 @@ -165,6 +167,9 @@ COPY --from=clboss /usr/local/bin/clboss /usr/local/libexec/c-lightning/plugins/ # lightningd COPY --from=builder /tmp/lightning_install/ /usr/local/ COPY --from=builder /usr/local/lib/python3.9/dist-packages/ /usr/local/lib/python3.9/dist-packages/ +COPY --from=builder /opt/lightningd/plugins/clnrest /usr/local/lib/python3.9/dist-packages/ +COPY --from=builder /opt/lightningd/contrib/pyln-client /usr/local/lib/python3.9/dist-packages/ +COPY --from=builder /opt/lightningd/contrib/pyln-testing /usr/local/lib/python3.9/dist-packages/ COPY --from=downloader /opt/bitcoin/bin /usr/bin RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/clboss b/clboss index 9dc326a..2c7ce2f 160000 --- a/clboss +++ b/clboss @@ -1 +1 @@ -Subproject commit 9dc326afbcca6826c183cbc704c04a763a07e8d6 +Subproject commit 2c7ce2f5b905d1eb3a5298404ad669f4463511b2 diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh index d0d4c34..d12fec0 100755 --- a/docker_entrypoint.sh +++ b/docker_entrypoint.sh @@ -25,7 +25,7 @@ export RPC_TOR_ADDRESS=$(yq e '.rpc-tor-address' /root/.lightning/start9/config. export UI_TOR_ADDRESS=$(yq e '.web-ui-tor-address' /root/.lightning/start9/config.yaml) export UI_LAN_ADDRESS=$(echo "$UI_TOR_ADDRESS" | sed 's/\.onion/\.local/') export REST_TOR_ADDRESS=$(yq e '.rest-tor-address' /root/.lightning/start9/config.yaml) -# export CLAMS_WEBSOCKET_TOR_ADDRESS=$(yq e '.clams-websocket-tor-address' /root/.lightning/start9/config.yaml) +export CLAMS_WEBSOCKET_TOR_ADDRESS=$(yq e '.clams-websocket-tor-address' /root/.lightning/start9/config.yaml) export WATCHTOWER_TOR_ADDRESS=$(yq e '.watchtower-tor-address' /root/.lightning/start9/config.yaml) export TOWERS_DATA_DIR=/root/.lightning/.watchtower export REST_LAN_ADDRESS=$(echo "$REST_TOR_ADDRESS" | sed 's/\.onion/\.local/') @@ -82,7 +82,7 @@ mkdir -p /root/.lightning/public echo $PEER_TOR_ADDRESS > /root/.lightning/start9/peerTorAddress echo $RPC_TOR_ADDRESS > /root/.lightning/start9/rpcTorAddress echo $REST_TOR_ADDRESS > /root/.lightning/start9/restTorAddress -# echo $CLAMS_WEBSOCKET_TOR_ADDRESS > /root/.lightning/start9/clamsRemoteWebsocketTorAddress +echo $CLAMS_WEBSOCKET_TOR_ADDRESS > /root/.lightning/start9/clamsRemoteWebsocketTorAddress echo $WATCHTOWER_TOR_ADDRESS > /root/.lightning/start9/watchtowerTorAddress sh /root/.lightning/start9/waitForStart.sh @@ -280,14 +280,12 @@ generate_new_rune() { RUNE=$(echo "$RUNE_RESPONSE" | jq -r '.result.rune') UNIQUE_ID=$(echo "$RUNE_RESPONSE" | jq -r '.result.unique_id') - echo "RUNE_RESPONSE" - echo "$RUNE_RESPONSE" - echo "RUNE" - echo "$RUNE" if [ "$RUNE" != "" ] && [ "$RUNE" != "null" ]; then # Save rune in env file echo "LIGHTNING_RUNE=\"$RUNE\"" >> "$RUNE_FILE" + LAST_FOUR=$(echo "$RUNE" | rev | cut -c 1-4 | rev) + echo "Rune ending with ${LAST_FOUR} saved to env file" fi if [ "$UNIQUE_ID" != "" ] && [ "$UNIQUE_ID" != "null" ]; then @@ -308,10 +306,9 @@ fi if [ -f "$COMMANDO_CONFIG" ]; then EXISTING_PUBKEY=$(head -n1 "$COMMANDO_CONFIG") EXISTING_RUNE=$(sed -n "2p" "$COMMANDO_CONFIG") - echo "EXISTING_PUBKEY" - echo "$EXISTING_PUBKEY" - echo "EXISTING_RUNE" - echo "$EXISTING_RUNE" + LAST_FOUR=$(echo "$EXISTING_RUNE" | rev | cut -c 2-5 | rev) + echo "Found existing Pubkey in commando config: $EXISTING_PUBKEY" + echo "Found existing Rune ending with: ${LAST_FOUR} in commando config" fi # Getinfo from CLN diff --git a/manifest.yaml b/manifest.yaml index 225a4cd..878ae87 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,5 +1,5 @@ id: c-lightning -version: 24.02.2 +version: 24.02.2.1 title: Core Lightning license: BSD-MIT wrapper-repo: https://github.com/Start9Labs/cln-startos @@ -7,8 +7,9 @@ upstream-repo: https://github.com/ElementsProject/lightning support-site: https://github.com/ElementsProject/lightning/issues marketing-site: https://blockstream.com/lightning release-notes: |- - * Update lightning to 24.02.2 - [Release Notes](https://github.com/ElementsProject/lightning/releases/tag/v24.02.2) - * Bump Bitcoin dependency version + * Add Clams Remote Config option + * Update clboss to 0.13.1 + * Minor logging changes build: ["make"] description: short: "An implementation of the Lightning Network protocol by Blockstream." @@ -170,21 +171,21 @@ interfaces: protocols: - tcp - http - # websocket: - # name: Clams Websocket - # description: Websocket endpoint for Clams Remote. - # tor-config: - # port-mapping: - # 7272: "7272" - # lan-config: - # 7272: - # ssl: true - # internal: 7272 - # ui: false - # protocols: - # - tcp - # - http - # - ws + websocket: + name: Clams Websocket + description: Websocket endpoint for Clams Remote. + tor-config: + port-mapping: + 7272: "7272" + lan-config: + 7272: + ssl: true + internal: 7272 + ui: false + protocols: + - tcp + - http + - ws dependencies: bitcoind: version: ">=0.21.1.2 <29.0.0" diff --git a/scripts/procedures/getConfig.ts b/scripts/procedures/getConfig.ts index 23ec0e6..5491613 100644 --- a/scripts/procedures/getConfig.ts +++ b/scripts/procedures/getConfig.ts @@ -46,15 +46,15 @@ export const [getConfig, setConfigMatcher] = compat.getConfigAndMatcher({ target: "tor-address", interface: "clnrest", }, - // "clams-websocket-tor-address": { - // name: "Websocket Tor Address", - // description: "The Tor address of the CLN websocket service.", - // type: "pointer", - // subtype: "package", - // "package-id": "c-lightning", - // target: "tor-address", - // interface: "websocket", - // }, + "clams-websocket-tor-address": { + name: "Websocket Tor Address", + description: "The Tor address of the CLN websocket service.", + type: "pointer", + subtype: "package", + "package-id": "c-lightning", + target: "tor-address", + interface: "websocket", + }, "watchtower-tor-address": { name: "TEoS Watchtower API Address", description: "The Tor address of the TEoS Watchtower API", @@ -263,12 +263,12 @@ export const [getConfig, setConfigMatcher] = compat.getConfigAndMatcher({ default: false, }, - // "clams-remote-websocket": { - // type: "boolean", - // name: "Clams Remote", - // description: "Accept incoming connections on port 7272, allowing Clams Remote to connect to Core Lightning.", - // default: false, - // }, + "clams-remote-websocket": { + type: "boolean", + name: "Clams Remote", + description: "Accept incoming connections on port 7272, allowing Clams Remote to connect to Core Lightning.", + default: false, + }, "fee-base": { type: "number", name: "Routing Base Fee", diff --git a/scripts/procedures/migrations.ts b/scripts/procedures/migrations.ts index 6d3c84c..e6cc640 100644 --- a/scripts/procedures/migrations.ts +++ b/scripts/procedures/migrations.ts @@ -318,8 +318,34 @@ export const migration: T.ExpectedExports.migration = throw new Error("Cannot downgrade"); }, }, + "24.02.2.1": { + up: compat.migrations.updateConfig( + (config) => { + if (matches.shape({ + advanced: matches.any + }).test(config)) { + config.advanced["clams-remote-websocket"] = false; + } + return config; + }, + true, + { version: "24.02.2.1", type: "up"}, + ), + down: compat.migrations.updateConfig( + (config) => { + if (matches.shape({ + advanced: matches.shape({"clams-remote-websocket": matches.any}) + }).test(config)) { + delete config.advanced["clams-remote-websocket"]; + } + return config; + }, + true, + { version: "24.02.2.1", type: "down" } + ) + }, }, - "24.02.2", + "24.02.2.1", ); function generateRandomString(length: number) { diff --git a/scripts/procedures/properties.ts b/scripts/procedures/properties.ts index a1a8fd3..7902ce8 100644 --- a/scripts/procedures/properties.ts +++ b/scripts/procedures/properties.ts @@ -86,14 +86,14 @@ export const properties: T.ExpectedExports.properties = async ( ) { return noPropertiesFound; } - // if ( - // (await util.exists(effects, { - // volumeId: "main", - // path: "start9/clamsRemoteWebsocketTorAddress", - // })) === false - // ) { - // return noPropertiesFound; - // } + if ( + (await util.exists(effects, { + volumeId: "main", + path: "start9/clamsRemoteWebsocketTorAddress", + })) === false + ) { + return noPropertiesFound; + } if ( (await util.exists(effects, { volumeId: "main", @@ -121,12 +121,12 @@ export const properties: T.ExpectedExports.properties = async ( path: "start9/restTorAddress", }) .then((x) => x.trim()); - // const clamsRemoteWebsocketTorAddress = await effects - // .readFile({ - // volumeId: "main", - // path: "start9/clamsRemoteWebsocketTorAddress", - // }) - // .then((x) => x.trim()); + const clamsRemoteWebsocketTorAddress = await effects + .readFile({ + volumeId: "main", + path: "start9/clamsRemoteWebsocketTorAddress", + }) + .then((x) => x.trim()); const watchtowerTorAddress = await effects .readFile({ volumeId: "main", @@ -353,18 +353,18 @@ export const properties: T.ExpectedExports.properties = async ( qr: true, masked: true, }, - // ...(config.advanced["clams-remote-websocket"] - // ? {"Clams Remote Websocket URI": { - // type: "string", - // value: `${nodeInfo.id}@${clamsRemoteWebsocketTorAddress}:7272`, - // description: - // "The URI needed by Clams Remote to connect to Core Lightning's websocket interface.", - // copyable: true, - // qr: true, - // masked: true, - // } - // } - // : {}), + ...(config.advanced["clams-remote-websocket"] + ? {"Clams Remote Websocket URI": { + type: "string", + value: `${nodeInfo.id}@${clamsRemoteWebsocketTorAddress}:7272`, + description: + "The URI needed by Clams Remote to connect to Core Lightning's websocket interface.", + copyable: true, + qr: true, + masked: true, + } + } + : {}), "UI Password": { type: "string", value: config["ui-password"], diff --git a/scripts/procedures/setConfig.ts b/scripts/procedures/setConfig.ts index 81f4277..820b0c1 100644 --- a/scripts/procedures/setConfig.ts +++ b/scripts/procedures/setConfig.ts @@ -292,9 +292,9 @@ function configMaker(alias: Alias, config: SetConfig) { const enableCLNRestPlugin = config.advanced.plugins.clnrest ? "clnrest-port=3010\nclnrest-host=0.0.0.0\n" : ""; - // const enableClamsRemoteWebsocket = config.advanced["clams-remote-websocket"] - // ? "bind-addr=ws::7272\n" - // : ""; + const enableClamsRemoteWebsocket = config.advanced["clams-remote-websocket"] + ? "bind-addr=ws::7272\n" + : ""; const enableClbossPlugin = config.advanced.plugins.clboss.enabled === "enabled" ? "plugin=/usr/local/libexec/c-lightning/plugins/clboss" @@ -335,6 +335,7 @@ experimental-onion-messages experimental-offers ${enableExperimentalShutdownWrongFunding} bind-addr=ws::4269 +${enableClamsRemoteWebsocket} ${enableSlingPlugin} ${enableRestPlugin} ${enableCLNRestPlugin}