Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kad-telemetry-js

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kad-telemetry-js

framework for analyzing network behavior and performance for kad

  • 0.1.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Kad Telemetry

Build Status Coverage Status NPM

Framework for analyzing network behavior and performance for Kad.

Installation

npm install kad-telemetry --save

Quick Start

Decorate your transport adapter.

// Import dependencies
var kad = require('kad');
var telemetry = require('kad-telemetry');

// Decorate your transport adapter
var TelemetryTransport = telemetry.TransportDecorator(kad.transports.UDP);

// Create your transport instance
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.

// Decorate the default router
var TelemetryRouter = telemetry.RouterDecorator(kad.Router);

// Create your router instance
var router = new TelemetryRouter({ transport: transport });

Then create your Kad node and party.

// Create your node
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);
// Example profile:
// This node has a ping of 54ms and has responded to 5 of 6 requests
//  { metrics: { latency: 54, availability: [6, 5] } }

Keywords

FAQs

Package last updated on 06 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc