Brunet XML-RPC API

From BoykinWiki

Jump to: navigation, search

Brunet XML-RPC API exposes Brunet-RPC written in C# to the outside world. It serves as a proxy that acts between the XML-RPC client and Brunet-RPC module.

API in C#

//a generic interface
object[] proxy(string node, int ahOptions, int maxResultsToWait, string method, params object[] args)
//interface that should be accessed only by local clients
object localproxy(string method, params object[] args)

The generic interface has 5 arguments:

  • node is a 20-byte string representation of Brunet node address. You use it to tell XmlRpcManager that where to send the RPC call
  • ahOptions: AHPacket.AHOptions, see Brunet API reference for detailed explanation.
  • maxResultToWait: When the synchronous call gets this amount of items, it returns even if there are still more to come (unless this argument is specified as a negative number).
  • method: name of the Brunet-RPC method that you want to call
  • args: arguments of the target Brunet-RPC method (optional for methods that don't have arguments)

The local interface uses predefined values for the first 3 arguments in the above arg-list so that you can only reach the local node, you don't need the ahOptions and the method returns when the first value comes in. In this case you only need to specify the method name on the local Brunet-RPC module and the arguments that you want you pass

External Links