Spawn a local network using Zombienet and try out our XCM domain service.
You have configured your environment for Substrate development by installing Rust and the Rust toolchain.
- Make the bash script -
zombienet.sh
executable.
chmod +x zombienet.sh
- Install the polkadot, contracts-parachain, zombienet binaries.
./zombienet.sh init
NOTE: This can take a while (around 20+ minutes depending upon the system)...
- Spawn the network
./zombienet.sh spawn
This command spawns the following chains:
- Relay chain (ws_port: 9900)
- Contracts parachain#1 (ws_port: 9910) {Hub}
- Contracts parachain#2 (ws_port: 9920) {Spoke}
- Deploy the contracts
Open a new shell with the same working directory and run:
cargo run
This will deploy the following contracts:
-
Domain-service
on parachain#1 (address:5Dg8MLVcwDHAv5FjWBeeLute7M9yHXoic6oBYk97fpK2BXKx
) -
Xcm-handler
on parachain#1 (address:5DhGtfSDhZHzQKTjzy2NFEwEXBtHzMEx68WdwJmHWSM6MTZJ
) -
Xc-domain-service
on parachain#2 (address:5CAogDHwRT8pUkRBzBsPczKSMPULuh6Zg6zK3kQQzYtQUwYf
)
NOTE: It can take some time (around 2-4 minutes) to complete the deployment.
- Interacting with the contracts.
Open two contracts-ui
page on your preferred browser, one for each chain. Use the following links:
-
Contracts-UI for parachain#1
-
Contracts-UI for parachain#2
Click on Add New Contract
and choose the Use On-chain Contract Address
method. Add the contracts on the respective Contracts-UI
page. It will ask for the metadata which you can find in the artefacts folder.
INFO: You can skip this step for
Xcm-handler
contract.
You will need funds in your account for domain purchases/gas payment if not using pre-funded accounts like ALICE. Run the following command that will transfer 100 units of token to the specified addresses:
cargo run -- fund <space-separated addresses>