You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -e VERSION=${VERSION} -v $(CUR_DIR)/build:/build deb_build
311
323
324
+
# special targets for building a deb package that compiles a new secretd but takes the enclaves from the latest package - used for upgrades when we don't want to replace the enclave
- Community Telegram Channel: [https://t.me/SCRTnetwork](https://t.me/SCRTnetwork)
147
152
- Community Secret Nodes Telegram: [https://t.me/secretnodes](https://t.me/secretnodes)
148
-
149
-
# License
150
-
151
-
SecretNetwork is free software: you can redistribute it and/or modify it under the terms of the [GNU Affero General Public License](LICENSE) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The GNU Affero General Public License is based on the GNU GPL, but has an additional term to allow users who interact with the licensed software over a network to receive the source for that program.
The build process for SN is a bit complex, and can include some unexpected parts for those that have not been baptised in the waters of TEEs.
2
+
3
+
### Build Targets Overview
4
+
1.**`release-image`**: Creates a full node Docker image.
5
+
2.**`build-deb`**: Generates a Debian (.deb) package
6
+
3.**`build-deb-mainnet`**: Similar to `build-deb`, but specifically for generating a Debian package for mainnet.
7
+
4.**`compile-secretd`**: Produces an image with the compiled enclave and `secretd`, a core component of the Secret Network - sometimes you don't need the whole image, just secretd.
8
+
9
+
### Build Process Description
10
+
11
+
#### 1. **Base Images and Environment Setup**
12
+
- Defines two base images:
13
+
*`SCRT_BASE_IMAGE_ENCLAVE` - Used as the base for building the enclave components, which are crucial for the secure execution of code in an SGX (Software Guard Extensions) environment.
14
+
*`SCRT_RELEASE_BASE_IMAGE` - Serves as the base for the final release image that contains all the necessary components to run a full node.
15
+
- Sets up the environment for subsequent stages, including installing dependencies like `clang-10`, setting `WORKDIR`, and other environment variables.
16
+
17
+
#### 2. **Compilation of Enclaves**
18
+
-**`prepare-compile-enclave` & `compile-enclave`**: Prepares the environment and compiles the enclaves.
19
+
-**`compile-tendermint-enclave`**: Compiles the Tendermint enclave, which is a part of the blockchain consensus mechanism.
20
+
21
+
#### 3. **Compilation of `secretd`**
22
+
- Sets up the Go environment and downloads specific Go packages.
23
+
- Copies source files and prepares the environment for building `secretd`.
- Creates the final node image with all necessary binaries and libraries.
28
+
- Installs additional dependencies like `jq`, `openssl`, and Node.js - these are used for the faucet and for debugging tools.
29
+
- Sets up environment variables and links libraries.
30
+
31
+
#### 5. **Mainnet Upgrade (`mainnet-release`)**
32
+
- Upgrades the `release-image` with specific binaries and libraries for the mainnet.
33
+
34
+
#### 6. **Debian Package Creation (`build-deb` and `build-deb-mainnet`)**
35
+
- Prepares an environment for building Debian packages.
36
+
- Copies necessary binaries and libraries from previous stages.
37
+
- Executes a script to build the Debian package.
38
+
39
+
#### 7. **Compilation of `check-hw` Tool (`compile-check-hw-tool`)**
40
+
- Compiles a hardware check tool, necessary for validating the hardware running the Secret Network nodes - this is unrelated to the release image or the network node directly.
- A specialized setup for a local version of the Secret Network, including a faucet server and a health check mechanism for local development.
44
+
45
+
### Summary
46
+
Each target in this Dockerfile serves a distinct purpose in the build and deployment pipeline of the Secret Network. From compiling essential components like `secretd` and the Tendermint enclave, to packaging these components for deployment in various environments (development, mainnet), the Dockerfile covers a comprehensive range of tasks necessary for maintaining and deploying a blockchain network. The use of multi-stage builds optimizes the process by reusing stages and minimizing the final image size.
0 commit comments