Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
caeecd0f
Commit
caeecd0f
authored
Sep 14, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting to integrate new net
parent
9f04d5e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
dht.go
dht.go
+2
-6
dht_test.go
dht_test.go
+3
-3
No files found.
dht.go
View file @
caeecd0f
...
...
@@ -7,7 +7,7 @@ import (
"sync"
"time"
swarm
"github.com/jbenet/go-ipfs/net
/swarm
"
inet
"github.com/jbenet/go-ipfs/net"
peer
"github.com/jbenet/go-ipfs/peer"
kb
"github.com/jbenet/go-ipfs/routing/kbucket"
u
"github.com/jbenet/go-ipfs/util"
...
...
@@ -28,8 +28,7 @@ type IpfsDHT struct {
// NOTE: (currently, only a single table is used)
routingTables
[]
*
kb
.
RoutingTable
network
swarm
.
Network
netChan
*
swarm
.
Chan
network
inet
.
Network
// Local peer (yourself)
self
*
peer
.
Peer
...
...
@@ -48,9 +47,6 @@ type IpfsDHT struct {
//lock to make diagnostics work better
diaglock
sync
.
Mutex
// listener is a server to register to listen for responses to messages
listener
*
swarm
.
MessageListener
}
// NewDHT creates a new DHT object with the given peer as the 'local' host
...
...
dht_test.go
View file @
caeecd0f
...
...
@@ -6,7 +6,7 @@ import (
ds
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
ci
"github.com/jbenet/go-ipfs/crypto"
identify
"github.com/jbenet/go-ipfs/
identify
"
spipe
"github.com/jbenet/go-ipfs/
crypto/spipe
"
swarm
"github.com/jbenet/go-ipfs/net/swarm"
peer
"github.com/jbenet/go-ipfs/peer"
u
"github.com/jbenet/go-ipfs/util"
...
...
@@ -36,7 +36,7 @@ func setupDHTS(n int, t *testing.T) ([]*ma.Multiaddr, []*peer.Peer, []*IpfsDHT)
}
p
.
PubKey
=
pk
p
.
PrivKey
=
sk
id
,
err
:=
identify
.
IDFromPubKey
(
pk
)
id
,
err
:=
spipe
.
IDFromPubKey
(
pk
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
@@ -68,7 +68,7 @@ func makePeer(addr *ma.Multiaddr) *peer.Peer {
}
p
.
PrivKey
=
sk
p
.
PubKey
=
pk
id
,
err
:=
identify
.
IDFromPubKey
(
pk
)
id
,
err
:=
spipe
.
IDFromPubKey
(
pk
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment