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
dms3
go-dms3-routing
Commits
f9018750
Commit
f9018750
authored
Nov 10, 2014
by
Jeromy
Committed by
Juan Batiz-Benet
Nov 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validator functions and ipns completion
parent
08fbaadb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
dht/dht.go
dht/dht.go
+3
-0
dht/records.go
dht/records.go
+10
-0
No files found.
dht/dht.go
View file @
f9018750
...
...
@@ -84,7 +84,10 @@ func NewDHT(ctx context.Context, p peer.Peer, ps peer.Peerstore, dialer inet.Dia
dht
.
routingTables
[
1
]
=
kb
.
NewRoutingTable
(
20
,
kb
.
ConvertPeerID
(
p
.
ID
()),
time
.
Millisecond
*
1000
)
dht
.
routingTables
[
2
]
=
kb
.
NewRoutingTable
(
20
,
kb
.
ConvertPeerID
(
p
.
ID
()),
time
.
Hour
)
dht
.
birth
=
time
.
Now
()
dht
.
Validators
=
make
(
map
[
string
]
ValidatorFunc
)
dht
.
Validators
[
"ipns"
]
=
ValidateIpnsRecord
dht
.
Validators
[
"pk"
]
=
ValidatePublicKeyRecord
if
doPinging
{
dht
.
Children
()
.
Add
(
1
)
...
...
dht/records.go
View file @
f9018750
...
...
@@ -69,3 +69,13 @@ func (dht *IpfsDHT) verifyRecord(r *pb.Record) error {
return
fnc
(
u
.
Key
(
r
.
GetKey
()),
r
.
GetValue
())
}
func
ValidateIpnsRecord
(
k
u
.
Key
,
val
[]
byte
)
error
{
// TODO:
return
nil
}
func
ValidatePublicKeyRecord
(
k
u
.
Key
,
val
[]
byte
)
error
{
// TODO:
return
nil
}
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