2018-03-30 10:16:14 +02:00
|
|
|
Makefile
|
|
|
|
========
|
|
|
|
|
|
|
|
To build, verify, and install `lnd` from source, use the following
|
|
|
|
commands:
|
|
|
|
```
|
|
|
|
make
|
|
|
|
make check
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
2019-11-06 09:47:48 +01:00
|
|
|
The command `make check` requires `bitcoind` (almost any version should do) to
|
|
|
|
be available in the system's `$PATH` variable. Otherwise some of the tests will
|
|
|
|
fail.
|
|
|
|
|
2018-03-30 10:16:14 +02:00
|
|
|
Developers
|
|
|
|
==========
|
|
|
|
|
|
|
|
This document specifies all commands available from `lnd`'s `Makefile`.
|
|
|
|
The commands included handle:
|
|
|
|
- Installation of all go-related dependencies.
|
|
|
|
- Compilation and installation of `lnd` and `lncli`.
|
|
|
|
- Compilation and installation of `btcd` and `btcctl`.
|
|
|
|
- Running unit and integration suites.
|
|
|
|
- Testing, debugging, and flake hunting.
|
|
|
|
- Formatting and linting.
|
|
|
|
|
|
|
|
Commands
|
|
|
|
========
|
|
|
|
|
|
|
|
- [`all`](#scratch)
|
|
|
|
- [`btcd`](#btcd)
|
|
|
|
- [`build`](#build)
|
|
|
|
- [`check`](#check)
|
|
|
|
- [`clean`](#clean)
|
|
|
|
- [`default`](#default)
|
|
|
|
- [`dep`](#dep)
|
|
|
|
- [`flake-unit`](#flake-unit)
|
|
|
|
- [`flakehunter`](#flakehunter)
|
|
|
|
- [`fmt`](#fmt)
|
|
|
|
- [`install`](#install)
|
|
|
|
- [`itest`](#itest)
|
|
|
|
- [`lint`](#lint)
|
|
|
|
- [`list`](#list)
|
|
|
|
- [`rpc`](#rpc)
|
|
|
|
- [`scratch`](#scratch)
|
|
|
|
- [`travis`](#travis)
|
|
|
|
- [`unit`](#unit)
|
|
|
|
- [`unit-cover`](#unit-cover)
|
|
|
|
- [`unit-race`](#unit-race)
|
|
|
|
|
|
|
|
`all`
|
|
|
|
-----
|
|
|
|
Compiles, tests, and installs `lnd` and `lncli`. Equivalent to
|
|
|
|
[`scratch`](#scratch) [`check`](#check) [`install`](#install).
|
|
|
|
|
|
|
|
`btcd`
|
|
|
|
------
|
2019-03-24 13:28:51 +01:00
|
|
|
Ensures that the [`github.com/btcsuite/btcd`][btcd] repository is checked out
|
2018-03-30 10:16:14 +02:00
|
|
|
locally. Lastly, installs the version of
|
2018-06-05 03:34:16 +02:00
|
|
|
[`github.com/btcsuite/btcd`][btcd] specified in `Gopkg.toml`
|
2018-03-30 10:16:14 +02:00
|
|
|
|
|
|
|
`build`
|
|
|
|
-------
|
|
|
|
Compiles the current source and vendor trees, creating `./lnd` and
|
|
|
|
`./lncli`.
|
|
|
|
|
|
|
|
`check`
|
|
|
|
-------
|
2018-06-05 03:34:16 +02:00
|
|
|
Installs the version of [`github.com/btcsuite/btcd`][btcd] specified
|
2018-03-30 10:16:14 +02:00
|
|
|
in `Gopkg.toml`, then runs the unit tests followed by the integration
|
|
|
|
tests.
|
|
|
|
|
|
|
|
Related: [`unit`](#unit) [`itest`](#itest)
|
|
|
|
|
|
|
|
`clean`
|
|
|
|
-------
|
|
|
|
Removes compiled versions of both `./lnd` and `./lncli`, and removes the
|
|
|
|
`vendor` tree.
|
|
|
|
|
|
|
|
`default`
|
|
|
|
---------
|
|
|
|
Alias for [`scratch`](#scratch).
|
|
|
|
|
|
|
|
`flake-unit`
|
|
|
|
------------
|
|
|
|
Runs the unit test endlessly until a failure is detected.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
- `pkg=<package>`
|
|
|
|
- `case=<testcase>`
|
|
|
|
- `timeout=<timeout>`
|
|
|
|
|
|
|
|
Related: [`unit`](#unit)
|
|
|
|
|
|
|
|
`flakehunter`
|
|
|
|
-------------
|
|
|
|
Runs the itegration test suite endlessly until a failure is detected.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
- `icase=<itestcase>`
|
|
|
|
- `timeout=<timeout>`
|
|
|
|
|
|
|
|
Related: [`itest`](#itest)
|
|
|
|
|
|
|
|
`fmt`
|
|
|
|
-----
|
|
|
|
Runs `go fmt` on the entire project.
|
|
|
|
|
|
|
|
`install`
|
|
|
|
---------
|
|
|
|
Copies the compiled `lnd` and `lncli` binaries into `$GOPATH/bin`.
|
|
|
|
|
|
|
|
`itest`
|
|
|
|
-------
|
2018-06-05 03:34:16 +02:00
|
|
|
Installs the version of [`github.com/btcsuite/btcd`][btcd] specified in
|
2018-03-30 10:16:14 +02:00
|
|
|
`Gopkg.toml`, builds the `./lnd` and `./lncli` binaries, then runs the
|
|
|
|
integration test suite.
|
|
|
|
|
|
|
|
Arguments:
|
2019-07-11 06:30:55 +02:00
|
|
|
- `icase=<itestcase>` (the snake_case version of the testcase name field in the testCases slice (i.e. sweep_coins), not the test func name)
|
2018-03-30 10:16:14 +02:00
|
|
|
- `timeout=<timeout>`
|
|
|
|
|
|
|
|
`lint`
|
|
|
|
------
|
|
|
|
Ensures that [`gopkg.in/alecthomas/gometalinter.v1`][gometalinter] is
|
|
|
|
installed, then lints the project.
|
|
|
|
|
|
|
|
`list`
|
|
|
|
------
|
|
|
|
Lists all known make targets.
|
|
|
|
|
|
|
|
`rpc`
|
|
|
|
-----
|
|
|
|
Compiles the `lnrpc` proto files.
|
|
|
|
|
|
|
|
`scratch`
|
|
|
|
---------
|
|
|
|
Compiles all dependencies and builds the `./lnd` and `./lncli` binaries.
|
2019-03-24 13:28:51 +01:00
|
|
|
Equivalent to [`lint`](#lint) [`btcd`](#btcd)
|
2018-03-30 10:16:14 +02:00
|
|
|
[`unit-race`](#unit-race).
|
|
|
|
|
|
|
|
`unit`
|
|
|
|
------
|
|
|
|
Runs the unit test suite. By default, this will run all known unit tests.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
- `pkg=<package>`
|
|
|
|
- `case=<testcase>`
|
|
|
|
- `timeout=<timeout>`
|
2018-09-27 18:53:34 +02:00
|
|
|
- `log="stdlog[ <log-level>]"` prints logs to stdout
|
|
|
|
- `<log-level>` can be `info` (default), `debug`, `trace`, `warn`, `error`, `critical`, or `off`
|
2018-03-30 10:16:14 +02:00
|
|
|
|
|
|
|
`unit-cover`
|
|
|
|
------------
|
|
|
|
Runs the unit test suite with test coverage, compiling the statisitics in
|
|
|
|
`profile.cov`.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
- `pkg=<package>`
|
|
|
|
- `case=<testcase>`
|
|
|
|
- `timeout=<timeout>`
|
2018-09-27 18:53:34 +02:00
|
|
|
- `log="stdlog[ <log-level>]"` prints logs to stdout
|
|
|
|
- `<log-level>` can be `info` (default), `debug`, `trace`, `warn`, `error`, `critical`, or `off`
|
2018-03-30 10:16:14 +02:00
|
|
|
|
|
|
|
Related: [`unit`](#unit)
|
|
|
|
|
|
|
|
`unit-race`
|
|
|
|
-----------
|
|
|
|
Runs the unit test suite with go's race detector.
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
- `pkg=<package>`
|
|
|
|
- `case=<testcase>`
|
|
|
|
- `timeout=<timeout>`
|
2018-09-27 18:53:34 +02:00
|
|
|
- `log="stdlog[ <log-level>]"` prints logs to stdout
|
|
|
|
- `<log-level>` can be `info` (default), `debug`, `trace`, `warn`, `error`, `critical`, or `off`
|
2018-03-30 10:16:14 +02:00
|
|
|
|
|
|
|
Related: [`unit`](#unit)
|
|
|
|
|
2018-06-05 03:34:16 +02:00
|
|
|
[btcd]: https://github.com/btcsuite/btcd (github.com/btcsuite/btcd")
|
2018-03-30 10:16:14 +02:00
|
|
|
[gometalinter]: https://gopkg.in/alecthomas/gometalinter.v1 (gopkg.in/alecthomas/gometalinter.v1)
|
|
|
|
[goveralls]: https://github.com/mattn/goveralls (github.com/mattn/goveralls)
|