Last updated 6 years ago
Adding a correspondent
Params:
code - {string} - Pairing code
await core.addCorrespondent('ApM6ZzpMhnK87Qqz4LhkIHTxGA79VVTVqb1PmtrAzOzo@byteball.org/bb-test#O3IZDFeH4SR0');
biot-core addCorrespondent ApM6ZzpMhnK87Qqz4LhkIHTxGA79VVTVqb1PmtrAzOzo@byteball.org/bb-test#O3IZDFeH4SR0
client.request('addCorrespondent', ['ApM6ZzpMhnK87Qqz4LhkIHTxGA79VVTVqb1PmtrAzOzo@byteball.org/bb-test#O3IZDFeH4SR0'], (err, data) => { if(err) throw err; console.log(data); });
socket.send(JSON.stringify({ id: id++, name: 'addCorrespondent', args: ['ApM6ZzpMhnK87Qqz4LhkIHTxGA79VVTVqb1PmtrAzOzo@byteball.org/bb-test#O3IZDFeH4SR0'] }));
Removing a correspondent
device_address - {string} - Device address
await core.removeCorrespondent('0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD');
biot-core removeCorrespondent 0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD
client.request('removeCorrespondent', ['0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD'], (err, data) => { if(err) throw err; console.log(data); });
socket.send(JSON.stringify({ id: id++, name: 'removeCorrespondent', args: ['0WI73XY6WPR46D4ZKEQEFFQSSPBZMUOVD'] }));
List of correspondents
await core.listCorrespondents()
biot-core listCorrespondents
client.request('listCorrespondents', [], (err, data) => { if(err) throw err; console.log(data); });
socket.send(JSON.stringify({ id: id++, name: 'listCorrespondents', args: [] }));
[{ device_address: '0TFZHX7UTVQUWEPGLQDWEV5A4KLHFA5WB', hub: 'byteball.org/bb-test', name: 'Testnet Faucet', my_record_pref: 1, peer_record_pref: 1 }]