Skip to content

Quantum-Blockchains/qsb-node

Repository files navigation

Quantum Secured Blockchain (QSB)

This repository contains Quantum Secured Blockchain (QSB), a Substrate-based node implementation focused on quantum and post-quantum security.

Table of contents

1. Quick Start

  1. Install dependencies from Setup.
  2. Build the node:
cargo build --release
  1. Start PQKD service/simulator and make sure it is reachable (for example http://localhost:8182/).
  2. Run the node:
./target/release/qsb-node \
  --sae-id <SAE_ID> \
  --addr-pqkd <URL>
  1. Run tests:
cargo test -p did --lib

2. Setup

2.1. Prerequisites

To work with this repository, install:

Because this project is based on Substrate, complete the additional Substrate environment setup as described here:

3. Build

You can build the project in two ways.

3.1. Using cargo

cargo build --release

This produces the qsb-node binary in ./target/release.

3.2. Using Docker

Build a Docker image:

docker build -t qsb-node .

This creates the qsb-node image.

4. Running

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 service
  • addr-pqkd: base URL of the PQKD service (for example http://localhost:8182/)

You can also pass standard Substrate CLI options (for example --base-path, --chain, --port, --ws-port, --rpc-port, --name).

5. Testing

Current automated coverage in this repository is focused on Rust unit tests (including pallet behavior tests on mock runtime).

5.1. Full workspace tests

cargo test

5.2. DID pallet tests only

cargo test -p did --lib

5.3. Benchmarking and weight generation

Runtime 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.rs

6. Documentation

Generate Rust docs:

cargo doc

Open docs for a crate (examples):

macOS:

cd target/doc/qsb_node
open -a "Google Chrome" index.html

Linux:

cd target/doc/qsb_node
firefox index.html

7. Whitepaper

QSB Whitepaper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors