PNS
  • PNS: Your Identity in Polkadot
  • Summary
  • Advanced Topics
  • Contributing
  • Core Concepts
  • FAQ & Troubleshooting
  • PNS Troubleshooting Guide
  • PNS User Guide
  • advanced-topics
    • Contract Deployments
    • Custom Resolvers
    • Custom Top-Level Domain (TLD) Registration
    • Subdomain Management
  • contributing
    • GitHub Workflow
    • Contribution Guidelines
    • Issue Reporting
  • faq
    • Common Issues
    • Technical FAQ
Powered by GitBook
On this page
  • Overview
  • Creating a Subdomain Registrar
  1. advanced-topics

Subdomain Management

Overview

You can deploy BaseRegistrar for any node, not just TLDs. This allows for managed subdomain registration.

Creating a Subdomain Registrar

  1. Calculate Subdomain Node

const node = namehash("service.dot");
  1. Deploy Registrar

const subRegistrar = await BaseRegistrar.deploy(
    PNS_REGISTRY_ADDRESS,
    node
);
  1. Transfer Ownership

// Current owner must approve
await pnsRegistry.setSubnodeOwner(
    node,
    namehash("service"),
    subRegistrar.address
);
PreviousCustom Top-Level Domain (TLD) RegistrationNextcontributing

Last updated 3 days ago