Skip to content

Commit 7bd8191

Browse files
WIP: prepare update to go-libp2p v0.18.0
1 parent 6c6f368 commit 7bd8191

File tree

10 files changed

+84
-64
lines changed

10 files changed

+84
-64
lines changed

core/coreapi/test/api_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"testing"
1010

1111
"github.com/ipfs/go-filestore"
12-
"github.com/ipfs/go-ipfs-keystore"
12+
keystore "github.com/ipfs/go-ipfs-keystore"
1313
"github.com/ipfs/go-ipfs/core"
1414
"github.com/ipfs/go-ipfs/core/bootstrap"
1515
"github.com/ipfs/go-ipfs/core/coreapi"
@@ -19,20 +19,20 @@ import (
1919

2020
"github.com/ipfs/go-datastore"
2121
syncds "github.com/ipfs/go-datastore/sync"
22-
"github.com/ipfs/go-ipfs-config"
22+
config "github.com/ipfs/go-ipfs-config"
2323
coreiface "github.com/ipfs/interface-go-ipfs-core"
2424
"github.com/ipfs/interface-go-ipfs-core/tests"
2525
"github.com/libp2p/go-libp2p-core/crypto"
26-
peer "github.com/libp2p/go-libp2p-core/peer"
27-
"github.com/libp2p/go-libp2p/p2p/net/mock"
26+
"github.com/libp2p/go-libp2p-core/peer"
27+
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
2828
)
2929

3030
const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe"
3131

3232
type NodeProvider struct{}
3333

