This repo contains the setup to run a local single-node fork of a Polymesh network, based off a fork of one of our networks.
This is intended to be used for local development or CI integration test purposes.
-
docker
-
docker-compose
- Start a node:
docker-compose up -d
-
Checkout to the desired branch on your local clone of Polymesh.
-
Follow the instructions on Polymesh repository to build a node locally.
-
Locate the executable build in
target/release/polymesh. This will be used later to create a snapshot. -
Clone maxsam4/fork-off-substrate and install dependencies
git clone https://github.com/maxsam4/fork-off-substrate.git cd fork-off-substrate npm i -
Create a folder called
datainside the top folder (fork-off-substrate).mkdir data
-
Copy the executable/binary of Polymesh node inside the data folder and rename it to
binary. -
Copy the runtime WASM blob of Polymesh to the data folder and rename it to
runtime.wasm. To get the WASM blob, compile your Polymesh and look for./target/release/wbuild/polymesh-runtime-develop/polymesh_runtime_develop.compact.wasm -
Run the script using the correct rpc url
```bash HTTP_RPC_ENDPOINT=http://78.47.38.110:9933 npm start ``` -
You should have the genesis file for the Polymesh inside the
datafolder. It will be calledfork.json. -
The
fork.jsonfile obtained from the repo can be saved under the snapshots directory and optionally referenced during runs like so:
SNAPSHOT_NAME=<file_name> docker-compose up -d
- A custom polymesh node version can also be provided like so:
POLYMESH_VERSION=<version> docker-compose up -d
The chain should be accessible through ws://localhost:9944