How to Run Setup and Run Parachain + Worker

Building and Running a Parachain: A Step-by-Step Guide

source: https://github.com/litentry/litentry-parachain/tree/dev?tab=readme-ov-file#litentry-parachain

Introduction

Overall, our architecture is made of up Relaychains ( Polkadot and Kusama), Parachains (Litentry and Litmus), and the TEE sidechain which is supported by and enables the runtime to execute in an SGX secure run environment.

Setting Up The Environment

Before you can begin building the parachain, it's crucial to set up the environment correctly. To start with, it will require:

  • The latest version of Rust

  • Machine with intel chip (optional) and SGX SDK installed to build and run tee-enclave or use our worker with SGX_MODE=SW.

  • (optional) installed Python in case you want to easily run the whole system with one command pip install python-dotenv pycurl docker toml

Building Parachain

Simply run

make help

to see the full lists of market targets and their short descriptions.

There are two methods to build a parachain: via Docker or raw binary.

To manually build the Litentry-parachain raw binary, execute the following script from the root of the project:

make build-node

To build the litentry/litentry-parachain Docker image locally, use one of the following commands:

make build-docker-release
or
make build-docker-production

These commands use the release or production cargo profile, respectively. Additionally, the parachain team has the latest Docker image published on Docker Hub. You can simply pull it using docker pull litentry/litentry-parachain:latest to save time on building.

Building worker and enclave

To build enclave you can use the intel chip but make sure you’ve installed SGX SDK or use our worker with SGX_MODE=SW.

cd tee-worker
source /opt/intel/sgxsdk/environment
SGX_MODE=SW WORKER_DEV=1 make

The simplest way to run the entire system is via a Python script. This method:

  • Checks port availability and sets different ports if required

  • Generates a config file for connecting a worker or running integration tests

  • Provides a flexible solution for running the system with multiple workers

  • Performs a cleanup after the program has been terminated

# the script will run Parachain in standalone binary mode 
# and will run 1 identity worker which will be connected to parachain
# for more details how to use script use `--help` flag
./local-setup/launch.py

Running Parachain

The running parachain will depend on how it was built Docker - make launch-docker-rococo

Local Binary Standalone - make launch-standalone

Local Binary - make launch-binary-rococo

after a successful run, it would be possible to see details via polkadot

https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer

Running Worker

Once the worker binary is successfully built, you'll be able to run it and connect it to the parachain.

cd tee-worker/bin

# use the --help flag to obtain a complete list of options and subcommands
./litentry-worker --clean-reset -T wss://localhost -P 2000 -w 2001 -r 3443 -h 4545 -p 9944 --enable-mock-server --parentchain-start-block 0 --enable-metrics run --skip-ra --dev

If the worker runs successfully, a new teebag.ParentchainBlockProcessed events will appear on the Polkadot Explorer at https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer.

Last updated