[Mnet-devel] Ideas about xmlrpc_cp2pc__mnetext__getNodeInfo

icepick icepick at icepick.info
Wed May 5 05:54:16 BST 2004


>     # Neju's Extensions to the cp2pc standard.  If these work well
>     # on my system, I'll commit them to Mnet.  If Mnet folks like them,
>     # we should suggest adding the extensions to the cp2pc standard.
>                                                                                                       
>     def xmlrpc_cp2pc__mnetext__getNodeInfo(self):
>         """
>         struct {
>             string name;
>             string version;
>             string protocol;
>             string about;
>         } getNodeInfo();
>                                                                                                       
>         getNodeInfo() returns a structure containing strings which
>         describe the P2P Component.  This gives the user an idea of     
>         which component(s) are being used by the cp2pc application 
>         component.
>         """
>         return {'name': 'Mnet',
>                 'version': versionstr,
>                 'protocol': 'Mnet',
>                 'about': "Node ID: %r\n" %         
>                     (base32id.abbrev(self.node.mtm.get_id()),),
>                 }

I think this is some useful info to give to the GUI writers out there. 
I think that rather than added more API calls, we might be able to do 
the same thing thru the tristero interface and the "cp2pc:configuration" 
database.

I think this would work like this on the client end:

ss = xmlrpclib.Server(...)
resultToken = ss.tristero.search("cp2pc:node", # subject
                    "", # predicate,
                    "", # object
                    "cp2pc:configuration") #database
results = ss.tristero.fetch(resultToken)
rdfpprint(results) # pulling that function out of my ass for the moment,
                    # it's apparent that we're going to want it.

on the server end, we could populate the "cp2pc:configuration" database 
at startup and hardcode in some readonly values (like the above).  I'm 
not totally sure "cp2pc:configuration" is the best place for this 
readonly stuff.

You know, after writing that code snippet above, it's so complex that 
I'm not sure this is worth the trouble.  I want to use some standard p2p 
GUI interface, but at the same time I want something simple. Perhaps 
with some helper functions that could use the RDF schemas to turn stuff 
into human names and then into python dicts the simplicity will be there.

It would be nice if some other p2p software was already on the bandwagon 
with this and we could leverage their stuff, but people have been pretty 
strong in going their own ways.  I would like to make Mnet a test case 
for this API then submit patchs to other programs that use the
  * Freenet FCP
  * giFT xml scarry thing
  * mldonkey superscarry thing
  * ed2k core protocol
so that they use the easier to understand xmlrpc interface.

Another thing that has made this difficult is that the tristero and 
cp2pc try to hide their java roots, but aren't perfect at it (like 
should the tristero fetch call be "Tristero.Fetch.fetch" or 
"tristero.fetch".  It's not explict.)  Their documentation is not the 
most accessable to me, and if it's not to me it probably not to others 
either.

Anyway... back to new content tracker hacking

icepick





More information about the Mnet-devel mailing list