How-to: using Python XMLRPC scripts to access the DHT
From BoykinWiki
Brunet DHT provides XMLRPC services for accesses from outside .NET code, such as Python scripts.
To use Python to access DHT services, you need to have Python installed on your computer. Most Linux distributions have Python installed.
In our current implementation, if you start SimpleNode with the <RpcDht> element enabled and port properly set in the config file, a .NET Remoting service will start at <localhost:port> and the link to the XmlRpc service would be:
http://localhost:port/xd.rem
You can use this url in your Python code:
import xmlrpclib
URL = "http://127.0.0.1:64221/xm.rem"
dht = xmlrpclib.Server(URL)
and then you can easily use the Brunet DHT API to do Puts, Creates and Gets.
Example:
# Get values with key "k1"
results = dht.Get("k1")
# Get the 1st entry, of course, if the returned array isn't empty
first = result[0]
# Get its value string
value_string = first[valueString]
