Skip to content

Latest commit

 

History

History
95 lines (73 loc) · 4.35 KB

compile.md

File metadata and controls

95 lines (73 loc) · 4.35 KB

Compile from Source Code

To compile from source code, you'll need to have some prerequisite developer tooling installed on your machine.

Dependency Description
golang LiT's backend web server is written in Go. The minimum version supported is Go v1.16.
nodejs 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.
yarn A popular package manager for NodeJS application dependencies.

Once you have the necessary prerequisites, LiT can be compiled by running the following commands:

$ git clone https://github.com/lightninglabs/lightning-terminal.git
$ cd lightning-terminal
$ make install

This will produce the litd executable and add it to your GOPATH. The CLI binaries for lncli, loop, pool, and frcli are not created by make install. You will need to download those binaries from the lnd, loop, pool, and faraday repos manually.

Building a docker image

There are two flavors of Dockerfiles available:

  • Dockerfile: Used for production builds. Checks out the source code from GitHub during build. The build argument --build-arg checkout=v0.x.x-alpha can be used to specify what git tag or commit to check out before building.
  • dev.Dockerfile Used for development or testing builds. Uses the local code when building and allows local changes to be tested more easily.

Building a development docker image

Follow the instructions of the previous chapter to install all necessary dependencies.

Then, instead of make install run the following commands:

$ docker build -f dev.Dockerfile -t my-lit-dev-image .

If successful, you can then run the docker image with:

$ docker run -p 8443:8443 --rm --name litd my-lit-dev-image \
  --httpslisten=0.0.0.0:8443 \
  ... (your configuration flags here)

See the execution section in the main README to find out what configuration flags to use.

Building a production docker image

To create a production build, you need to specify the git tag to create the image from. All local files will be ignored, everything is cloned and built from GitHub so you don't need to install any dependencies:

$ docker build -t lightninglabs/lightning-terminal --build-arg checkout=v0.3.2-alpha .

Compiling gRPC proto files

When the gRPC protocol buffer definition files for lnd or loop are updated with new releases, the generated JS/TS files should be updated as well. This should only be done when the versions of the daemons packaged in Terminal are updated.

To compile the proto files into JS/TS code, follow the following steps:

  1. Install docker if you do not already have it installed. Follow the instructions in this guide.

  2. Run the following command to download the proto files from each repo and compile the JS/TS code using the updated protos.

    $ make protos
  3. Fix any typing, linting, or unit test failures introduced by the update. Run the commands below to find and fix these errors in the app code.

    $ cd app
    $ yarn tsc
    $ yarn lint
    $ yarn test:ci
  4. Once all errors have been resolved, commit your changes and open a PR