domob wrote:Khal: Thanks for your opinion. I'll do it, just waiting for more input on the names of plugins and methods to create (as I don't want to just invent something myself).
I admit that it may be a bit complex to follow where the code should go :p
The most complex interactions are related to DNS, here are how it is articulated :
plugin :
* pluginDNS :
- can resolve rpc requests for .bit or any other plugin that register itself as a DNS handler
- reply can be formatted in json or as a classic DNS request (used by the DNS server)
- only understand domain names, not namecoin names
* pluginNamespaceDomain.py :
- register itself as a DNS handler, must implement the methods needed by the DNS handler (_handle, _resolve + config)
- can resolve rpc requests for .bit and .tor + specific rpc requests for that namespace not covered by the DNS
- does not currently provide useful public rpc method usable with "d/" names
- the only public method "lookup" uses a domain name as input instead of a name (which is wrong) and is only used by the DNS plugin
service :
* serviceDNS.py :
- DNS server, can be started on port 53 or else (conf/service-dns.conf to tweak it)
- uses pluginNamespaceDomain.py for .bit and .tor, other internal method otherwise
Here is how to define a handler for the DNS plugin :
class pluginNamespaceDomain()
handle = ['dns'] # the DNS plugin will check this
filters = {'dns': '.bit$|.tor$'} # the DNS plugin will use this plugin only for .bit and .tor domains
def pLoadconfig(self): # register itself as a handler for the DNS plugin
app['plugins']['dns'].handlers.append(self)
class serviceDNS()
Currently uses pluginNamespaceDomain for .bit and .tor (hardcoded) and a private method for others (.com, etc).
May be upgraded to use the pluginDNS instead and fallback to the private method if no handler found (I'm not sure yet it should be done like that).
I hope you have a better view with this.
Do not hesitate to ask more infos :p