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-bitswap
Commits
6c43bada
Commit
6c43bada
authored
May 16, 2017
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to dht code with provide announce option
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
775dd78f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
bitswap_test.go
bitswap_test.go
+1
-1
network/ipfs_impl.go
network/ipfs_impl.go
+2
-2
testnet/virtual.go
testnet/virtual.go
+2
-2
No files found.
bitswap_test.go
View file @
6c43bada
...
...
@@ -53,7 +53,7 @@ func TestProviderForKeyButNetworkCannotFind(t *testing.T) { // TODO revisit this
block
:=
blocks
.
NewBlock
([]
byte
(
"block"
))
pinfo
:=
p2ptestutil
.
RandTestBogusIdentityOrFatal
(
t
)
rs
.
Client
(
pinfo
)
.
Provide
(
context
.
Background
(),
block
.
Cid
())
// but not on network
rs
.
Client
(
pinfo
)
.
Provide
(
context
.
Background
(),
block
.
Cid
()
,
true
)
// but not on network
solo
:=
g
.
Next
()
defer
solo
.
Exchange
.
Close
()
...
...
network/ipfs_impl.go
View file @
6c43bada
...
...
@@ -11,9 +11,9 @@ import (
pstore
"gx/ipfs/QmNUVzEjq3XWJ89hegahPvyfJbTXgTaom48pLb7YBD9gHQ/go-libp2p-peerstore"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
inet
"gx/ipfs/QmVHSBsn8LEeay8m5ERebgUVuhzw838PsyTttCmP6GMJkg/go-libp2p-net"
routing
"gx/ipfs/QmXiH3yLocPhjkAmL8R29fKRcEKoVXKCaVDbAS9tdTrVEd/go-libp2p-routing"
cid
"gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid"
ggio
"gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io"
routing
"gx/ipfs/QmafuecpeZp3k3sHJ5mUARHd4795revuadECQMkmHB8LfW/go-libp2p-routing"
host
"gx/ipfs/QmcyNeWPsoFGxThGpV8JnJdfUNankKhWCTrbrcFRQda4xR/go-libp2p-host"
ma
"gx/ipfs/QmcyqRMCAXVtYPS4DiBrA7sezL9rRGfW8Ctx7cywL4TXJj/go-multiaddr"
peer
"gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer"
...
...
@@ -172,7 +172,7 @@ func (bsnet *impl) FindProvidersAsync(ctx context.Context, k *cid.Cid, max int)
// Provide provides the key to the network
func
(
bsnet
*
impl
)
Provide
(
ctx
context
.
Context
,
k
*
cid
.
Cid
)
error
{
return
bsnet
.
routing
.
Provide
(
ctx
,
k
)
return
bsnet
.
routing
.
Provide
(
ctx
,
k
,
true
)
}
// handleNewStream receives a new stream from the network.
...
...
testnet/virtual.go
View file @
6c43bada
...
...
@@ -9,8 +9,8 @@ import (
mockrouting
"github.com/ipfs/go-ipfs/routing/mock"
delay
"github.com/ipfs/go-ipfs/thirdparty/delay"
testutil
"github.com/ipfs/go-ipfs/thirdparty/testutil"
routing
"gx/ipfs/QmXiH3yLocPhjkAmL8R29fKRcEKoVXKCaVDbAS9tdTrVEd/go-libp2p-routing"
cid
"gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid"
routing
"gx/ipfs/QmafuecpeZp3k3sHJ5mUARHd4795revuadECQMkmHB8LfW/go-libp2p-routing"
peer
"gx/ipfs/QmdS9KpbDyPrieswibZhkod1oXqRwZJrUPzxCofAMWpFGq/go-libp2p-peer"
)
...
...
@@ -138,7 +138,7 @@ func (n *networkClient) NewMessageSender(ctx context.Context, p peer.ID) (bsnet.
// Provide provides the key to the network
func
(
nc
*
networkClient
)
Provide
(
ctx
context
.
Context
,
k
*
cid
.
Cid
)
error
{
return
nc
.
routing
.
Provide
(
ctx
,
k
)
return
nc
.
routing
.
Provide
(
ctx
,
k
,
true
)
}
func
(
nc
*
networkClient
)
SetDelegate
(
r
bsnet
.
Receiver
)
{
...
...
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