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.
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"
]
}
So, you have a long list of domain names and you want to get the status of each straight from the chain?
Get this package
git clone https://github.com/nlydv/name-check
cd name-check
npm install
Rename config.example.json
mv config.example.json config.json
and save your node's API keys in config.json
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.
./index.js
or
node .
This project is licensed under the terms of the MIT license (see LICENSE.txt file published therein).