Skip to content

XCM Testing Environment and Instructions

Prepare your environment

First, build both mubert-node and mubert-cli. You will also need a Zombienet configuration file for testing purposes. This configuration file can be found at the following location: zombienet.toml

Run the Mubert Parachain Node

zombienet-big.toml is already configured to run two parachains (para_id=4724 and para_id=4725) for XCM testing.

zombienet -p native spawn zombienet-big.toml

Establish a HRMP between Parachains

cd scripts/hrmp
npm i
node establish.mjs

Prepare testing Authority and IP-Onchain entity

Create your authority on the first parachain

mubert-cli --node-url=ws://127.0.0.1:9945 create-authority --name=test --kind=musician

Create your authority on the second parachain

mubert-cli --node-url=ws://127.0.0.1:9944 create-authority --name=test --kind=musician

Create a testing IP-Onchain entity

mubert-cli --node-url=ws://127.0.0.1:9944 upload-ip --api-auth='not-needed' --file=./music.wav --data-file=./examples/create_entity_no_upload.json

Transfer

Make a foreign request for your entity. You’ll need to know the foreign_authority_id and authority_id on the chain to which the entity will be transferred.

mubert-cli --node-url=ws://127.0.0.1:9945 foreign-request --data='{"foreign_authority_id":0,"foreign_authority_name":"foreign_authority","entity_id":0}' --src-parachain-id=4725 --dst-parachain-id=4724

Check the request

mubert-cli --node-url=ws://127.0.0.1:9944 get-foreign-request --request-id=0 | jq
Check the foreign authority
mubert-cli --node-url=ws://127.0.0.1:9944 get-authority --authority-id=1 | jq

Approve the XCM request

mubert-cli --node-url=ws://127.0.0.1:9944 foreign-request-approve --entity-id=0 --request-id=0 

Execute the transfer

mubert-cli --node-url=ws://127.0.0.1:9945 foreign-request-take --request-id=0 --dst-parachain-id=4724

Validate

Check the transfer status

mubert-cli --node-url=ws://127.0.0.1:9944 get-foreign-request --request-id=0 | jq

Check the transferred entity

mubert-cli --node-url=ws://127.0.0.1:9945 get-entity --entity-id=0 | jq