Skip to content

Commit

Permalink
update go-libp2p to v0.18.0-rc4
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Feb 9, 2022
1 parent cde79df commit 7148ad3
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 76 deletions.
10 changes: 5 additions & 5 deletions core/coreapi/test/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"github.com/ipfs/go-filestore"
"github.com/ipfs/go-ipfs-keystore"
keystore "github.com/ipfs/go-ipfs-keystore"
"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/bootstrap"
"github.com/ipfs/go-ipfs/core/coreapi"
Expand All @@ -19,20 +19,20 @@ import (

"github.com/ipfs/go-datastore"
syncds "github.com/ipfs/go-datastore/sync"
"github.com/ipfs/go-ipfs-config"
config "github.com/ipfs/go-ipfs-config"
coreiface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/tests"
"github.com/libp2p/go-libp2p-core/crypto"
peer "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/libp2p/go-libp2p-core/peer"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
)

const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe"

type NodeProvider struct{}

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

nodes := make([]*core.IpfsNode, n)
apis := make([]coreiface.CoreAPI, n)
Expand Down
6 changes: 2 additions & 4 deletions core/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ import (

// NewMockNode constructs an IpfsNode for use in tests.
func NewMockNode() (*core.IpfsNode, error) {
ctx := context.Background()

// effectively offline, only peer in its network
return core.NewNode(ctx, &core.BuildCfg{
return core.NewNode(context.Background(), &core.BuildCfg{
Online: true,
Host: MockHostOption(mocknet.New(ctx)),
Host: MockHostOption(mocknet.New()),
})
}

Expand Down
7 changes: 5 additions & 2 deletions core/node/libp2p/libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (

logging "github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p"
connmgr "github.com/libp2p/go-libp2p-connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
"go.uber.org/fx"
)

Expand All @@ -30,7 +30,10 @@ var UserAgent = simpleOpt(libp2p.UserAgent(version.GetUserAgentVersion()))

func ConnectionManager(low, high int, grace time.Duration) func() (opts Libp2pOpts, err error) {
return func() (opts Libp2pOpts, err error) {
cm := connmgr.NewConnManager(low, high, grace)
cm, err := connmgr.NewConnManager(low, high, connmgr.WithGracePeriod(grace))
if err != nil {
return opts, err
}
opts.Opts = append(opts.Opts, libp2p.ConnectionManager(cm))
return
}
Expand Down
4 changes: 2 additions & 2 deletions core/node/libp2p/smux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (

config "github.com/ipfs/go-ipfs-config"
"github.com/libp2p/go-libp2p"
smux "github.com/libp2p/go-libp2p-core/mux"
"github.com/libp2p/go-libp2p-core/network"
mplex "github.com/libp2p/go-libp2p-mplex"
yamux "github.com/libp2p/go-libp2p-yamux"
)

func yamuxTransport() smux.Multiplexer {
func yamuxTransport() network.Multiplexer {
tpt := *yamux.DefaultTransport
tpt.AcceptBacklog = 512
if os.Getenv("YAMUX_DEBUG") != "" {
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/ipfs/go-datastore v0.5.1
github.com/ipfs/go-detect-race v0.0.1
github.com/ipfs/go-ds-badger v0.3.0
github.com/ipfs/go-ds-flatfs v0.5.1
github.com/ipfs/go-ds-flatfs v0.5.0
github.com/ipfs/go-ds-leveldb v0.5.0
github.com/ipfs/go-ds-measure v0.2.0
github.com/ipfs/go-fetcher v1.6.1
Expand Down Expand Up @@ -61,37 +61,37 @@ require (
github.com/ipfs/tar-utils v0.0.2
github.com/ipld/go-car v0.3.2
github.com/ipld/go-codec-dagpb v1.3.0
github.com/ipld/go-ipld-prime v0.14.2
github.com/ipld/go-ipld-prime v0.14.1
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
github.com/jbenet/go-temp-err-catcher v0.1.0
github.com/jbenet/goprocess v0.1.4
github.com/libp2p/go-doh-resolver v0.3.1
github.com/libp2p/go-libp2p v0.16.0
github.com/libp2p/go-libp2p-connmgr v0.2.4
github.com/libp2p/go-libp2p-core v0.11.0
github.com/libp2p/go-libp2p v0.18.0-rc4
github.com/libp2p/go-libp2p-connmgr v0.3.2-0.20220115145817-a7820a5879c7 // indirect
github.com/libp2p/go-libp2p-core v0.14.0
github.com/libp2p/go-libp2p-discovery v0.6.0
github.com/libp2p/go-libp2p-http v0.2.1
github.com/libp2p/go-libp2p-kad-dht v0.15.0
github.com/libp2p/go-libp2p-kbucket v0.4.7
github.com/libp2p/go-libp2p-loggables v0.1.0
github.com/libp2p/go-libp2p-mplex v0.4.1
github.com/libp2p/go-libp2p-mplex v0.5.0
github.com/libp2p/go-libp2p-noise v0.3.0
github.com/libp2p/go-libp2p-peerstore v0.4.0
github.com/libp2p/go-libp2p-peerstore v0.6.0
github.com/libp2p/go-libp2p-pubsub v0.6.0
github.com/libp2p/go-libp2p-pubsub-router v0.5.0
github.com/libp2p/go-libp2p-quic-transport v0.15.0
github.com/libp2p/go-libp2p-quic-transport v0.16.1
github.com/libp2p/go-libp2p-record v0.1.3
github.com/libp2p/go-libp2p-routing-helpers v0.2.3
github.com/libp2p/go-libp2p-swarm v0.8.0
github.com/libp2p/go-libp2p-testing v0.5.0
github.com/libp2p/go-libp2p-swarm v0.10.1
github.com/libp2p/go-libp2p-testing v0.7.0
github.com/libp2p/go-libp2p-tls v0.3.1
github.com/libp2p/go-libp2p-yamux v0.6.0
github.com/libp2p/go-libp2p-yamux v0.8.2
github.com/libp2p/go-socket-activation v0.1.0
github.com/libp2p/go-tcp-transport v0.4.0
github.com/libp2p/go-ws-transport v0.5.0
github.com/libp2p/go-tcp-transport v0.5.0
github.com/libp2p/go-ws-transport v0.6.0
github.com/miekg/dns v1.1.43
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr v0.4.1
github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multicodec v0.3.0
Expand Down
Loading

0 comments on commit 7148ad3

Please sign in to comment.