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

devp2p-dpt

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devp2p-dpt - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

docs/index.md

@@ -31,4 +31,3 @@ # DPT

binds the upd socket to `this.udpPort` and `this.address`. This is called
automatically by the constuctor.
Binds the upd socket to `this.udpPort` and `this.address`.

@@ -35,0 +34,0 @@ ## bootStrap

@@ -11,4 +11,6 @@ const DHT = require('../index.js')

dht.bind()
dht.on('message', function () {
console.log('get message')
})

@@ -11,2 +11,3 @@ const DHT = require('../index.js')

dht.bind()
console.log('id: ' + dht.id.toString('hex'))

@@ -13,0 +14,0 @@

@@ -11,2 +11,4 @@ const DHT = require('../index.js')

dht.bind()
dht.socket.on('message', function (msg, rinfo) {

@@ -13,0 +15,0 @@ console.log('server got msg from ' + rinfo.address + ':' + rinfo.port)

@@ -118,3 +118,3 @@ // Implements ethereum's DPT

this.secKey = opts.secretKey
this.publicAddress = opts.publicAddress || opts.address
this.publicAddress = opts.publicAddress || opts.address || '0.0.0.0'
this.address = opts.address || opts.publicAddress

@@ -147,4 +147,2 @@ this.publicUdpPort = opts.publicUdpPort || opts.udpPort || opts.port

dhtLogic(this)
// bind udp socket
this.bind()
}

@@ -155,8 +153,18 @@

/**
* binds the upd socket to `this.udpPort` and `this.address`. This is called
* automatically by the constuctor.
* binds the upd socket to `this.udpPort` and `this.address`.
* @method bind
*/
DPT.prototype.bind = function () {
this.socket.bind({port: this.udpPort, address: this.address})
DPT.prototype.bind = function (port, address) {
this.address = address = address || this.address
this.udpPort = port = port || this.udpPort
if (!this.publicUdpPort) {
this.publicUdpPort = this.udpPort
}
if (!this.tcpPort) {
this.tcpPort = this.udpPort
}
this.socket.bind({port: port, address: address})
}

@@ -163,0 +171,0 @@

{
"name": "devp2p-dpt",
"version": "1.0.0",
"version": "1.0.1",
"description": "an implemention of ethereum's DHT",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -32,2 +32,4 @@ const tape = require('tape')

dht.bind()
var dht2 = new DHT({

@@ -39,2 +41,4 @@ port: port + 1,

dht2.bind()
dht2.ping({

@@ -41,0 +45,0 @@ port: port,

@@ -13,2 +13,3 @@ var tape = require('tape')

})
dht.bind()

@@ -15,0 +16,0 @@ cb(null, dht)

@@ -17,2 +17,3 @@ const tape = require('tape')

})
dht.bind()
nodes.push(dht)

@@ -19,0 +20,0 @@ }

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