Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dumpzone RPC Call #152

Open
tynes opened this issue Apr 22, 2019 · 6 comments · May be fixed by #534
Open

dumpzone RPC Call #152

tynes opened this issue Apr 22, 2019 · 6 comments · May be fixed by #534
Labels
dns part of the codebase has PR issue - issue has PR node-rpc part of the codebase

Comments

@tynes
Copy link
Contributor

tynes commented Apr 22, 2019

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

  • filename - name of file to write to
  • json - output the file in json
  • detailed - add additional handshake specific information like auction state

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

@tynes tynes added the api label Apr 22, 2019
@kilpatty
Copy link
Contributor

@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
Copy link
Contributor Author

tynes commented Apr 22, 2019

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
Copy link
Contributor

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
Copy link
Contributor

chjj commented Apr 30, 2019

@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
Copy link

0xhaven commented Sep 12, 2019

@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
Copy link
Member

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?

@pinheadmz pinheadmz linked a pull request Mar 13, 2021 that will close this issue
@nodech nodech added has PR issue - issue has PR node-rpc part of the codebase dns part of the codebase and removed api labels Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dns part of the codebase has PR issue - issue has PR node-rpc part of the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants