2022-12-15 07:38:41 +00:00
|
|
|
# Java binding
|
2022-11-23 16:32:25 +00:00
|
|
|
|
2022-12-15 07:38:41 +00:00
|
|
|
## Build shared library
|
|
|
|
|
|
|
|
### Prerequisites
|
2022-11-23 18:37:46 +00:00
|
|
|
|
2022-12-06 12:58:56 +00:00
|
|
|
* Follow the instructions in the [README.md](../../README.md) to build blst.
|
|
|
|
* `JAVA_HOME` environment variable is set to a JDK with an `include` folder containing a `jni.h`
|
|
|
|
file.
|
2022-11-23 18:37:46 +00:00
|
|
|
|
2022-12-15 07:38:41 +00:00
|
|
|
### Build
|
2022-12-06 12:58:56 +00:00
|
|
|
|
2022-11-23 16:32:25 +00:00
|
|
|
```bash
|
2022-11-24 19:46:47 +00:00
|
|
|
make build
|
2022-11-23 16:32:25 +00:00
|
|
|
```
|
|
|
|
|
2022-12-15 07:38:41 +00:00
|
|
|
This will install the shared library in `src/main/resources/ethereum/ckzg4844/lib` with a folder
|
|
|
|
structure
|
2022-12-06 12:58:56 +00:00
|
|
|
and name according to the preset selected (mainnet or minimal) and your OS.
|
|
|
|
|
|
|
|
All variables which could be passed to the `make` command and the defaults can be found in
|
2022-12-06 15:03:58 +00:00
|
|
|
the [Makefile](./Makefile).
|
2022-11-23 16:32:25 +00:00
|
|
|
|
2022-11-24 17:16:15 +00:00
|
|
|
## Test
|
2022-12-06 12:58:56 +00:00
|
|
|
|
2022-11-23 16:32:25 +00:00
|
|
|
```bash
|
2022-11-24 17:16:15 +00:00
|
|
|
make test
|
2022-11-23 16:32:25 +00:00
|
|
|
```
|
2022-12-06 12:58:56 +00:00
|
|
|
|
|
|
|
## Benchmark
|
|
|
|
|
|
|
|
JMH is used for benchmarking.
|
2022-12-15 07:38:41 +00:00
|
|
|
See [CKZG4844JNIBenchmark.java](src/jmh/java/ethereum/ckzg4844/CKZG4844JNIBenchmark.java) for more
|
|
|
|
information.
|
2022-12-06 12:58:56 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
make benchmark
|
|
|
|
```
|
2022-12-15 07:38:41 +00:00
|
|
|
|
|
|
|
## Library
|
|
|
|
|
|
|
|
The library which uses this binding and publishes a package to a public maven repo
|
|
|
|
is [jc-kzg-4844](https://github.com/ConsenSys/jc-kzg-4844).
|