Skip to content

Phala-Network/khala-parachain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b216c94 · Apr 22, 2023
Dec 18, 2022
Apr 12, 2023
Apr 20, 2023
Aug 30, 2021
Apr 20, 2023
Apr 13, 2023
Apr 12, 2023
Mar 28, 2023
Apr 12, 2023
Apr 22, 2023
Apr 21, 2023
Sep 3, 2021
May 17, 2021
Sep 2, 2021
Oct 30, 2022
Apr 20, 2023
Apr 20, 2023
May 15, 2021
Sep 2, 2022
Feb 10, 2023

Repository files navigation

Khala Parachain

Khala parachain repo.

Build Note

For production build

cargo build --profile production

For testnet build

cargo build --profile testnet

Build runtime only

cargo build --profile production -p khala-parachain-runtime

Enable on-chain-release-build would reduce ~100 KB

cargo build --profile production --features on-chain-release-build -p khala-parachain-runtime

Special note for macOS

You have to install LLVM from Homebrew because Xcode bundled doesn't have WASM target

brew install llvm

As formula note shows binaries locate at /opt/homebrew/opt/llvm/bin (You can revisit it via brew info llvm, beware Intel Mac has different location)

Make alias for ar and ranlib to ensure use custom installed LLVM instead of Xcode bundled

cd /opt/homebrew/opt/llvm/bin
ln -s llvm-ar ar
ln -s llvm-ar ranlib

NOTE: You have to re-do this step after you upgrade or reinstall LLVM

Before compiling khala-node, add custom installed LLVM to $PATH

export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

Development Note

Run a local testnet cluster

  1. Build
cargo build --release
  1. Prepare binaries

You can get latest Polkadot Linux release from https://github.com/paritytech/polkadot/releases

For macOS, you have to build from source

cp <path-to-polkadot> ./polkadot-launch/bin/
cp ./target/release/khala ./polkadot-launch/bin/
  1. Start a local test net
cd polkadot-launch
yarn
yarn start ./thala_dev.config.json
  1. (Optional) Inject session key.

Only required for *_local.config.json

Please make sure to use the correct session key json file.

cd scripts/js
yarn
KEY_FILE=session_key.json.example node insert_session_key.js