Issues configuring a subdomain registrar

Hi @aaron

I’ve managed to get the subdomain registrar running, but after attempting to register my first subdomain (which hasn’t gone through after about 12 hours - I think I have made a typo) I can’t register a new subdomain. Is there a way to kill the previous (pending?) subdomain registration? It seems that the IP address of my CLI-node is flagged at the moment.

Also another question I have: is the Blockstack-Core required to run the Subdomain Registrar? Or can you run this in any NPM environment? Thanks!

Error details below:

$ curl http://localhost:3000/status/citizen1 | jq . % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 95 0 95 0 0 103 0 --:–:-- --:–:-- --:–:-- 103
{
“status”: “Subdomain is queued for update and should be announced within the next few blocks.”
}
$ curl -X POST -H ‘Authorization: bearer API-KEY-IF-USED’ -H ‘Content-Type: application/json’ --data ‘{“zonefile”: "$ORIGIN newname\n$TTL 3600\n_https._tcp URI 10 1 "https://gaia.blockstack.org/hub/16kHpNLfMeyQx1n3EYkkAVV92tknug9Uae/profile.json"\n", “name”: “newname”, “owner_address”: “16kHpNLfMeyQx1n3EYkkAVV92tknug9Uae”}’ http://localhost:3000/register/
{“status”:false,“message”:"FBSK_SUBDOMAIN_CONFIG=/home/xxxxx/subdomain-registrar/config.json sudo npm run start

Subdomain registrar started
2018-03-20T20:23:09.036Z - warn: newname failed spam-check: IP address ::1 already registered 1 subdomains.
2018-03-20T20:23:09.038Z - error: Error: IP address ::1 already registered 1 subdomains.
at /home/xxxxx/subdomain-registrar/lib/server.js:139:17

@luckshas fyi

You can configure the spam settings via your config.json file –

Set:

"ipLimit" : 0

And then the registrar won’t limit the number of names an IP address can register.

Also another question I have: is the Blockstack-Core required to run the Subdomain Registrar? Or can you run this in any NPM environment? Thanks!

Nope, the subdomain registrar can run independently.

Hi @aaron

I still get an IP-spam warning even when adding “ipLimit” : 0 to config.json.

Is there anything else I should look at?

2018-03-25T22:17:26.889Z - warn: newuser1 failed spam-check: IP address ::1 already registered 1 subdomains.
2018-03-25T22:17:26.891Z - error: Error: IP address ::1 already registered 1 subdomains.
at /home/xxxxx/subdomain-registrar/lib/server.js:139:17

@aaron

Sorry I was confused there for a moment. I have now set the ipLimit to 0 in the /src/config.js (under ‘domainName’) and looks like it now works and I can broadcast additional sponsored names. Will get back to you if I run into something. Thanks!

@aaron Further on this, I get the following result after the initial sponsored name submission:

2018-03-25T22:55:33.179Z - info: Logging requestor info (ip= ::1 owner=xxxxx
2018-03-25T22:55:33.195Z - info: Queued operation on username1: owner= xxxxx seqn= 0 zf= $ORIGIN username1
$TTL 3600
_https._tcp URI 10 1 “https://gaia.blockstack.org/hub/xxxxx/profile.json

2018-03-25T23:10:27.198Z - error: Failed to check zonefile transaction status.
2018-03-25T23:10:27.750Z - info: 2 items in the queue.
2018-03-25T23:10:27.774Z - error: Failed to submit batch: TypeError: Cannot read property ‘name’ of undefined
2018-03-25T23:10:27.775Z - error: TypeError: Cannot read property ‘name’ of undefined
at processValues (/home/xxx/subdomain-registrar/node_modules/zone-file/lib/makeZoneFile.js:174:89)
at makeZoneFile (/home/xxx/subdomain-registrar/node_modules/zone-file/lib/makeZoneFile.js:26:16)
at makeUpdateZonefile (/home/xxx/subdomain-registrar/lib/operations.js:78:48)
at /home/xxx/subdomain-registrar/lib/server.js:261:61
at process._tickCallback (internal/process/next_tick.js:109:7)
2018-03-25T23:10:27.775Z - error: Failed to broadcast batch.

It looks like there’s a misconfiguration in the subdomain registrar – what domain name are you setting up the registrar with and did you set that in your config.json file?

How are you running the registrar (i.e., what commands are you runnning), because it should have picked up your changes in the config file, and you shouldn’t have needed to edit config.js

1 Like

@aaron am running the following command to start it up:

BSK_SUBDOMAIN_CONFIG=/home/xxx/subdomain-registrar/config.json sudo npm run start

I have added my ‘domain.id’ to the config.json file. The domain belongs to an identity in the Blockstack Browser. My issue now is that I don’t know how to reveal the accompanying ‘ownerKey’ and ‘paymentKey’ for this domain. Is there a way to do this in the Blockstack Browser? Or is this information only available through the CLI (e.g. ‘sudo blockstack wallet’)?

@aaron Further on this; do I understand correctly that even while registering a domain through the CLI fails to store the zone file and therefore needs a manual fix as per ‘Failed to store profile’ , it is still easier to reveal the ownerKey and paymentKey for Subdomain-Registrar purposes through the CLI (‘blockstack wallet’ command) than registering a domain through the Blockstack Browser and revealing the keys that way?

And is the Subdomain-Registrar compatible with Multisig addresses? When I run ‘blockstack wallet’ through the CLI it reveals multiple private keys for Owner and Payment. Which ones do I add to the config.json?

Looking forward to some clarification, thank you.

Hi @blockpac,

Currently, you cannot use multi-sig addresses with the subdomain registrar (support hasn’t been added to the upstream blockstack.js library yet.

1 Like

@aaron Is there a way to clear the queue?

2018-03-29T03:23:49.609Z - error: Failed to check zonefile transaction status.
2018-03-29T03:23:50.303Z - info: 3 items in the queue.
2018-03-29T03:23:50.304Z - error: Failed to submit batch: TypeError: Cannot read property ‘name’ of undefined
2018-03-29T03:23:50.304Z - error: TypeError: Cannot read property ‘name’ of undefined

2018-03-29T03:23:50.305Z - error: Failed to broadcast batch.
2018-03-29T03:23:50.303Z - info: 3 items in the queue.

@aaron or @jude

I have a few remaining questions regarding the config.json file. Hope you can help out.

{
“ownerKey”: “YOUR-OWNER-KEY”, //Which key is this and how can I obtain it?
“paymentKey”: “YOUR-PAYMENT-KEY”, //Which key is this and how can I obtain it?
“domainUri”: “https://gaia.blockstack.org/hub/ADDRESS/profile.json”, //Is this the zone file address of the subdomain requester?
“dbLocation”: “/root/subdomain_registrar.db”, //I have tried to change its location, but didn’t work. Any suggestions?
“domainName”: “domain.id”, //Is this the top-domain owned by the above ownerKey?
“adminPassword”: “ADMIN-PASSWORD”, //Is this needed for admin web access?
“port”: 3000,
“ipLimit”: 0, //Does this prevent spam flags for a server IP that runs the Subdomain Registrar?
“disableRegistrationsWithoutKey”: false,
“apiKeys”: [“6b22b2c7-8258-4ff9-8ff1-19f1f9f0148a”],
“winstonConsoleTransport”: {
“level”: “info”,
“handleExceptions”: false,
“timestamp”: true,
“stringify”: true,
“colorize”: true,
“json”: false
}
}

1 Like

@aaron I am not sure what the issue is in my setup, still getting the following:

2018-04-01T11:59:39.579Z - error: Failed to check zonefile transaction status.
2018-04-01T11:59:40.396Z - info: 1 items in the queue.
2018-04-01T11:59:40.401Z - error: Failed to submit batch: TypeError: Cannot read property ‘name’ of undefined
2018-04-01T11:59:40.402Z - error: TypeError: Cannot read property ‘name’ of undefined
2018-04-01T11:59:40.403Z - error: Failed to broadcast batch.

Also, should I see a debit in the wallet balance of the payment key for the cost of the subdomain registration once it goes through?

Successfully registered my first subdomain today. Thanks @aaron and @jude for your support!

3 Likes

Hi @blockpac, how long did you have to wait until the status message {"status":"Subdomain is queued for update and should be announced within the next few blocks."} turned into something more revealing?

That is what the status message gave before
{"status":true,"message":"Your subdomain registration was received, and will be included in the blockchain soon."}, which looks like everything is ok.

@jude, I’ve been waiting now for more then 6 hours and the status message is still the same. Is this normal?
Also, is there a place to check the transaction? But I have not received a transaction id (yet).

@jefvanbockryck have you tried to force the batch with this command?

curl http://localhost:3000/issue_batch -X POST -H ‘Authorization: bearer YOURPASSWORD_FROM_CONFIG_JSON’

Hi @jude, today I tried again, running a subdomain registrar on docker. I think I managed to get it working and was able to register jef.leyqi.id. If I look at the zonefile history (using the old CLI) then it shows a new zonefile entry (looks correctly formatted) and I can do a name lookup via the registrar local installation and via the Blockstack Explorer.
So, if it looks like a bear and smells like it, then it’s probably a bear, right :smile:

Can you check if I am right, please?

Now I have three questions:

  1. How can I use a subdomain name like jef.leyqi.id in a Blockstack Browser, just like a normal ID?

  2. How can I submit more then one subdomain name in a batch, because now I paid a full update fee for just one name?

  3. Looking up leyqi.id in the Blockstack Explorer, it doesn’t show the profile anymore. Is this normal?

Tnx in advance.

It looks like the name was registered, but you registered it to the same address that owns leyqi.id:

$ blockstack-cli whois jef.leyqi.id
{
  "address": "1KkVG4XkFY4WTnFnFjdSofdkhRZRLDfwq6",
  "blockchain": "bitcoin",
  "last_txid": "cd0baf4d6ddd5ce3d55659ba3061085d23314d53151062bdc6ecca949cfa46c2",
  "status": "registered_subdomain",
  "zonefile": "$ORIGIN jef\n$TTL 3600\n_https._tcp URI 10 1 \"http://leyqi.eu/leyqi-temp/profile.json\"\n",
  "zonefile_hash": "74a67938e406da6f24a133196f36278068b3146f"
}
$ blockstack-cli names ID-1KkVG4XkFY4WTnFnFjdSofdkhRZRLDfwq6
[  
  "leyqi.id",
  "jef.leyqi.id"
]

How can I use a subdomain name like jef.leyqi.id in a Blockstack Browser, just like a normal ID?

It would normally be the case that you can use a subdomain name to sign in. However, the Browser only allows one name per ID-address, and your ID-address was already taken by leyqi.id. The Browser doesn’t yet know how to let you see multiple names per ID-address :frowning: We’ll have to ask @larry for details.

In the mean time, if you create a new ID-address from the ID page, and register a subdomain for that ID-address, you should be able to sign in with it.

How can I submit more then one subdomain name in a batch, because now I paid a full update fee for just one name?

This is configurable in the subdomain registrar config file. Specifically, you can alter the batchDelayPeriod to be longer (it’s the number of minutes between sending out subdomain batches). You can make it extremely long (i.e. on the order of days) and then submit a lot of subdomain updates and use the adminPassword or one of the strings in the apiKeys to force it to flush the queued updates.

Looking up leyqi.id in the Blockstack Explorer, it doesn’t show the profile anymore. Is this normal?

Your profile was signed by the private key whose public key is 02cdfb3300d6a667be20aeca7025f379371af6048c2f453247f49cb0aa8e8aca91 (address 18zAHmfRYGyDecjkRstdwzsTHFfA6ChM9A). Your ID-address is 1KkVG4XkFY4WTnFnFjdSofdkhRZRLDfwq6. You will need to generate a new profile JWT signed with the private key for 1KkVG4XkFY4WTnFnFjdSofdkhRZRLDfwq6 and upload it to the same URL (in your case, http://leyqi.eu/leyqi-temp/profile.json). You can get your private key using your 12-word phrase and the make_keychain command in the blockstack-cli tool, and you can sign a profile with the sign_profile command.

Hope this helps!

Hi @jude, yes tnx it did help.
I could register a subdomain name on another name I own, just in case. That worked nice. So, now I can move on two doing two things: fix my leyqi.id domain and do the batch subdomain registration.

For the first, I need to update my zonefile, right? If I look at the blockstack-cli update command, it says:

Update the zonefile for an on-chain Blockstack ID. Once the transaction
confirms, you will need to push the zone file to the Blockstack peer
network with “zonefile_push.”

What are the correct steps then? First do an update and then the zonefile_push? Why is that zonefile_push needed?

Then for the second, the batching. Where exactly in the subdomain registrar config file can I enter this batchDelayPeriod?
Then I should use the curl command using the issue_batch?

Did you get the answers for the config file of subdomain ?
were you doing this on bitcoin mainnet, what should be the config in the case of testnet/regtest environment ?

@AkshitV yes - and I got the subdomain registrar working at the time. Will dig thru my archives and come back with some config info. Was definitely done on Bitcoin Mainnet.