Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 2.96 KB

File metadata and controls

85 lines (57 loc) · 2.96 KB

Descritpion

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.

Requirements

  1. Skaled should be compiled, and have the ./build directory correctly generated. Please refer to README.md
    • You may compile skaled either as FAIR or non-FAIR
  2. Have python3.10 - this is needed for running the sgx.py script for generating the keys.

How to run

1. Non-FAIR skaled

  1. Compile skaled (from project's root):

    cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
    cmake --build build -- -j$(nproc)
  2. (Optional) If you need to edit any config from skaled config file, edit the scripts/run_with_sgx/configs/non-fair.json

  3. 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.sh
    

    This will spin up a sgx wallet listening on 1029 - using HTTP.

    3.2 - Custom container: If custom SGX is running with HTTPS (no -n flag, running on port 1026), 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 -n flag, running on 1029), then you don't need to do any additional steps.

  4. 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.


2. FAIR skaled

  1. Compile skaled with FAIR flag:

    cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DFAIR=1
    cmake --build build -- -j$(nproc)
  2. (Optional) If you need to edit any config from skaled config file, edit the scripts/run_with_sgx/configs/fair.json

  3. Launch SGXWallet - see non-fair build above (1.3)

  4. Go to scritps/run_with_sgx and 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.sh

To clean all temporary data generated by the script.