This repository contains Quantum Secured Blockchain (QSB), a Substrate-based node implementation focused on quantum and post-quantum security.
- Install dependencies from Setup.
- Build the node:
cargo build --release- Start PQKD service/simulator and make sure it is reachable (for example
http://localhost:8182/). - Run the node:
./target/release/qsb-node \
--sae-id <SAE_ID> \
--addr-pqkd <URL>- Run tests:
cargo test -p did --libTo work with this repository, install:
- Rust
- Rust toolchain pinned via
rust-toolchain.toml(required:1.75.0) - Docker (optional)
- PQKD/QKD simulator (available from Quantum Blockchains: https://www.quantumblockchains.io/pqkd/)
- Certificate required by your PQKD simulator setup
Because this project is based on Substrate, complete the additional Substrate environment setup as described here:
You can build the project in two ways.
cargo build --releaseThis produces the qsb-node binary in ./target/release.
Build a Docker image:
docker build -t qsb-node .This creates the qsb-node image.
Using built binary:
./target/release/qsb-node \
--sae-id <SAE_ID>
--addr-pqkd <URL>Using Cargo:
cargo run --release --bin qsb-node -- \
--sae-id <SAE_ID> \
--addr-pqkd <URL>sae-id: identifier of the SAE (node) used by the PQKD serviceaddr-pqkd: base URL of the PQKD service (for examplehttp://localhost:8182/)
You can also pass standard Substrate CLI options (for example --base-path, --chain, --port, --ws-port, --rpc-port, --name).
Current automated coverage in this repository is focused on Rust unit tests (including pallet behavior tests on mock runtime).
cargo testcargo test -p did --libRuntime benchmarks are used to generate pallet weights (for example pallets/did/src/default_weights.rs).
Example command:
target/release/qsb-node benchmark pallet \
--chain dev \
--pallet did \
--extrinsic '*' \
--steps 20 \
--repeat 10 \
--output pallets/did/src/default_weights.rsGenerate Rust docs:
cargo docOpen docs for a crate (examples):
macOS:
cd target/doc/qsb_node
open -a "Google Chrome" index.htmlLinux:
cd target/doc/qsb_node
firefox index.html