Litentry parachain is a substrate-based, EVM-compatible blockchain that connects to the relaychain (e.g. Polkadot) which ensures shared security and interoperability. It serves as the backbone of Litentry protocol:
- LIT token native features: transfer, governance, staking ...
- Runtime logic such as enclave management, DID ...
- parentchain of identity-worker, which is a TEE-based sidechain to achieve identity aggregation and crediential issuance without promising users' privacy
- parentchain of bitacross-worker, which is a TEE-based offchain-worker to bridge assets across chains using native custodian and multisig
To build the binary:
make build-node
To build the litentry/litentry-parachain
docker image, based on cargo profile:
make build-docker-release
make build-docker-production
To build the litentry-parachain runtime wasm:
make build-runtime-litentry
The wasms should be located under target/release/wbuild/litentry-parachain-runtime/
Similarly, use make build-runtime-rococo
to build the rococo-parachain-runtime.
Litentry uses zombinet to spin up a local network with 2 relaychain nodes and 1 parachain node:
make launch-network-litentry
It will firstly look for the target/release/litentry-collator
binary - and if not found - copy the binary out from litentry/litentry-parachain:latest
image if you are on Linux.
If you see the screenshot below, you can tell the network is successfully spun up and you can access the polkadot-js block explorer locally:
When finished with the network, run
make clean-network
to stop the processes and tidy things up.
To speed up the development, the parachain can be launched without relaychain nodes. In this case, parachain will author blocks by itself with instant block finalisation, please refer to this PR.
make launch-standalone
cd /tee-worker
source /opt/intel/sgxsdk/environment
SGX_MODE=SW WORKER_DEV=1 make
Before executing launch.py
, the following Python libraries need to be installed
pip install python-dotenv pycurl docker toml
TEE-workers need a running parachain to become operational. We have an all-in-one script local-setup/launch.py
to launch both parachain and workers:
./local-setup/launch.py -p standalone
./local-setup/launch.py -p network
./local-setup/launch.py -p remote
They stand for different parachain launching options:
- standalone parachain
- parachain network with relaychains
- parachain is remotely launched (elsewhere), so don't launch parachain in
launch.py
respectively.
If you see the screenshot below, you can tell the worker is running:
Refer to tee-worker ts-tests
In the worker launch terminal, Ctrl + C
should interrupt and clean everything up automatically.
- Change the RUST_LOG level:
litentry-parachain/local-setup/py/worker.py
- Check existing ts-tests:
litentry-parachain/tee-worker/ts-tests/package.json
- JSON config parameters:
litentry-parachain/tee-worker/service/src/cli.yml