Correspondents

Adding a correspondent

Params:

code - {string} - Pairing code

JS module
CLI
RPC
WS
JS module
await core.addCorrespondent('[email protected]/bb-test#O3IZDFeH4SR0');
CLI
biot-core addCorrespondent [email protected]/bb-test#O3IZDFeH4SR0
RPC
client.request('addCorrespondent', ['[email protected]/bb-test#O3IZDFeH4SR0'], (err, data) => {
if(err)
throw err;
console.log(data);
});
WS
socket.send(JSON.stringify({
id: id++,
name: 'addCorrespondent',
args: ['[email protected]/bb-test#O3IZDFeH4SR0']
}));

Removing a correspondent

Params:

device_address - {string} - Device address

JS module
CLI
RPC
WS
JS module
await core.removeCorrespondent('0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD');
CLI
biot-core removeCorrespondent 0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD
RPC
client.request('removeCorrespondent', ['0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD'], (err, data) => {
if(err)
throw err;
console.log(data);
});
WS
socket.send(JSON.stringify({
id: id++,
name: 'removeCorrespondent',
args: ['0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD']
}));

List of correspondents

JS module
CLI
RPC
WS
Result
JS module
await core.listCorrespondents()
CLI
biot-core listCorrespondents
RPC
client.request('listCorrespondents', [], (err, data) => {
if(err)
throw err;
console.log(data);
});
WS
socket.send(JSON.stringify({
id: id++,
name: 'listCorrespondents',
args: []
}));
Result
[{ device_address: '0TFZHX7UTVQUWEPGLQDWEV5A4KLHFA5WB',
hub: 'byteball.org/bb-test',
name: 'Testnet Faucet',
my_record_pref: 1,
peer_record_pref: 1 }]