diff --git a/docs/globally-unique-domain-zone.md b/docs/globally-unique-domain-zone.md new file mode 100644 index 0000000..229f8da --- /dev/null +++ b/docs/globally-unique-domain-zone.md @@ -0,0 +1,162 @@ +# Globally unique domain zone + +**Make sure you understand the [basic concepts]((../nns/README.md)) of `NNS`.** + +`Globally Unique Domains Zone` (`GUDZ`) is an extension of `NNS` that ensures unique names across multiple domain zones. When this option is enabled, all newly created domains will automatically receive a corresponding alias in the designated global zone. Deleting a domain will also remove its alias from the global zone. + +It's important to note that this feature is not retroactive: domains created before this option is enabled will not receive a global alias. Likewise, if the option is later disabled, domains that already have a `GUDZ` alias will retain their records. To fully disable `GUDZ`, all domains must be recreated with the option turned off. + +To enable `GUDZ`, add a `cnametgt=$(global domain)` `TXT` record that specifies the global zone. + +**Example:** + +Domains: +- `poland` +- `sweden` +- `animals.org` + +![](img/GUDZ-2.png) + +It is necessary to associate the domain zones `.poland` and `.sweden` into the global zone `.animals`. + +![](img/GUDZ-1.png) + +Create domains: + +``` +frostfs-adm morph nns register --name="poland" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +frostfs-adm morph nns register --name="sweden" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +frostfs-adm morph nns register --name="org" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +frostfs-adm morph nns register --name="animals.org" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` + +Add the `cnametgt` records: + +``` +frostfs-adm morph nns add-record --name="poland" --data="cnametgt=animals.org" --type="txt" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +frostfs-adm morph nns add-record --name="sweden" --data="cnametgt=animals.org" --type="txt" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` + +Create a domain with mapping to the global zone: + +``` +frostfs-adm morph nns register --name="bober.poland" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` + +Add any `TXT` record + +``` +frostfs-adm morph nns add-record --name="bober.poland" --data="CID" --type="txt" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` + +Verify that the created domain has alias in the global zone + +``` +frostfs-adm morph nns tokens -v --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml + +balance.frostfs +animals.org +group.frostfs +container +org +container.frostfs +proxy.frostfs +policy.frostfs +alphabet0.frostfs +sweden +frostfsid.frostfs +bober.animals.org (CNAME: bober.sweden) +netmap.frostfs +frostfs +poland +bober.poland +``` + +Create of a conflicting domain +``` +frostfs-adm morph nns register --name="bober.sweden" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml + +unable to register domain: script failed (FAULT state) due to an error: at instruction 1263 (THROW): unhandled exception: "global domain is already taken: bober.animals.org. Domain: bober.sweden +``` + +**Disable GUDZ** +Delete `cnametgt` records + +``` +frostfs-adm morph nns delete-records --type=txt --name=poland --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` +Create `hamster.poland` and `hamster.sweden` +``` +frostfs-adm morph nns register --name="hamster.poland" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +frostfs-adm morph nns register --name="hamster.sweden" --email="email@email.email" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` +`hamster.poland` and `hamster.sweden` does not have alias +``` +frostfs-adm morph nns tokens -v --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +balance.frostfs +animals.org +group.frostfs +container +org +container.frostfs +proxy.frostfs +policy.frostfs +alphabet0.frostfs +sweden +frostfsid.frostfs +bober.animals.org (CNAME: bober.poland) +netmap.frostfs +frostfs +poland +bober.poland +hamster.poland +``` +Delete global alias of `bober.poland` + +``` + frostfs-adm morph nns delete-records --name="bober.poland" --type="txt" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` + + +``` +frostfs-adm morph nns tokens -v --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +balance.frostfs +animals.org +group.frostfs +container +org +container.frostfs +proxy.frostfs +policy.frostfs +alphabet0.frostfs +sweden +frostfsid.frostfs +netmap.frostfs +frostfs +poland +bober.poland +hamster.poland +``` +Delete `bober.poland` +``` + frostfs-adm morph nns delete --name="bober.poland" --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +``` + +``` +frostfs-adm morph nns tokens -v --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml +balance.frostfs +animals.org +group.frostfs +container +org +container.frostfs +proxy.frostfs +policy.frostfs +alphabet0.frostfs +sweden +frostfsid.frostfs +netmap.frostfs +frostfs +poland +hamster.poland +``` \ No newline at end of file diff --git a/docs/img/GUDZ-1.png b/docs/img/GUDZ-1.png new file mode 100644 index 0000000..a653e5b Binary files /dev/null and b/docs/img/GUDZ-1.png differ diff --git a/docs/img/GUDZ-2.png b/docs/img/GUDZ-2.png new file mode 100644 index 0000000..7cdfd44 Binary files /dev/null and b/docs/img/GUDZ-2.png differ diff --git a/docs/img/GUDZ.drawio b/docs/img/GUDZ.drawio new file mode 100644 index 0000000..929be71 --- /dev/null +++ b/docs/img/GUDZ.drawio @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nns/README.md b/nns/README.md new file mode 100644 index 0000000..18644d1 --- /dev/null +++ b/nns/README.md @@ -0,0 +1,46 @@ +# NNS +NNS - Neo Name Service is a service that allows manage a domain name as a digital asset (NFT). It has an interface similar to `DNS` but has significant differences in its internal structure. + +## Entities: + +- Domain +- Record +- Owner +- Committee + +### Domain + +Domain is string that satisfies the following requirements: +- Length from 2 to 255 characters. +- Root domain must start with a letter. +- All other fragments must start and end with a letter or digit. + +Domain has owner, a registration period, and may optionally have records. + +A fee established by the committee is charged upon domain registration. After registration, the owner can manage this asset (add/delete records, transfer ownership to another owner) until the end of the domain registration period. + +### Record + +A record is a pair of values ``. + +Supported record types: + +| Type | Description | +|-------|-------------------------------------------| +| A | Represents address record type | +| AAA | Represents IPv6 address record type | +| TXT | Represents text record type | +| CNAME | Represents canonical name record type | +| SOA | Represents start of authority record type | + +### Owner + +An owner is a wallet that has the right to manage this NFT (domain). + +### Committee + +The committee makes new tokens (domains), sets, and charges a fee for issuance. + +## Globally Unique Domain Zone + +For more information, see [here](../docs/globally-unique-domain-zone.md).