Control

The Kadence daemon can be controlled by another process on the same host or remotely via socket connection. By default, the daemon is configured to listen on a UNIX domain socket located at $HOME/.config/kadence/kadence.sock. Once connected to the daemon, you may send it control commands to build networks in other languages. The controller understands newline terminated JSON-RPC 2.0 payloads.

Constructor

new Control(node)

Parameters:
NameTypeDescription
nodeKademliaNode

Methods

getProtocolInfo(callback)

Returns basic informations about the running node

Parameters:
NameTypeDescription
callbackControl~getProtocolInfoCallback

listMethods(callback)

Returns a list of the support methods from the controller

Parameters:
NameTypeDescription
callbackControl~listMethodsCallback

Type Definitions

getProtocolInfoCallback(error, info)

Parameters:
NameTypeDescription
errorerror | null
infoobject
Properties
NameTypeDescription
versionsobject
Properties
NameTypeDescription
softwarestring
protocolstring
identitystring
contactobject
peersArray.<array>

listMethodsCallback(error, methods)

Parameters:
NameTypeDescription
errorerror | null
methodsArray.<object>
Properties
NameTypeDescription
methodstring
paramsArray.<string>