Skip to content

Commit f66efd5

Browse files
[WC]: Update Building documentation (#360)
1 parent e81614e commit f66efd5

File tree

2 files changed

+43
-25
lines changed

2 files changed

+43
-25
lines changed

wallet-core/building.md

+38-25
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,20 @@ Wallet Core can be build inside a Docker image, or natively.
2424

2525
## Prerequisites
2626

27-
Here is the list of required prerequisites.
27+
Use one top-level script to install all required dependencies and prepare WalletCore for building:
28+
29+
```shell
30+
./bootstrap.sh all
31+
```
32+
33+
Please note that the script configures the environment for all target platforms: Native, Android, iOS (on MacOS), and WASM.
34+
If you intend to use WalletCore on specific platforms only, you can specify those platforms in the arguments:
35+
36+
```shell
37+
./bootstrap.sh android ios
38+
```
39+
40+
Otherwise, consider installing the required prerequisites manually below.
2841

2942
### Prerequisites on macOS
3043

@@ -37,6 +50,7 @@ Here is the list of required prerequisites.
3750
- [Android Studio](https://developer.android.com/studio/index.html)
3851
- [Android NDK](https://developer.android.com/ndk/guides/)
3952
- Rust: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
53+
- [emscripten (for WASM)](https://emscripten.org/docs/introducing_emscripten/about_emscripten.html)
4054

4155
### Prerequisites on Linux
4256

@@ -49,6 +63,7 @@ Ubuntu as a example:
4963
- CMake `sudo apt-get install cmake` or (from https://github.com/Kitware/CMake/releases)
5064
- [Android Studio](https://developer.android.com/studio/index.html)
5165
- Rust: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
66+
- [emscripten (for WASM)](https://emscripten.org/docs/introducing_emscripten/about_emscripten.html)
5267

5368
### Managed Prerequisites
5469

@@ -61,57 +76,55 @@ Additionally, the following prerequisites are also needed, but they are managed
6176

6277
## Full Build
6378

64-
The full build can be triggered with one top-level script:
79+
WalletCore is ready to be built after installing all prerequisites.
80+
Building for each platform is different.
6581

66-
```shell
67-
./bootstrap.sh
68-
```
82+
### Native building and testing
6983

70-
Or, broken up in smaller steps:
84+
To build and run tests on the native platform (Linux, MacOS), run the following command:
7185

7286
```shell
73-
## Linux
74-
./tools/install-sys-dependencies-linux
75-
76-
## MacOS
77-
./tools/install-sys-dependencies-mac
78-
79-
./tools/install-dependencies
80-
./tools/install-rust-dependencies
87+
./tools/build-and-test
8188
```
8289

83-
This script downloads and compiles some prerequisites.
90+
Or, broken up in smaller steps:
91+
92+
1. This script generates source files, coin- and protobuf files.
93+
Needs to be re-run whenever `registry.json`, or protobuf files, or `./include` interface, or Rust codebase are changed.
8494

8595
```shell
8696
./tools/generate-files
8797
```
8898

89-
This script generates source files, coin- and protobuf files. Needs to be re-run whenever `registry.json` or protobuf files are changed.
99+
2. Standard CMake and make commands for building the library. The `cmake` command needs to be re-run whenever a new C++ source file is added.
90100

91101
```shell
92102
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
93-
make -Cbuild
94103
```
95104

96-
Standard CMake and make commands for building the library. The `cmake` command needs to be re-run whenever a new source file is added.
97-
98-
After build, _unit tests_ can be executed:
105+
3. Build TrezorCrypto and WalletCore C++ tests.
99106

100107
```shell
101-
./build/tests/tests tests --gtest_filter=*
108+
make -Cbuild -j12 tests TrezorCryptoTests
102109
```
103110

104-
The generate-cmake-make-test steps are also available together in one script:
111+
4. Run TrezorCrypto and WalletCore C++ tests.
105112

106113
```shell
107-
./tools/build-and-test
114+
./build/tests/tests tests --gtest_filter=*
108115
```
109116

110117
If you'd rather use and IDE for building and debugging you can specify the `-G` option to cmake. For instance to use Xcode call `cmake -Bxcode -GXcode -DCMAKE_BUILD_TYPE=Debug` and use the generated project in the xcode folder.
111118

112119
### Wasm building
113120

114-
Install [Emscripten SDK](https://emscripten.org/docs/introducing_emscripten/about_emscripten.html) (emsdk):
121+
Configure WASM environment with either running a bootstrap:
122+
123+
```shell
124+
./bootstrap.sh wasm
125+
```
126+
127+
Or installing [Emscripten SDK](https://emscripten.org/docs/introducing_emscripten/about_emscripten.html) (emsdk) manually:
115128

116129
```shell
117130
`tools/install-wasm-dependencies`
@@ -123,7 +136,7 @@ Activate `emsdk`:
123136
`source emsdk/emsdk_env.sh`
124137
```
125138

126-
Build Wasm:
139+
After WASM environment is configured, build WalletCore for WASM:
127140

128141
```shell
129142
tools/wasm-build

wallet-core/wallet-core.md

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ If you want to use wallet core in your project follow these instructions:
2929
- [Frontier](https://frontier.xyz/)
3030
- [Belco](https://www.belcobtm.com/)
3131
- [Pumapay](https://pumapay.io/)
32+
- [Tokenary](https://tokenary.io/)
33+
- [MemesWallet](https://planetmemes.com/)
34+
- [xPortal](https://xportal.com/)
35+
- [Slingshot](https://slingshot.finance/)
36+
- [ECOIN Wallet](https://play.google.com/store/apps/details?id=org.ecoinwallet&pcampaignid=web_share)
3237

3338
## Contributing
3439

0 commit comments

Comments
 (0)