From b027ccc02586b5e0dd9ac1d548d97e752fef5e63 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 14 Dec 2020 13:06:21 +0100 Subject: [PATCH 1/3] GitHub: only build docker images for 64bit ARM To disincentivize users of 32bit machines to use lnd, we removed the ARMv7 (32bit) target for docker images there. It therefore doesn't make sense to provide LiT images for 32bit machines either. --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 998960dd5..bceac4b7b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,7 +38,7 @@ jobs: uses: docker/build-push-action@v2 with: push: true - platforms: linux/amd64,linux/arm/v7,linux/arm64 + platforms: linux/amd64,linux/arm64 tags: "${{ env.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}:${{ env.RELEASE_VERSION }}" build-args: checkout=${{ env.RELEASE_VERSION }} From c7dda1232ab524dd0e8e1712d4b59db5ddd904a5 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 14 Dec 2020 13:36:01 +0100 Subject: [PATCH 2/3] mod+README: update loop to version 0.11.2-beta --- README.md | 2 ++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de8caa0cc..b72ee24c2 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Lightning Terminal is backwards compatible with `lnd` back to version v0.11.1-be | LiT | LND | | ---------------- | ------------ | +| **v0.3.3-alpha** | v0.11.1-beta | | **v0.3.2-alpha** | v0.11.1-beta | | **v0.3.1-alpha** | v0.11.1-beta | | **v0.3.0-alpha** | v0.11.1-beta | @@ -75,6 +76,7 @@ Lightning Terminal is backwards compatible with `lnd` back to version v0.11.1-be | LiT | LND | Loop | Faraday | Pool | | ---------------- | ------------ | ----------- | ------------ |---------------| +| **v0.3.3-alpha** | v0.11.1-beta | v0.11.2-beta | v0.2.2-alpha | v0.3.4-alpha | | **v0.3.2-alpha** | v0.11.1-beta | v0.11.1-beta | v0.2.2-alpha | v0.3.4-alpha | | **v0.3.1-alpha** | v0.11.1-beta | v0.11.1-beta | v0.2.2-alpha | v0.3.3-alpha | | **v0.3.0-alpha** | v0.11.1-beta | v0.11.0-beta | v0.2.2-alpha | v0.3.2-alpha | diff --git a/go.mod b/go.mod index 50c608fa9..55d04b693 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/lightninglabs/aperture v0.1.3-beta github.com/lightninglabs/faraday v0.2.2-alpha github.com/lightninglabs/lndclient v0.11.0-3 - github.com/lightninglabs/loop v0.11.1-beta + github.com/lightninglabs/loop v0.11.2-beta github.com/lightninglabs/pool v0.3.4-alpha github.com/lightningnetwork/lnd v0.11.1-beta github.com/lightningnetwork/lnd/cert v1.0.3 diff --git a/go.sum b/go.sum index 25503ad56..22f94cedf 100644 --- a/go.sum +++ b/go.sum @@ -230,8 +230,8 @@ github.com/lightninglabs/lndclient v0.11.0-0/go.mod h1:8/cTKNwgL87NX123gmlv3Xh6p github.com/lightninglabs/lndclient v0.11.0-3 h1:x8co3UOeaUwh0iBFNeaPaqJsg8gvlgV/+fQHp2MT9eI= github.com/lightninglabs/lndclient v0.11.0-3/go.mod h1:8/cTKNwgL87NX123gmlv3Xh6p1a7pvzu+40Un3PhHiI= github.com/lightninglabs/lndclient v0.11.0-3/go.mod h1:8/cTKNwgL87NX123gmlv3Xh6p1a7pvzu+40Un3PhHiI= -github.com/lightninglabs/loop v0.11.1-beta h1:FN2MJBn3MIFLxjdyOCqyVSSopFMHQDX5HtqNBdx4svE= -github.com/lightninglabs/loop v0.11.1-beta/go.mod h1:xZfGG0AbxwAoarGGLeEl8TEzGm/Wz81L8IN51iqWn3M= +github.com/lightninglabs/loop v0.11.2-beta h1:duhmf2G/yQbLnAc0vYvzxkm86gDTRswlvtstmO6MAZA= +github.com/lightninglabs/loop v0.11.2-beta/go.mod h1:xZfGG0AbxwAoarGGLeEl8TEzGm/Wz81L8IN51iqWn3M= github.com/lightninglabs/neutrino v0.11.0/go.mod h1:CuhF0iuzg9Sp2HO6ZgXgayviFTn1QHdSTJlMncK80wg= github.com/lightninglabs/neutrino v0.11.1-0.20200316235139-bffc52e8f200 h1:j4iZ1XlUAPQmW6oSzMcJGILYsRHNs+4O3Gk+2Ms5Dww= github.com/lightninglabs/neutrino v0.11.1-0.20200316235139-bffc52e8f200/go.mod h1:MlZmoKa7CJP3eR1s5yB7Rm5aSyadpKkxqAwLQmog7N0= From 5afccea886a928dc439e5af2aa8091fcde15fbf3 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 14 Dec 2020 13:36:34 +0100 Subject: [PATCH 3/3] scripts+docs: extract lnd and loop version from go.mod To make sure we always use the *.proto files for the correct versions of the daemons we include, we parse the versions of lnd and loop directly from the go.mod file. --- app/scripts/build-protos.js | 34 +++++++++++++++++++++++++++------- doc/compile.md | 2 -- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/scripts/build-protos.js b/app/scripts/build-protos.js index 38b76b303..99730334b 100644 --- a/app/scripts/build-protos.js +++ b/app/scripts/build-protos.js @@ -7,14 +7,34 @@ const { join, sep } = require('path'); const { platform } = require('os'); const appPath = join(__dirname, '..'); -/** Specify the versions of LND and Loop protos to download */ -const LND_VERSION = 'v0.11.1-beta'; -const LOOP_VERSION = 'v0.11.2-beta'; +/** + * Specify the pattern under which the project's version can be found in the + * root directory's go.mod file. + */ +const LND_VERSION_PATTERN = /^\tgithub\.com\/lightningnetwork\/lnd (v[\d.]+-beta)/ms; +const LOOP_VERSION_PATTERN = /^\tgithub\.com\/lightninglabs\/loop (v[\d.]+-beta)/ms; /** mapping of proto files to the github url to download each from */ -const protoSources = { - lnd: `lightningnetwork/lnd/${LND_VERSION}/lnrpc/rpc.proto`, - loop: `lightninglabs/loop/${LOOP_VERSION}/looprpc/client.proto`, +const protoSources = async () => { + console.log('Parsing go.mod for versions...'); + const goModPath = join(appPath, '..', 'go.mod'); + const goModSource = (await fs.readFile(goModPath)).toString(); + + const lndVersion = goModSource.match(LND_VERSION_PATTERN); + if (!lndVersion || lndVersion.length !== 2) { + throw new Error(`go.mod did not match pattern ${LND_VERSION_PATTERN}`); + } + + const loopVersion = goModSource.match(LOOP_VERSION_PATTERN); + if (!loopVersion || loopVersion.length !== 2) { + throw new Error(`go.mod did not match pattern ${LOOP_VERSION_PATTERN}`); + } + + console.log(`Found lnd version ${lndVersion[1]} and loop version ${loopVersion[1]}.`); + return { + lnd: `lightningnetwork/lnd/${lndVersion[1]}/lnrpc/rpc.proto`, + loop: `lightninglabs/loop/${loopVersion[1]}/looprpc/client.proto`, + }; }; /** list of proto files and patches to apply */ @@ -30,7 +50,7 @@ const filePatches = { */ const download = async () => { console.log('\nDownloading proto files...'); - for ([name, urlPath] of Object.entries(protoSources)) { + for ([name, urlPath] of Object.entries(await protoSources())) { const url = `https://raw.githubusercontent.com/${urlPath}`; const filePath = join(appPath, '..', 'proto', `${name}.proto`); console.log(`${url}`); diff --git a/doc/compile.md b/doc/compile.md index 101c9c046..45ad180ac 100644 --- a/doc/compile.md +++ b/doc/compile.md @@ -83,8 +83,6 @@ To compile the proto files into JS/TS code, follow the following steps: work properly. > Note: if you are running on a Mac, you only need to perform step 1 -1. Update the version of `lnd` and/or `loop` at the top of the [build-protos.js](../src/scripts/build-protos.js) - file. 1. Run the following command to download the proto files from each repo and compile the JS/TS code using the updated protos. ```shell script