Skip to content

Commit

Permalink
Merge pull request #161 from lightninglabs/lit-0.3.3
Browse files Browse the repository at this point in the history
Prepare for LiT v0.3.3-alpha
  • Loading branch information
guggero authored Dec 14, 2020
2 parents 3d93358 + 5afccea commit 22c72ac
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down
34 changes: 27 additions & 7 deletions app/scripts/build-protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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}`);
Expand Down
2 changes: 0 additions & 2 deletions doc/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 22c72ac

Please sign in to comment.