Skip to content

Commit 01fa8e1

Browse files
committed
docs: update compile doc with instructions to compile proto files
1 parent decc501 commit 01fa8e1

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

doc/compile.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ installed on your machine.
66
| Dependency | Description |
77
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
88
| [golang](https://golang.org/doc/install) | LiT's backend web server is written in Go. The minimum version supported is Go v1.13. |
9-
| [protoc 3.4.0](https://github.com/lightningnetwork/lnd/tree/master/lnrpc#generate-protobuf-definitions) | Required to compile LND & Loop gRPC proto files at build time. Must be installed according to step 1 of the linked guide. |
109
| [nodejs](https://nodejs.org/en/download/) | LiT's frontend is written in TypeScript and built on top of the React JS web framework. To bundle the assets into Javascript & CSS compatible with web browsers, NodeJS is required. |
1110
| [yarn](https://classic.yarnpkg.com/en/docs/install) | A popular package manager for NodeJS application dependencies. |
1211

@@ -67,3 +66,37 @@ GitHub so you don't need to install any dependencies:
6766
```shell script
6867
$ docker build -t lightninglabs/lightning-terminal --build-arg checkout=v0.3.2-alpha .
6968
```
69+
70+
### Compiling gRPC proto files
71+
72+
When the gRPC protocol buffer definition files for `lnd` or `loop` are
73+
updated with new releases, the [generated](../src/types/generated/) JS/TS files should be
74+
updated as well. This should only be done when the versions of the daemons packaged in
75+
Terminal are updated.
76+
77+
To compile the proto files into JS/TS code, follow the following steps:
78+
79+
1. Install `protoc` **v3.4.0** if you do not already have it installed. Follow the
80+
instructions in
81+
[this guide](https://github.com/lightningnetwork/lnd/tree/master/lnrpc#generate-protobuf-definitions).
82+
Be sure to install the specific **v3.4.0** version of `protoc`. Newer versions will not
83+
work properly.
84+
85+
> Note: if you are running on a Mac, you only need to perform step 1
86+
1. Update the version of `lnd` and/or `loop` at the top of the [build-protos.js](../src/scripts/build-protos.js)
87+
file.
88+
1. Run the following command to download the proto files from each repo and compile the
89+
JS/TS code using the updated protos.
90+
```shell script
91+
$ cd app
92+
$ yarn protos
93+
```
94+
1. Fix any typing, linting, or unit test failures introduced by the update. Run the
95+
commands below to find and fix these errors in the app code.
96+
```shell script
97+
$ cd app
98+
$ yarn tsc
99+
$ yarn lint
100+
$ yarn test:ci
101+
```
102+
1. Once all errors have been resolved, commit your changes and open a PR

0 commit comments

Comments
 (0)