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
f3ea01e9
Commit
f3ea01e9
authored
Aug 22, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update deps for libp2p 3.4.0
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
25bfef8d
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
34 additions
and
33 deletions
+34
-33
bitswap.go
bitswap.go
+2
-2
bitswap_test.go
bitswap_test.go
+1
-1
decision/bench_test.go
decision/bench_test.go
+1
-1
decision/engine.go
decision/engine.go
+2
-2
decision/engine_test.go
decision/engine_test.go
+3
-3
decision/ledger.go
decision/ledger.go
+1
-1
decision/peer_request_queue.go
decision/peer_request_queue.go
+1
-1
message/message.go
message/message.go
+1
-1
network/interface.go
network/interface.go
+2
-2
network/ipfs_impl.go
network/ipfs_impl.go
+7
-6
testnet/interface.go
testnet/interface.go
+1
-1
testnet/network_test.go
testnet/network_test.go
+1
-1
testnet/peernet.go
testnet/peernet.go
+3
-3
testnet/virtual.go
testnet/virtual.go
+1
-1
testutils.go
testutils.go
+4
-4
wantmanager.go
wantmanager.go
+1
-1
workers.go
workers.go
+2
-2
No files found.
bitswap.go
View file @
f3ea01e9
...
...
@@ -8,10 +8,10 @@ import (
"sync"
"time"
logging
"gx/ipfs/QmNQynaz7qfriSUJkiEZUrm2Wen1u3Kj9goZzWtrPyu7XR/go-log"
process
"gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess"
procctx
"gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context"
peer
"gx/ipfs/QmRBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs/go-libp2p-peer"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
peer
"gx/ipfs/QmWtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
blocks
"github.com/ipfs/go-ipfs/blocks"
...
...
bitswap_test.go
View file @
f3ea01e9
...
...
@@ -17,7 +17,7 @@ import (
tn
"github.com/ipfs/go-ipfs/exchange/bitswap/testnet"
mockrouting
"github.com/ipfs/go-ipfs/routing/mock"
delay
"github.com/ipfs/go-ipfs/thirdparty/delay"
p2ptestutil
"gx/ipfs/Qm
VCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms
/go-libp2p/p2p/test/util"
p2ptestutil
"gx/ipfs/Qm
f4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS
/go-libp2p/p2p/test/util"
)
// FIXME the tests are really sensitive to the network delay. fix them to work
...
...
decision/bench_test.go
View file @
f3ea01e9
...
...
@@ -7,7 +7,7 @@ import (
key
"github.com/ipfs/go-ipfs/blocks/key"
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
"github.com/ipfs/go-ipfs/thirdparty/testutil"
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
)
// FWIW: At the time of this commit, including a timestamp in task increases
...
...
decision/engine.go
View file @
f3ea01e9
...
...
@@ -9,8 +9,8 @@ import (
bstore
"github.com/ipfs/go-ipfs/blocks/blockstore"
bsmsg
"github.com/ipfs/go-ipfs/exchange/bitswap/message"
wl
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
logging
"gx/ipfs/Qm
NQynaz7qfriSUJkiEZUrm2Wen1u3Kj9goZzWtrPyu7XR
/go-log"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
logging
"gx/ipfs/Qm
SpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52
/go-log"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)
...
...
decision/engine_test.go
View file @
f3ea01e9
...
...
@@ -12,9 +12,9 @@ import (
blockstore
"github.com/ipfs/go-ipfs/blocks/blockstore"
message
"github.com/ipfs/go-ipfs/exchange/bitswap/message"
testutil
"github.com/ipfs/go-ipfs/thirdparty/testutil"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs/go-libp2p-peer
"
ds
"gx/ipfs/Qm
TxLSvdhwg68WJimdS6icLPhZi28aTp6b7uihC2Yb47Xk
/go-datastore"
dssync
"gx/ipfs/Qm
TxLSvdhwg68WJimdS6icLPhZi28aTp6b7uihC2Yb47Xk/go-datastore/sync
"
ds
"gx/ipfs/Qm
NgqJarToRiq2GBaPJhkmW4B5BxS5B74E1rkGvv2JoaTp/go-datastore
"
ds
sync
"gx/ipfs/Qm
NgqJarToRiq2GBaPJhkmW4B5BxS5B74E1rkGvv2JoaTp
/go-datastore
/sync
"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8/go-libp2p-peer
"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)
...
...
decision/ledger.go
View file @
f3ea01e9
...
...
@@ -6,7 +6,7 @@ import (
key
"github.com/ipfs/go-ipfs/blocks/key"
wl
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
)
// keySet is just a convenient alias for maps of keys, where we only care
...
...
decision/peer_request_queue.go
View file @
f3ea01e9
...
...
@@ -7,7 +7,7 @@ import (
key
"github.com/ipfs/go-ipfs/blocks/key"
wantlist
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
pq
"github.com/ipfs/go-ipfs/thirdparty/pq"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
)
type
peerRequestQueue
interface
{
...
...
message/message.go
View file @
f3ea01e9
...
...
@@ -7,7 +7,7 @@ import (
key
"github.com/ipfs/go-ipfs/blocks/key"
pb
"github.com/ipfs/go-ipfs/exchange/bitswap/message/pb"
wantlist
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
inet
"gx/ipfs/Qm
VCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms
/go-libp2p/p2p/net"
inet
"gx/ipfs/Qm
f4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS
/go-libp2p/p2p/net"
ggio
"gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io"
proto
"gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto"
...
...
network/interface.go
View file @
f3ea01e9
...
...
@@ -3,9 +3,9 @@ package network
import
(
key
"github.com/ipfs/go-ipfs/blocks/key"
bsmsg
"github.com/ipfs/go-ipfs/exchange/bitswap/message"
peer
"gx/ipfs/QmRBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs/go-libp2p-peer"
protocol
"gx/ipfs/QmVCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms/go-libp2p/p2p/protocol"
peer
"gx/ipfs/QmWtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
protocol
"gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/protocol"
)
var
ProtocolBitswap
protocol
.
ID
=
"/ipfs/bitswap"
...
...
network/ipfs_impl.go
View file @
f3ea01e9
...
...
@@ -7,14 +7,14 @@ import (
bsmsg
"github.com/ipfs/go-ipfs/exchange/bitswap/message"
routing
"github.com/ipfs/go-ipfs/routing"
logging
"gx/ipfs/QmNQynaz7qfriSUJkiEZUrm2Wen1u3Kj9goZzWtrPyu7XR/go-log"
pstore
"gx/ipfs/QmQdnfvZQuhdT93LNc5bos52wAmdr3G2p6G8teLJMEN32P/go-libp2p-peerstore"
peer
"gx/ipfs/QmRBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs/go-libp2p-peer"
host
"gx/ipfs/QmVCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms/go-libp2p/p2p/host"
inet
"gx/ipfs/QmVCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms/go-libp2p/p2p/net"
pstore
"gx/ipfs/QmSZi9ygLohBUGyHMqE5N6eToPwqcg7bZQTULeVLFu7Q6d/go-libp2p-peerstore"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
peer
"gx/ipfs/QmWtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8/go-libp2p-peer"
ma
"gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr"
ggio
"gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
host
"gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/host"
inet
"gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/net"
)
var
log
=
logging
.
Logger
(
"bitswap_network"
)
...
...
@@ -26,6 +26,7 @@ func NewFromIpfsHost(host host.Host, r routing.ContentRouting) BitSwapNetwork {
routing
:
r
,
}
host
.
SetStreamHandler
(
ProtocolBitswap
,
bitswapNetwork
.
handleNewStream
)
host
.
SetStreamHandler
(
"/bitswap/1.0.0"
,
bitswapNetwork
.
handleNewStream
)
host
.
Network
()
.
Notify
((
*
netNotifiee
)(
&
bitswapNetwork
))
// TODO: StopNotify.
...
...
@@ -72,7 +73,7 @@ func (bsnet *impl) newStreamToPeer(ctx context.Context, p peer.ID) (inet.Stream,
return
nil
,
err
}
return
bsnet
.
host
.
NewStream
(
ctx
,
ProtocolBitswap
,
p
)
return
bsnet
.
host
.
NewStream
(
ctx
,
p
,
"/bitswap/1.0.0"
,
ProtocolBitswap
)
}
func
(
bsnet
*
impl
)
SendMessage
(
...
...
testnet/interface.go
View file @
f3ea01e9
...
...
@@ -3,7 +3,7 @@ package bitswap
import
(
bsnet
"github.com/ipfs/go-ipfs/exchange/bitswap/network"
"github.com/ipfs/go-ipfs/thirdparty/testutil"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
)
type
Network
interface
{
...
...
testnet/network_test.go
View file @
f3ea01e9
...
...
@@ -10,7 +10,7 @@ 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"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)
...
...
testnet/peernet.go
View file @
f3ea01e9
...
...
@@ -4,10 +4,10 @@ import (
bsnet
"github.com/ipfs/go-ipfs/exchange/bitswap/network"
mockrouting
"github.com/ipfs/go-ipfs/routing/mock"
testutil
"github.com/ipfs/go-ipfs/thirdparty/testutil"
peer
"gx/ipfs/QmRBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs/go-libp2p-peer"
ds
"gx/ipfs/QmTxLSvdhwg68WJimdS6icLPhZi28aTp6b7uihC2Yb47Xk/go-datastore"
mockpeernet
"gx/ipfs/QmVCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms/go-libp2p/p2p/net/mock"
ds
"gx/ipfs/QmNgqJarToRiq2GBaPJhkmW4B5BxS5B74E1rkGvv2JoaTp/go-datastore"
peer
"gx/ipfs/QmWtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
mockpeernet
"gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/net/mock"
)
type
peernet
struct
{
...
...
testnet/virtual.go
View file @
f3ea01e9
...
...
@@ -10,7 +10,7 @@ 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"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)
...
...
testutils.go
View file @
f3ea01e9
...
...
@@ -8,11 +8,11 @@ import (
datastore2
"github.com/ipfs/go-ipfs/thirdparty/datastore2"
delay
"github.com/ipfs/go-ipfs/thirdparty/delay"
testutil
"github.com/ipfs/go-ipfs/thirdparty/testutil"
peer
"gx/ipfs/QmRBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs/go-libp2p-peer"
ds
"gx/ipfs/QmTxLSvdhwg68WJimdS6icLPhZi28aTp6b7uihC2Yb47Xk/go-datastore"
ds_sync
"gx/ipfs/QmTxLSvdhwg68WJimdS6icLPhZi28aTp6b7uihC2Yb47Xk/go-datastore/sync"
p2ptestutil
"gx/ipfs/QmVCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms/go-libp2p/p2p/test/util"
ds
"gx/ipfs/QmNgqJarToRiq2GBaPJhkmW4B5BxS5B74E1rkGvv2JoaTp/go-datastore"
ds_sync
"gx/ipfs/QmNgqJarToRiq2GBaPJhkmW4B5BxS5B74E1rkGvv2JoaTp/go-datastore/sync"
peer
"gx/ipfs/QmWtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
p2ptestutil
"gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/test/util"
)
// WARNING: this uses RandTestBogusIdentity DO NOT USE for NON TESTS!
...
...
wantmanager.go
View file @
f3ea01e9
...
...
@@ -9,7 +9,7 @@ import (
bsmsg
"github.com/ipfs/go-ipfs/exchange/bitswap/message"
bsnet
"github.com/ipfs/go-ipfs/exchange/bitswap/network"
wantlist
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
context
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)
...
...
workers.go
View file @
f3ea01e9
...
...
@@ -10,8 +10,8 @@ import (
key
"github.com/ipfs/go-ipfs/blocks/key"
wantlist
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
logging
"gx/ipfs/Qm
NQynaz7qfriSUJkiEZUrm2Wen1u3Kj9goZzWtrPyu7XR
/go-log"
peer
"gx/ipfs/Qm
RBqJF7hb8ZSpRcMwUt8hNhydWcxGEhtk81HKq6oUwKvs
/go-libp2p-peer"
logging
"gx/ipfs/Qm
SpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52
/go-log"
peer
"gx/ipfs/Qm
WtbQU15LaB5B1JC2F7TV9P4K88vD3PpA4AJrwfCjhML8
/go-libp2p-peer"
)
var
TaskWorkerCount
=
8
...
...
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