Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 1.83 KB

testing.md

File metadata and controls

64 lines (41 loc) · 1.83 KB

Testing Guide

The project includes unit tests for various components. The tests are designed to verify the functionality of the DNS client without requiring a connection to the actual blockchain network.

Running Tests

To run all tests in the project:

go test ./... -v

Running Tests for a Specific Component

To run tests for a specific component, you can use the following command:

go test ./<component_name> -v

Manual Testing

To manually test the DNS client, you can use the following command:

git clone https://github.com/khalidzahra/dns_client_golang.git
cd dns_client_golang
go run main.go --domain <domain>

Example

git clone https://github.com/khalidzahra/dns_client_golang.git
cd dns_client_golang
go run main.go --domain example.com

Output

Resolved Chain Spec: %+v

However, for this to work, you need to have a valid root network specification URL set in the environment variable ROOT_SPEC_URL. Moreover, you need to have a valid TLD network deployed and registered on the root network. This can be done by deploying two nodes, one for the root network and one for the TLD network, and registering the TLD network on the root network.

Node Deployment

To deploy a node, you can use the following command:

cd ../polkadot-sdk-solochain-template
cargo build --release
./target/release/node-template --dev

TLD Registration

To register a TLD, you can use the register_tld extrinsic provided by the rootdns pallet. The extrinsic can easily be called using the polkadot explorer.

Domain Registration

To register a domain, you can use the register_domain extrinsic provided by the tld pallet. The extrinsic can easily be called using the polkadot explorer.