pnpm is used in this project as the Javascript package manager to install dependencies. To install it you can follow the official instructions at: https://pnpm.io/installation
The quickest way is via their script: curl -fsSL https://get.pnpm.io/install.sh | sh -
Important
This is required for DEV
& BSPNET
modes.
cargo build --release
Important
If you are running this on a Mac, zig
is a pre-requisite for crossbuilding the node. Instructions to install can be found here.
pnpm i
pnpm crossbuild:mac
pnpm docker:build
This is a small network running in dev
mode, with manual sealing on blocks, between a BSP & a User node. This is used to test the merklisation of files, and their retrieval.
pnpm test:bspnet
The storage-hub
node is run in a docker container in dev mode, so that it can be isolated and parallelized across multiple threads & runners. The purpose of this suite is verify functionality of both the RPC and runtime.
Important
Provider functionality is not covered here, only how the system chain behaves.
pnpm test:node
Note
Please ensure the rust project is built first e.g. cargo build --release
.
This is required as currently we only support native binaries.
In /test
run: pnpm install
to install zombienet
# in the /test directory
pnpm i
pnpm zombie:run:full:native
Wait for zombie network to start, and then:
pnpm typegen
pnpm zombie:setup:native
pnpm test:full
This is the networking testing suite for topology and network stability. It is a suite of tests that run on a network of nodes, and is used to verify the network's stability and the nodes' ability to communicate with each other.
pnpm zombie:test:native
- Native launch:
../target/release/storage-hub --dev
- Docker launch (local):
pnpm docker:start
/pnpm docker:stop
- Docker launch (latest):
pnpm docker:start:latest
/pnpm docker:stop:latest
pnpm docker:start:bspnet
This will start a BSPNet network with a BSP and a User node. As part of the setup it will force onboard a MSP and BSP, and then upload a file from user node.
Note
The BSP id is chosen to be the fingerprint of a file that is uploaded by the user node. This is to "game the system" to ensure that the BSP is guaranteed to be selected to store the file.
- Docker launch (local):
pnpm docker:start:noisynet
/pnpm docker:stop:noisynet
Tip
Polkadot binaries are required to run a zombienet network.
For Linux you can run the script: pnpm tsx scripts/downloadPolkadot.ts <version>
For macOS you will have to compile from source.
To launch a non-ephemeral ZombieNetwork by executing the following in: /test
directory:
pnpm install
pnpm zombie:run:native
From here you should see in the terminal, the different nodes being spun up. When the network is fully launched, you should see something like this:
From here you can interact via the websockets exposed in the direct links, in the example above we have:
- Alice (relay):
35005
- Bob (relay):
37613
- Collator (storage-hub):
45615
This repo uses polkadot{.js} TS Type Generation AKA api-augment
.
To generate new type interfaces run the following in /test
:
pnpm typegen
Tip
Like with other commands, this assumes you have built a node binary and docker image before executing this activity.