University Parachain (1000) → Company Parachain (2000)
Technologies and frameworks used: XCM, HRMP, Zombienet, and Polkadot SDK
This repository demonstrates XCM (Cross-Consensus Messaging) between two sibling parachains running on a local Polkadot network.
- Students are created on Parachain 1000 (University)
- Graduating a student triggers an XCM
Transact - Student data is executed and stored on Parachain 2000 (Company)
- State changes are visualized via a React + Vite frontend
The goal of the project is to showcase real, executable cross-parachain calls, not UI complexity or node setup.
Relay Chain (9944)
│
├─ Parachain 1000 (University) ──▶ HRMP ──▶ Parachain 2000 (Company)
│ 9988 9999
│
└─ React + Vite Frontend (5173)
| Component | Address / Port |
|---|---|
| Relay Chain | ws://127.0.0.1:9944 |
| Parachain 1000 | ws://127.0.0.1:9988 |
| Parachain 2000 | ws://127.0.0.1:9999 |
| Frontend UI | http://localhost:5173 |
5173 must be open to access the UI.
The network is started using Zombienet:
zombienet --provider native spawn zombienet.toml📖 Zombienet documentation:
https://paritytech.github.io/zombienet/
An HRMP channel (1000 → 2000) must be opened on the relay chain.
Run the script while Zombienet is starting (after a few seconds):
./setup-channels.shThis script uses sudo on the relay chain (Alice) to open the channel via hrmp.forceOpenHrmpChannel.
The frontend is built with:
- React 18
- Vite
- Tailwind CSS
- polkadot.js API
- lucide-react icons
cd frontend
npm install
npm run devUI available at:
👉 http://localhost:5173
The UI connects directly to:
- Parachain 1000 (
9988) - Parachain 2000 (
9999)
and signs transactions using the Alice dev account.
For detailed on-chain inspection, use Polkadot.js Apps:
-
Relay Chain:
https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944 -
University Parachain (1000):
https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9988 -
Company Parachain (2000):
https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9999
Useful sections:
- Developer → Extrinsics
- Developer → Chain state
- Network → Explorer
- XCM / HRMP events on relay chain
- User clicks Graduate Student in UI
graduateStudentextrinsic executes on Para 1000- Student data is encoded into an XCM
Transact - XCM message routed via Relay Chain
- Para 2000 executes
receiveStudent - Student appears on Company parachain
Security is enforced via:
- XCM Barriers
- SafeCallFilter
- Sibling parachain origin checks
Whenever binary code changes (runtime, pallets, node):
cargo build --release
cargo install --path nodeZombienet must be restarted after rebuilding.
.
├── node/ # Parachain node
├── runtime/ # Runtime + XCM config
├── pallets/ # Student pallet
├── frontend/ # React + Vite UI
├── zombienet.toml
├── zombienet-omni-node.toml
├── setup-channels.sh # HRMP setup script
├── dev_chain_spec.json
├── Cargo.toml
├── Cargo.lock
└── README.md
This project is based on the official:
polkadot-sdk-parachain-template
https://github.com/paritytech/polkadot-sdk-parachain-template
and extended with:
- Custom student pallet
- XCM configuration
- HRMP messaging
- Frontend visualization
Unlicensed / Public Domain.