blockchain/README.md

121 lines
6.8 KiB
Markdown
Raw Permalink Normal View History

# Lethean Network—Ethics, Encoded.
2019-11-02 00:18:49 +01:00
> We are building upto a mainnet launch in 2026, documentation written as if mainnet is live.
A buildkit for deploying confidential information networks and commerce systems with immutable auditability.
Free for commercial, private, and patent use, self-host or join the community-run network that guarantees participant sovereignty by design.
[![Discord](https://img.shields.io/discord/379876792003067906?label=discord&logo=discord)](https://discord.gg/pfgT2Kz)
Web2 Website: https://lt.hn/
2023-12-05 23:29:15 +03:00
Web3 Network Gateway [HNS](https://handshake.org): [https://lthn](https://www.namebase.io/domains/lthn)
<br/>_(our chain aliases will come with a working Web2(`*.lt.hn`)+Web3(`*.lthn`) domain name)_
2023-12-05 23:29:15 +03:00
### Dependencies
| component / version | minimum <br>(not recommended but may work) | recommended | most recent of what we have ever tested |
|-----------------------------------------------------------------------------|--------------------------------------------|----------------|-----------------------------------------|
| gcc (Linux) | 8.4.0 | 9.4.0 | 12.3.0 |
| llvm/clang (Linux) | UNKNOWN | 7.0.1 | 8.0.0 |
| [MSVC](https://visualstudio.microsoft.com/downloads/) (Windows) | 2017 (15.9.30) | 2022 (17.11.5) | 2022 (17.12.3) |
| [XCode](https://developer.apple.com/downloads/) (macOS) | 12.3 | 14.3 | 15.2 |
| [CMake](https://cmake.org/download/) | 3.26.3 | 3.26.3 | 3.31.6 |
## Cloning
Be sure to clone the repository properly, with `--recursive` flag, or you'll get angry:<br/>
`git clone --recursive https://github.com/letheanVPN/blockchain.git`
# Building
The project uses a `Makefile` that provides a simple and powerful interface for building.
It automatically handles dependency installation with Conan and compilation with CMake.
You need CMake and Make installed on your system, other than that you don't need to worry about Python, Conan, Boost, OpenSSL, or any other dependencies.
The final packages are created as they are due to a historical distribution method used in china: USB Stick, CD, DVD, etc.
We use CPack, so our packages are self-contained, have searchable HTML documentation, and are ready to be installed on any system.
To skip the packing step, use `make build` as defined in the section below for Advanced Build Customization
2023-12-05 23:29:15 +03:00
## Simple Workflow Builds (Recommended)
2023-12-05 23:29:15 +03:00
For most use cases, these two commands are all you need. They handle the entire build process from start to finish.
2020-02-19 17:55:00 +03:00
* **Build for Mainnet:**
```shell
make mainnet
```
2020-02-19 17:55:00 +03:00
* **Build for Testnet:**
```shell
make testnet
```
2023-12-05 23:29:15 +03:00
## Creating Release Packages
2020-02-19 17:55:00 +03:00
To create distributable packages (e.g., `.zip`, `.msi`, `.pkg`, `.deb`), run the `release` target. This will build the project, build the documentation, and then package everything.
```shell
make release TESTNET=1
```
The final packages will be located in the `build/packages/` directory
2018-12-27 18:50:45 +03:00
## Advanced Build Customization (Makefile Variables)
2021-06-03 16:06:49 +03:00
For advanced use cases, you can override variables in the `Makefile` to customize the build process.
2018-12-27 18:50:45 +03:00
* **Build a `testnet` version:**
```shell
make build TESTNET=1
```
* **Build a statically-linked version:**
```shell
make build STATIC=1
```
* **Build a Debug build with 8 compile threads:**
```shell
make build BUILD_TYPE=Debug CPU_CORES=8
```
* **Use custom CMakePresets:**
```shell
make build PRESET_CONFIGURE=my-config-preset PRESET_BUILD=my-build-preset
```
2021-06-03 16:21:00 +03:00
| Variable | Description | Default Value |
|--------------------|------------------------------------------------------------------------|-------------------------|
| `BUILD_TYPE` | Sets the build configuration (e.g., `Release`, `Debug`). | `Release` |
| `TESTNET` | Set to `1` to build for the test network. | `0` |
| `STATIC` | Set to `1` to link libraries statically. | `0` |
| `CPU_CORES` | Number of CPU cores to use for parallel compilation. | Auto-detected |
| `BUILD_VERSION` | The version string to embed in the binaries. | `6.0.1` |
| `BUILD_FOLDER` | The output directory for the build. | `build/release` |
| `PRESET_CONFIGURE` | The CMake preset to use for the `configure` step. | `conan-release` |
| `PRESET_BUILD` | The CMake preset to use for the `build` step. | `conan-release` |
| `CONAN_CACHE` | The path for the local Conan cache, where the dependencies are stored. | `./build/sdk` |
| `CONAN_EXECUTABLE` | The path to the usable Conan executable. | `./build/bin/conan` |
| `CONAN_URL` | The URL for the Conan remote repository. | `artifacts.host.uk.com` |
| `CONAN_USER` | The username for the Conan remote. | `public` |
| `CONAN_PASSWORD` | The password for the Conan remote. | |
2021-06-03 16:06:49 +03:00
## Cleaning the Build Directory
2018-12-27 18:50:45 +03:00
ALWAYS USE `make clean` to clean the build directory, manually deleting the `build/release`, `build/SOME_FOLDER` will cause you issues.
2018-12-27 18:50:45 +03:00
Our `make clean` triggers a cmake script that completely resets the build directory &amp; dynamically added CMakePresets to its cached warm-up state,
the selective clean script can be edited here: `cmake/CleanBuild.cmake` or directly run from the repo root `cmake -P cmake/CleanBuild.cmake`
You can NUKE the build directory with `make clean-build` which is `rm -rf build`.
2024-10-21 18:56:52 +04:00
If you do manually delete build folders and get CMake errors (if you have compiled anything previously, you will),
the ConanPresets.json file has entries in the `include` property, delete them all and try again.
2024-10-21 18:56:52 +04:00
This happens because CMakePresets.json includes ConanPresets.json, that has the list of toolchains to use that gets populated during the CMake config step,
when you manually delete a folder, the toolchain is now a broken path, and CMake throws a fatal error.
2024-10-21 18:56:52 +04:00