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.
To run all tests in the project:
go test ./... -v
To run tests for a specific component, you can use the following command:
go test ./<component_name> -v
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>
git clone https://github.com/khalidzahra/dns_client_golang.git
cd dns_client_golang
go run main.go --domain example.com
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.
To deploy a node, you can use the following command:
cd ../polkadot-sdk-solochain-template
cargo build --release
./target/release/node-template --dev
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.
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.