Capitalized DHT
License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Richard Littauer committed
Feb 18, 2016 at 17:39 UTC
ac42bb793207597b87bea499aa21762617679ea7
8 files changed
+14
-14
README.md
+1
-1
@@ -158,7 +158,7 @@ USAGE:
158
id Show info about ipfs peers
159
bootstrap Add or remove bootstrap peers
160
swarm Manage connections to the p2p network
161
- dht Query the dht for values or peers
161
+ dht Query the DHT for values or peers
162
ping Measure the latency of a connection
163
diag Print diagnostics
164
core/commands/dht.go
+2
-2
@@ -319,7 +319,7 @@ var getValueDhtCmd = &cmds.Command{
319
Helptext: cmds.HelpText{
320
Tagline: "Run a 'GetValue' query through the DHT.",
321
ShortDescription: `
322
-GetValue will return the value stored in the dht at the given key.
322
+GetValue will return the value stored in the DHT at the given key.
323
`,
324
},
325
@@ -422,7 +422,7 @@ var putValueDhtCmd = &cmds.Command{
422
Helptext: cmds.HelpText{
423
Tagline: "Run a 'PutValue' query through the DHT.",
424
ShortDescription: `
425
-PutValue will store the given key value pair in the dht.
425
+PutValue will store the given key value pair in the DHT.
426
`,
427
},
428
core/commands/root.go
+1
-1
@@ -59,7 +59,7 @@ NETWORK COMMANDS
59
id Show info about ipfs peers
60
bootstrap Add or remove bootstrap peers
61
swarm Manage connections to the p2p network
62
- dht Query the dht for values or peers
62
+ dht Query the DHT for values or peers
63
ping Measure the latency of a connection
64
diag Print diagnostics
65
dev.md
+1
-1
@@ -16,7 +16,7 @@ There are multiple subpackages:
16
- `path` - path resolution over merkledag data structure
17
- `peer` - identity + addresses of local and remote peers
18
- `routing` - the routing system
19
-- `routing/dht` - the dht default routing system implementation
19
+- `routing/dht` - the DHT default routing system implementation
20
- `swarm` - connection multiplexing, many peers and many transports
21
- `util` - various utilities
22
routing/dht/dht_net.go
+2
-2
@@ -70,7 +70,7 @@ func (dht *IpfsDHT) handleNewMessage(s inet.Stream) {
70
// measure the RTT for latency measurements.
71
func (dht *IpfsDHT) sendRequest(ctx context.Context, p peer.ID, pmes *pb.Message) (*pb.Message, error) {
72
73
- log.Debugf("%s dht starting stream", dht.self)
73
+ log.Debugf("%s DHT starting stream", dht.self)
74
s, err := dht.host.NewStream(ctx, ProtocolDHT, p)
75
if err != nil {
76
return nil, err
@@ -108,7 +108,7 @@ func (dht *IpfsDHT) sendRequest(ctx context.Context, p peer.ID, pmes *pb.Message
108
// sendMessage sends out a message
109
func (dht *IpfsDHT) sendMessage(ctx context.Context, p peer.ID, pmes *pb.Message) error {
110
111
- log.Debugf("%s dht starting stream", dht.self)
111
+ log.Debugf("%s DHT starting stream", dht.self)
112
s, err := dht.host.NewStream(ctx, ProtocolDHT, p)
113
if err != nil {
114
return err
routing/dht/dht_test.go
+2
-2
@@ -93,7 +93,7 @@ func connect(t *testing.T, ctx context.Context, a, b *IpfsDHT) {
93
func bootstrap(t *testing.T, ctx context.Context, dhts []*IpfsDHT) {
94
95
ctx, cancel := context.WithCancel(ctx)
96
- log.Debugf("bootstrapping dhts...")
96
+ log.Debugf("Bootstrapping DHTs...")
97
98
// tried async. sequential fares much better. compare:
99
// 100 async https://gist.github.com/jbenet/56d12f0578d5f34810b2
@@ -391,7 +391,7 @@ func TestPeriodicBootstrap(t *testing.T) {
391
connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)])
392
}
393
394
- t.Logf("dhts are now connected to 1-2 others.", nDHTs)
394
+ t.Logf("DHTs are now connected to 1-2 others.", nDHTs)
395
for _, dht := range dhts {
396
rtlen := dht.routingTable.Size()
397
if rtlen > 2 {
routing/dht/handlers.go
+1
-1
@@ -106,7 +106,7 @@ func (dht *IpfsDHT) checkLocalDatastore(k key.Key) (*pb.Record, error) {
106
rec := new(pb.Record)
107
err = proto.Unmarshal(byts, rec)
108
if err != nil {
109
- log.Debug("Failed to unmarshal dht record from datastore")
109
+ log.Debug("Failed to unmarshal DHT record from datastore.")
110
return nil, err
111
}
112
routing/dht/records.go
+4
-4
@@ -42,7 +42,7 @@ func (dht *IpfsDHT) GetPublicKey(ctx context.Context, p peer.ID) (ci.PubKey, err
42
}
43
44
// last ditch effort: let's try the dht.
45
- log.Debugf("pk for %s not in peerstore, and peer failed. trying dht.", p)
45
+ log.Debugf("pk for %s not in peerstore, and peer failed. Trying DHT.", p)
46
pkkey := routing.KeyForPublicKey(p)
47
48
val, err := dht.GetValue(ctxT, pkkey)
@@ -77,14 +77,14 @@ func (dht *IpfsDHT) getPublicKeyFromNode(ctx context.Context, p peer.ID) (ci.Pub
77
// node doesn't have key :(
78
record := pmes.GetRecord()
79
if record == nil {
80
- return nil, fmt.Errorf("node not responding with its public key: %s", p)
80
+ return nil, fmt.Errorf("Node not responding with its public key: %s", p)
81
}
82
83
// Success! We were given the value. we don't need to check
84
// validity because a) we can't. b) we know the hash of the
85
// key we're looking for.
86
val := record.GetValue()
87
- log.Debug("dht got a value from other peer.")
87
+ log.Debug("DHT got a value from other peer.")
88
89
pk, err = ci.UnmarshalPublicKey(val)
90
if err != nil {
@@ -100,7 +100,7 @@ func (dht *IpfsDHT) getPublicKeyFromNode(ctx context.Context, p peer.ID) (ci.Pub
100
}
101
102
// ok! it's valid. we got it!
103
- log.Debugf("dht got public key from node itself.")
103
+ log.Debugf("DHT got public key from node itself.")
104
return pk, nil
105
}
106