Skip to content

Interacting with Instances at Runtime

Zachary Boyd edited this page Sep 13, 2018 · 1 revision

You can retrieve or set the configuration of instances while they're running via the Tor Control Protocol.

The example below will change the "MaxCircuitDirtiness" value for the first instance in the pool

Example:

let rpcRequest = {
	"method": "setInstanceConfigAt",
	"params": [0, "MaxCircuitDirtiness", "20"], 
	"jsonrpc":"2.0", 
	"id": 1
};
client.write(JSON.stringify(rpcRequest));

You can also send signals directly to instances or to all instances in the pool via the control protocol. A list of all signals can be found here

The example below will set the log level of all instances to "debug".

Example:

let rpcRequest = {
	"method": "signalAllInstances",
	"params": ["DEBUG"], 
	"jsonrpc":"2.0", 
	"id": 1
};
client.write(JSON.stringify(rpcRequest));
Clone this wiki locally