2017-03-17 19:07:29 +01:00
# Building Eclair
## Requirements
2019-07-31 13:35:26 +00:00
2025-01-07 15:56:32 +01:00
- [OpenJDK 21 ](https://adoptium.net/temurin/releases/?package=jdk&version=21 ).
2017-03-17 19:07:29 +01:00
## Build
2019-07-31 13:35:26 +00:00
2020-05-13 15:19:48 +02:00
Eclair is packaged as a compressed archive with a launcher script. The archives are built deterministically
2020-03-27 10:44:16 +01:00
so it's possible to reproduce the build and verify its equality byte-by-byte. To build the exact same artifacts
2025-01-27 13:55:27 +01:00
that we release, you must use the build environment (OS, JDK...) that we specify in our release notes.
2020-01-30 15:27:02 +01:00
2019-07-31 13:35:26 +00:00
To build the project and run the tests, simply run:
2017-03-17 19:07:29 +01:00
```shell
2025-01-07 15:56:32 +01:00
./mvnw package
2017-03-17 19:07:29 +01:00
```
2018-09-03 18:03:40 +02:00
2020-05-13 15:19:48 +02:00
Notes:
2021-01-06 18:38:40 +01:00
2020-05-13 15:19:48 +02:00
- This command will build all modules (core, node, gui).
2025-01-07 15:56:32 +01:00
- If the build fails, you may need to clean previously built artifacts with the `./mvnw clean` command.
2020-05-13 15:19:48 +02:00
- Archives can be found in the `target` folder for each module.
2020-03-27 10:44:16 +01:00
2020-05-13 15:19:48 +02:00
### Skip tests
2018-09-03 18:03:40 +02:00
2020-05-13 15:19:48 +02:00
Running tests takes time. If you want to skip them, use `-DskipTests` :
2019-07-31 13:35:26 +00:00
```shell
2025-01-07 15:56:32 +01:00
./mvnw package -DskipTests
2019-07-31 13:35:26 +00:00
```
2020-05-13 15:19:48 +02:00
### Run tests
To only run the tests, run:
2019-07-31 13:35:26 +00:00
```shell
2025-01-07 15:56:32 +01:00
./mvnw test
2019-07-31 13:35:26 +00:00
```
To run tests for a specific class, run:
2017-12-01 13:56:01 +01:00
```shell
2025-01-07 15:56:32 +01:00
./mvnw test -Dsuites=*< TestClassName >
2017-03-17 19:07:29 +01:00
```
2019-02-21 15:11:44 +01:00
2022-12-30 11:14:56 +01:00
To run tests using a specific number of threads, run:
```shell
2025-01-07 15:56:32 +01:00
./mvnw -T < thread_count > test
2022-12-30 11:14:56 +01:00
```
2021-12-15 17:13:57 +01:00
To run tests with a specific version of `bitcoind` , run:
```shell
2025-01-07 15:56:32 +01:00
BITCOIND_DIR=< absolute / path / to / directory > ./mvnw test
2021-12-15 17:13:57 +01:00
```
2020-05-13 15:19:48 +02:00
### Build specific module
To only build the `eclair-node` module, run:
```shell
2025-01-07 15:56:32 +01:00
./mvnw package -pl eclair-node -am -Dmaven.test.skip=true
2020-05-13 15:19:48 +02:00
```
To install `eclair-core` into your local maven repository and use it in another project, run:
```shell
2025-01-07 15:56:32 +01:00
./mvnw clean install -pl eclair-core -am -Dmaven.test.skip=true
2020-05-13 15:19:48 +02:00
```
2019-07-31 13:35:26 +00:00
## Build the API documentation
2019-03-26 18:10:09 +01:00
2019-07-31 13:35:26 +00:00
### Slate
2019-03-26 18:10:09 +01:00
The API doc is generated via slate and hosted on github pages. To make a change and update the doc follow the steps:
2019-07-31 13:35:26 +00:00
1. `git checkout slate-doc`
2. Install your local dependencies for slate, more info [here ](https://github.com/lord/slate#getting-started-with-slate )
3. Edit `source/index.html.md` and save your changes.
4. Commit all the changes to git, before deploying the repo should be clean.
5. Push your commit to remote.
6. Run `./deploy.sh`
7. Wait a few minutes and the doc should be updated at [https://acinq.github.io/eclair ](https://acinq.github.io/eclair )
2025-01-27 13:55:27 +01:00
## Updating Eclair dependencies checksums
2025-02-05 19:30:29 +01:00
Eclair dependencies (including maven plugins and their dependencies) are verified against a list of trusted checksums (located in `.mvn/checksums/checksums-central.sha256` ).
2025-01-27 13:55:27 +01:00
Please note that dependencies are verified only if they are actually used in the build phase that is running, so you may be able to modify the checksum of a dependency
and still run a successful build phase that does not use them (for example you can modify the checksum of a `maven-deploy-plugin` dependency and still run `./mvnw test` successfully).
To make local development and testing easier, SNAPSHOT dependencies are not verified.
2025-02-05 19:30:29 +01:00
To re-create the trusted checksums file, run:
```shell
$ rm ~/.m2/wrapper ~/.sbt -rf
$ ./mvnw clean install scoverage:report -DskipTests -Daether.artifactResolver.postProcessor.trustedChecksums.record
```