FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-devp2p-dpt/example/b.js at master · superstacked/node-devp2p-dpt · GitHub
superstacked
/
node-devp2p-dpt
Public
forked from
ethereumjs/node-devp2p-dpt
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node-devp2p-dpt
/
example
/
b.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (16 loc) · 447 Bytes
Breadcrumbs
node-devp2p-dpt
/
example
/
b.js
Copy path
File metadata and controls
20 lines (16 loc) · 447 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const
DHT
=
require
(
'../index.js'
)
const
port
=
30307
const
privateKey
=
new
Buffer
(
'18f9226f2b10bafffbe7fe2a864b220eade9f6b76b44b71925653089c581485e'
,
'hex'
)
var
dht
=
new
DHT
(
{
port
:
port
,
address
:
'0.0.0.0'
,
secretKey
:
privateKey
}
,
null
,
'should consturct'
)
console
.
log
(
'id: '
+
dht
.
id
.
toString
(
'hex'
)
)
dht
.
ping
(
{
port
:
30306
,
address
:
'0.0.0.0'
}
)
dht
.
on
(
'newPeer'
,
function
(
neighbors
,
peer
)
{
console
.
log
(
'new Node----'
)
}
)
Back
|
FazBrowse Home
|
New Git URL