Class: Control

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.

new Control(node)

Parameters:
Name Type Description
node KademliaNode
Source:

Methods


getProtocolInfo(callback)

Returns basic informations about the running node
Parameters:
Name Type Description
callback Control~getProtocolInfoCallback
Source:

getWalletBalance(callback)

Returns the local wallet balance
Parameters:
Name Type Description
callback Control~getWalletBalanceCallback
Source:

getWalletSolution(hexSolutionKey, callback)

Loads the local solution by it's key
Parameters:
Name Type Description
hexSolutionKey string
callback Control~getWalletSolutionCallback
Source:

getWalletSolutionKeys(callback)

Returns the complete list of solution keys
Parameters:
Name Type Description
callback Control~getWalletSolutionKeysCallback
Source:

listMethods(callback)

Returns a list of the support methods from the controller
Parameters:
Name Type Description
callback Control~listMethodsCallback
Source:

putWalletSolution(hexSolution, callback)

Inserts the solution into the wallet - overwriting existing versions of the same key
Parameters:
Name Type Description
hexSolution string
callback Control~putWalletSolutionCallback
Source:

signMessage(hexMessage, callback)

Signs the given message with the wallet private key
Parameters:
Name Type Description
hexMessage string
callback Control~signMessageCallback
Source:

transferWalletSolution(hexSolutionKey, hexPublickey, callback)

Transfers ownership of the solution to the supplied public key
Parameters:
Name Type Description
hexSolutionKey string
hexPublickey string
callback Control~transferWalletSolutionCallback
Source:

verifyMessage(hexMessage, hexSignature, hexPublickey, callback)

Verifies the signature for the given message and public key
Parameters:
Name Type Description
hexMessage string
hexSignature string
hexPublickey string
callback Control~verifyMessageCallback
Source:

Type Definitions


getProtocolInfoCallback(error, info)

Parameters:
Name Type Description
error error | null
info object
Properties
Name Type Description
versions object
Properties
Name Type Description
software string
protocol string
identity string
contact object
peers Array.<array>
Source:

getWalletBalanceCallback(error, balances)

Parameters:
Name Type Description
error error | null
balances object
Properties
Name Type Description
total number
Source:

getWalletSolutionCallback(error, hexSolution)

Parameters:
Name Type Description
error error | null
hexSolution string
Source:

getWalletSolutionKeysCallback(solutionsKeys)

Parameters:
Name Type Description
error | null
solutionsKeys Array.<string>
Source:

listMethodsCallback(error, methods)

Parameters:
Name Type Description
error error | null
methods Array.<object>
Properties
Name Type Description
method string
params Array.<string>
Source:

putWalletSolutionCallback(error)

Parameters:
Name Type Description
error error | null
Source:

signMessageCallback(error, result)

Parameters:
Name Type Description
error error | null
result object
Properties
Name Type Description
signature string
recovery number
Source:

transferWalletSolutionCallback(error)

Parameters:
Name Type Description
error error | null
Source: