handshake-org / hsd

Handshake Daemon & Full Node
Other
1.93k stars 278 forks source link

dumpzone RPC Call #152

Open tynes opened 5 years ago

tynes commented 5 years ago

dumpzone RPC

A Node RPC dumpzone that dumps the state of the Handshake Zone into a file could be useful for building DNS infrastructure on top of hsd.

By default, the file could be output in the zone file format. The definition of a zone file is here, section 5 - https://tools.ietf.org/html/rfc1035 A more clear example - https://ns1.com/resources/dns-zones-explained

Arguments

Detailed mode should only be able to work with JSON output, since the point of outputting a zone file is to interoperate directly with DNS servers

kilpatty commented 5 years ago

@tynes Thoughts about making this a plugin vs an RPC call? Perhaps both will work well, but I was thinking a plugin might give us more flexibility with configuration e.g. file format, write to disk every x minutes.

tynes commented 5 years ago

I think that the base functionality should be a RPC. Then everybody has the functionality built into the daemon without needing to install another package for the plugin. I think that a plugin could be useful for extending the base functionality, in particular the write to disk every so often job. You can also get this functionality with a cron job or an event that hs-client listens to. I think the proper solution would depend on the particular security constraints. Getting feedback from people who run large scale DNS infrastructure or people that have a particular use case for this RPC would be helpful for helping us decide exactly how it should work.

My usecase involves dumping the state of the Handshake zone in JSON with extra details so that it is possible to make visualizations of the tree. I'd personally like to listen to an event using hs-client, maybe something like tree update, so that I can call dumpzone filename /*json=*/true /*detail=*/true right after the tree is updated

Bitcoin has a similar RPC method called dumpwallet https://bitcoincore.org/en/doc/0.16.0/rpc/wallet/dumpwallet/

kilpatty commented 5 years ago

Ah yes good point, I think plugin to extend base functionality would be best as well.

Happy to help work on this if it's needed!

chjj commented 5 years ago

@tynes, we have a full implementation of the zone file format in bns:

As far as dumping to zone file goes, I have some code written for this currently (along with the new record types). Will push soon.

0xhaven commented 5 years ago

@chjj Encoding a name's wire data to a Zone file would make public resolvers like hs.zone a lot more reliable. Any update on that?

pinheadmz commented 4 years ago

As far as dumping to zone file goes, I have some code written for this currently (along with the new record types). Will push soon.

@chjj was this merged?