3434
func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]coreiface.CoreAPI, error) {
35-
mn := mocknet.New(ctx)
35+
mn := mocknet.New()
3636

3737
nodes := make([]*core.IpfsNode, n)
3838
apis := make([]coreiface.CoreAPI, n)

core/mock/mock.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ import (
2626

2727
// NewMockNode constructs an IpfsNode for use in tests.
2828
func NewMockNode() (*core.IpfsNode, error) {
29-
ctx := context.Background()
30-
3129
// effectively offline, only peer in its network
32-
return core.NewNode(ctx, &core.BuildCfg{
30+
return core.NewNode(context.Background(), &core.BuildCfg{
3331
Online: true,
34-
Host: MockHostOption(mocknet.New(ctx)),
32+
Host: MockHostOption(mocknet.New()),
3533
})
3634
}
3735

core/node/libp2p/smux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77

88
config "github.com/ipfs/go-ipfs-config"
99
"github.com/libp2p/go-libp2p"
10-
smux "github.com/libp2p/go-libp2p-core/mux"
10+
"github.com/libp2p/go-libp2p-core/network"
1111
mplex "github.com/libp2p/go-libp2p-mplex"
1212
yamux "github.com/libp2p/go-libp2p-yamux"
1313
)
1414

15-
func yamuxTransport() smux.Multiplexer {
15+
func yamuxTransport() network.Multiplexer {
1616
tpt := *yamux.DefaultTransport
1717
tpt.AcceptBacklog = 512
1818
if os.Getenv("YAMUX_DEBUG") != "" {

go.mod

+11-11
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,32 @@ require (
6666
github.com/jbenet/go-temp-err-catcher v0.1.0
6767
github.com/jbenet/goprocess v0.1.4
6868
github.com/libp2p/go-doh-resolver v0.3.1
69-
github.com/libp2p/go-libp2p v0.16.1-0.20211214061227-980033efd181
70-
github.com/libp2p/go-libp2p-connmgr v0.3.0
71-
github.com/libp2p/go-libp2p-core v0.13.0
69+
github.com/libp2p/go-libp2p v0.17.1-0.20220115114156-5f2d064604c1
70+
github.com/libp2p/go-libp2p-connmgr v0.3.2-0.20220115145817-a7820a5879c7
71+
github.com/libp2p/go-libp2p-core v0.13.1-0.20220114101623-6b8d8bf59647
7272
github.com/libp2p/go-libp2p-discovery v0.6.0
7373
github.com/libp2p/go-libp2p-http v0.2.1
7474
github.com/libp2p/go-libp2p-kad-dht v0.15.0
7575
github.com/libp2p/go-libp2p-kbucket v0.4.7
7676
github.com/libp2p/go-libp2p-loggables v0.1.0
77-
github.com/libp2p/go-libp2p-mplex v0.4.1
77+
github.com/libp2p/go-libp2p-mplex v0.4.2-0.20220113124821-8bd3fd12e637
7878
github.com/libp2p/go-libp2p-noise v0.3.0
7979
github.com/libp2p/go-libp2p-peerstore v0.6.0
8080
github.com/libp2p/go-libp2p-pubsub v0.6.0
8181
github.com/libp2p/go-libp2p-pubsub-router v0.5.0
82-
github.com/libp2p/go-libp2p-quic-transport v0.15.2
82+
github.com/libp2p/go-libp2p-quic-transport v0.15.1-0.20220115163217-d8ebfeffe1f5
8383
github.com/libp2p/go-libp2p-record v0.1.3
8484
github.com/libp2p/go-libp2p-routing-helpers v0.2.3
85-
github.com/libp2p/go-libp2p-swarm v0.9.0
86-
github.com/libp2p/go-libp2p-testing v0.6.0
85+
github.com/libp2p/go-libp2p-swarm v0.9.1-0.20220114122938-ef54b2f2246b
86+
github.com/libp2p/go-libp2p-testing v0.6.1-0.20220114111157-d4fb83f89618
8787
github.com/libp2p/go-libp2p-tls v0.3.1
88-
github.com/libp2p/go-libp2p-yamux v0.7.0
88+
github.com/libp2p/go-libp2p-yamux v0.7.1-0.20220113124110-6ee26a611de0
8989
github.com/libp2p/go-socket-activation v0.1.0
90-
github.com/libp2p/go-tcp-transport v0.4.0
91-
github.com/libp2p/go-ws-transport v0.5.0
90+
github.com/libp2p/go-tcp-transport v0.4.1-0.20220114115510-e760df1f0b84
91+
github.com/libp2p/go-ws-transport v0.5.1-0.20220104130611-c4b67dc94623
9292
github.com/miekg/dns v1.1.43
9393
github.com/mitchellh/go-homedir v1.1.0
94-
github.com/multiformats/go-multiaddr v0.4.1
94+
github.com/multiformats/go-multiaddr v0.5.0
9595
github.com/multiformats/go-multiaddr-dns v0.3.1
9696
github.com/multiformats/go-multibase v0.0.3
9797
github.com/multiformats/go-multicodec v0.3.0

go.sum

+53-31
Large diffs are not rendered by default.

test/integration/addcat_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
mock "github.com/ipfs/go-ipfs/core/mock"
1919
"github.com/ipfs/go-ipfs/thirdparty/unit"
2020
logging "github.com/ipfs/go-log"
21-
random "github.com/jbenet/go-random"
22-
peer "github.com/libp2p/go-libp2p-core/peer"
21+
"github.com/jbenet/go-random"
22+
"github.com/libp2p/go-libp2p-core/peer"
2323
testutil "github.com/libp2p/go-libp2p-testing/net"
2424
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
2525
)
@@ -97,7 +97,7 @@ func DirectAddCat(data []byte, conf testutil.LatencyConfig) error {
9797
defer cancel()
9898

9999
// create network
100-
mn := mocknet.New(ctx)
100+
mn := mocknet.New()
101101
mn.SetLinkDefaults(mocknet.LinkOptions{
102102
Latency: conf.NetworkLatency,
103103
// TODO add to conf. This is tricky because we want 0 values to be functional.

test/integration/bench_cat_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/ipfs/go-ipfs/core/coreapi"
1515
mock "github.com/ipfs/go-ipfs/core/mock"
1616
"github.com/ipfs/go-ipfs/thirdparty/unit"
17-
peer "github.com/libp2p/go-libp2p-core/peer"
17+
"github.com/libp2p/go-libp2p-core/peer"
1818
testutil "github.com/libp2p/go-libp2p-testing/net"
1919
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
2020
)
@@ -40,7 +40,7 @@ func benchCat(b *testing.B, data []byte, conf testutil.LatencyConfig) error {
4040
defer cancel()
4141

4242
// create network
43-
mn := mocknet.New(ctx)
43+
mn := mocknet.New()
4444
mn.SetLinkDefaults(mocknet.LinkOptions{
4545
Latency: conf.NetworkLatency,
4646
// TODO add to conf. This is tricky because we want 0 values to be functional.

test/integration/bitswap_wo_routing_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestBitswapWithoutRouting(t *testing.T) {
1919
const numPeers = 4
2020

2121
// create network
22-
mn := mocknet.New(ctx)
22+
mn := mocknet.New()
2323

2424
var nodes []*core.IpfsNode
2525
for i := 0; i < numPeers; i++ {

test/integration/three_legged_cat_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/ipfs/go-ipfs/thirdparty/unit"
1616

1717
files "github.com/ipfs/go-ipfs-files"
18-
peer "github.com/libp2p/go-libp2p-core/peer"
18+
"github.com/libp2p/go-libp2p-core/peer"
1919
testutil "github.com/libp2p/go-libp2p-testing/net"
2020
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
2121
)
@@ -68,7 +68,7 @@ func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error {
6868
defer cancel()
6969

7070
// create network
71-
mn := mocknet.New(ctx)
71+
mn := mocknet.New()
7272
mn.SetLinkDefaults(mocknet.LinkOptions{
7373
Latency: conf.NetworkLatency,
7474
// TODO add to conf. This is tricky because we want 0 values to be functional.

test/integration/wan_lan_dht_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func RunDHTConnectivity(conf testutil.LatencyConfig, numPeers int) error {
7272
defer cancel()
7373

7474
// create network
75-
mn := mocknet.New(ctx)
75+
mn := mocknet.New()
7676
mn.SetLinkDefaults(mocknet.LinkOptions{
7777
Latency: conf.NetworkLatency,
7878
Bandwidth: math.MaxInt32,
@@ -209,9 +209,9 @@ WanStartupWait:
209209
for {
210210
select {
211211
case err := <-testPeer.DHT.WAN.RefreshRoutingTable():
212-
//if err != nil {
212+
// if err != nil {
213213
// fmt.Printf("Error refreshing routing table: %v\n", err)
214-
//}
214+
// }
215215
if testPeer.DHT.WAN.RoutingTable() == nil ||
216216
testPeer.DHT.WAN.RoutingTable().Size() == 0 ||
217217
err != nil {

0 commit comments

Comments
 (0)