Kad Telemetry
Framework for analyzing network behavior and performance for
Kad.
Installation
npm install kad-telemetry --save
Quick Start
Decorate your
transport adapter.
var kad = require('kad');
var telemetry = require('kad-telemetry');
var TelemetryTransport = telemetry.TransportDecorator(kad.transports.UDP);
var transport = new TelemetryTransport(contact, {
telemetry: { filename: 'path/to/telemetry.data' }
});
You might also like to extend Kad's peer selection by scoring peers based on
the collected metrics by decorating your
router.
var TelemetryRouter = telemetry.RouterDecorator(kad.Router);
var router = new TelemetryRouter({ transport: transport });
Then create your Kad node and party.
var dht = new kad.Node({
router: router,
transport: transport,
storage: kad.storage.FS('...')
});
Once you have been connected to the network, you can lookup a node's profile.
transport.telemetry.getProfile(contact);