This document explains how to get skaled running with 1 node, using some default config file, and 1 SGX wallet.
It uses the scripts under scripts/run_with_sgx.
The script generates new ECDSA and BLS keys, and replaces them in the config.json file passed (if any), generating a new updated config.json, which is automatically passed to skaled to run.
You can also see the generated keys as well as the updated config.json inside scripts/run_with_sgx/tmp folder.
- Skaled should be compiled, and have the
./builddirectory correctly generated. Please refer to README.md- You may compile skaled either as
FAIRornon-FAIR
- You may compile skaled either as
- Have
python3.10- this is needed for running thesgx.pyscript for generating the keys.
-
Compile skaled (from project's root):
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug cmake --build build -- -j$(nproc) -
(Optional) If you need to edit any config from skaled config file, edit the
scripts/run_with_sgx/configs/non-fair.json -
Launch SGXWallet:
Got to
scripts/run_with_sgx.You can either spin up a custom SGX or use a default container:
3.1 - Default container: To run with some default container, simply run:
sudo bash utils/spin_default_sgx.shThis will spin up a sgx wallet listening on 1029 - using HTTP.
3.2 - Custom container: If custom SGX is running with HTTPS (no
-nflag, running on port1026), then run the script:bash utils/copy_sgx_cert.sh <sgx-wallet-project-path>
This will copy the certificate & key so that skaled can use it.
Else, if the sgx is running on HTTP (with
-nflag, running on1029), then you don't need to do any additional steps. -
Run the script:
bash ./run.sh [custom-config-file] [-HTTPS]
You may pass some other config file path as an argument to the script. If not, it will use the default one at
scripts/run_with_sgx/configs/non-fair.json.Also, if you used a custom that uses HTTPS, pass the
-HTTPS. Else, if you used defualt container, do not pas that flag.
-
Compile skaled with
FAIRflag:cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DFAIR=1 cmake --build build -- -j$(nproc) -
(Optional) If you need to edit any config from skaled config file, edit the
scripts/run_with_sgx/configs/fair.json -
Launch SGXWallet - see non-fair build above (1.3)
-
Go to
scritps/run_with_sgxand run the script:bash ./run.sh [custom-config-file] -FAIR [-HTTPS]
You may pass some other config file path as an argument to the script. If not, it will use the default one at
scripts/run_with_sgx/configs/non-fair.json.
Once finished (Eg. before commiting), you should run:
bash ./clean.shTo clean all temporary data generated by the script.