Skip to content

Input a list of Handshake top-level domains, outputs names sorted into 4 arrays: available, registered, reserved, or invalid.

License

Notifications You must be signed in to change notification settings

nlydv/name-check

Repository files navigation

name-check

A simple NodeJS package that, given a flat list of top-level domain names, queries the Handshake (HNS) blockchain in order to classify each domain based on its availability in the Handshake root zone.

Example

Running with the included list of test names

[
  "alpha",
  "beta",
  "gamma",
  "delta",
  "alice",
  "bob",
  "carol",
  "dave",
  "alongenoughstringthatispresumablynotregistered",
  "alongenoughstringthatispresumablynotregisteredandisalsotoolongtobeavaliddomainname"
]

returns:

{
  "available": [
    "alongenoughstringthatispresumablynotregistered"
  ],
  "registered": [
    "beta",
    "bob",
    "carol",
    "dave"
  ],
  "reserved": [
    "alpha",
    "gamma",
    "delta",
    "alice"
  ],
  "invalid": [
    "alongenoughstringthatispresumablynotregisteredandisalsotoolongtobeavaliddomainname"
  ]
}

Usage

So, you have a long list of domain names and you want to get the status of each straight from the chain?

Download

Get this package

git clone https://github.com/nlydv/name-check
cd name-check
npm install

Setup

Rename config.example.json

mv config.example.json config.json

and save your node's API keys in config.json

Import

Then, format your list of names as a simple JSON array in the nameList.json file. If you're not familiar with JSON, just Google "txt to json list" or something and you'll probably find some online converters.

Run

./index.js

or

node .

License

This project is licensed under the terms of the MIT license (see LICENSE.txt file published therein).

About

Input a list of Handshake top-level domains, outputs names sorted into 4 arrays: available, registered, reserved, or invalid.

Topics

Resources

License

Stars

Watchers

Forks