forked from TrueCloudLab/frostfs-contract
75 lines
No EOL
2.2 KiB
Markdown
75 lines
No EOL
2.2 KiB
Markdown
# 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 `<type, string>`.
|
|
|
|
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).
|
|
|
|
## NNS and Frostfsid
|
|
|
|
You can register a TLD domain without a committee signature using Frostfsid. To do this, create a new wallet
|
|
```
|
|
neo-go wallet init -w newwallet/wallet.json
|
|
```
|
|
|
|
Get wallet address:
|
|
```
|
|
neo-go wallet dump-keys -w newwallet/wallet.json
|
|
[subject-address]
|
|
[subject-key]
|
|
```
|
|
|
|
Create a subject in `FrostfsID`:
|
|
```
|
|
frostfs-adm morph frostfsid create-subject --subject-key="[subject-key]"
|
|
```
|
|
|
|
Grant permissions to the wallet:
|
|
```
|
|
frostfs-adm morph nns give-privilege --subject-address="[subject-address]"
|
|
```
|
|
|
|
Register domain:
|
|
```
|
|
neo-go contract invokefunction [NNS-hash] register "subdomain.domain" hash160:[subject-address] "email@frostfs.info" 10000 1000 1000 1000 -- [subject-address]:Global
|
|
``` |