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
db3b915a
Commit
db3b915a
authored
Mar 28, 2018
by
Lars Gierth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: remove mentions of coral, it's not implemented
parent
25416c3d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
5 deletions
+8
-5
dht.go
dht.go
+2
-2
dht_bootstrap.go
dht_bootstrap.go
+1
-1
pb/dht.pb.go
pb/dht.pb.go
+1
-0
pb/dht.proto
pb/dht.proto
+1
-0
routing.go
routing.go
+3
-2
No files found.
dht.go
View file @
db3b915a
// Package dht implements a distributed hash table that satisfies the ipfs routing
// interface. This DHT is modeled after kademlia with
Coral and
S/Kademlia modifications.
// interface. This DHT is modeled after kademlia with S/Kademlia modifications.
package
dht
import
(
...
...
@@ -40,7 +40,7 @@ var ProtocolDHTOld protocol.ID = "/ipfs/dht"
// collect members of the routing table.
const
NumBootstrapQueries
=
5
// IpfsDHT is an implementation of Kademlia with
Coral and
S/Kademlia modifications.
// IpfsDHT is an implementation of Kademlia with S/Kademlia modifications.
// It is used to implement the base IpfsRouting module.
type
IpfsDHT
struct
{
host
host
.
Host
// the network services we need
...
...
dht_bootstrap.go
View file @
db3b915a
// Package dht implements a distributed hash table that satisfies the ipfs routing
// interface. This DHT is modeled after
k
ademlia with
Coral and
S/Kademlia modifications.
// interface. This DHT is modeled after
K
ademlia with S/Kademlia modifications.
package
dht
import
(
...
...
pb/dht.pb.go
View file @
db3b915a
...
...
@@ -116,6 +116,7 @@ type Message struct {
// defines what type of message it is.
Type
*
Message_MessageType
`protobuf:"varint,1,opt,name=type,enum=dht.pb.Message_MessageType" json:"type,omitempty"`
// defines what coral cluster level this query/response belongs to.
// in case we want to implement coral's cluster rings in the future.
ClusterLevelRaw
*
int32
`protobuf:"varint,10,opt,name=clusterLevelRaw" json:"clusterLevelRaw,omitempty"`
// Used to specify the key associated with this message.
// PUT_VALUE, GET_VALUE, ADD_PROVIDER, GET_PROVIDERS
...
...
pb/dht.proto
View file @
db3b915a
...
...
@@ -50,6 +50,7 @@ message Message {
optional
MessageType
type
=
1
;
// defines what coral cluster level this query/response belongs to.
// in case we want to implement coral's cluster rings in the future.
optional
int32
clusterLevelRaw
=
10
;
// Used to specify the key associated with this message.
...
...
routing.go
View file @
db3b915a
...
...
@@ -246,8 +246,9 @@ func (dht *IpfsDHT) GetValues(ctx context.Context, key string, nvals int) (_ []r
return
vals
,
nil
}
// Value provider layer of indirection.
// This is what DSHTs (Coral and MainlineDHT) do to store large values in a DHT.
// Provider abstraction for indirect stores.
// Some DHTs store values directly, while an indirect store stores pointers to
// locations of the value, similarly to Coral and Mainline DHT.
// Provide makes this node announce that it can provide a value for the given key
func
(
dht
*
IpfsDHT
)
Provide
(
ctx
context
.
Context
,
key
*
cid
.
Cid
,
brdcst
bool
)
(
err
error
)
{
...
...
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