Skip to content

Commit

Permalink
[[FIX]] update go-libp2p dependency to v0.23.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bysomeone authored and vipwzw committed Sep 12, 2023
1 parent 91d74ce commit 88be560
Show file tree
Hide file tree
Showing 45 changed files with 367 additions and 521 deletions.
6 changes: 3 additions & 3 deletions cmd/dht_crawler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"time"

"github.com/libp2p/go-libp2p"
core "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
core "github.com/libp2p/go-libp2p/core"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/libp2p/go-libp2p-kad-dht/crawler"
"github.com/multiformats/go-multiaddr"
)
Expand Down
34 changes: 15 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ go 1.16
require (
github.com/BurntSushi/toml v0.3.1
github.com/XiaoMi/pegasus-go-client v0.0.0-20210825081735-b8a75c1eac2b
github.com/btcsuite/btcd v0.22.0-beta
github.com/btcsuite/btcd v0.22.1
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/decred/base58 v1.0.3
github.com/dgraph-io/badger v1.6.2
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2
Expand All @@ -17,41 +19,35 @@ require (
github.com/google/uuid v1.3.0
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/influxdata/influxdb v1.9.5
github.com/ipfs/go-log/v2 v2.3.0
github.com/ipfs/go-log/v2 v2.5.1
github.com/kevinms/leakybucket-go v0.0.0-20200115003610-082473db97ca
github.com/libp2p/go-libp2p v0.15.0
github.com/libp2p/go-libp2p v0.23.4
github.com/libp2p/go-libp2p-blankhost v0.2.0
github.com/libp2p/go-libp2p-circuit v0.4.0
github.com/libp2p/go-libp2p-connmgr v0.2.4
github.com/libp2p/go-libp2p-core v0.9.0
github.com/libp2p/go-libp2p-discovery v0.5.1
github.com/libp2p/go-libp2p-kad-dht v0.13.1
github.com/libp2p/go-libp2p-kbucket v0.4.7
github.com/libp2p/go-libp2p-pubsub v0.5.4
github.com/libp2p/go-libp2p-swarm v0.5.3
github.com/libp2p/go-msgio v0.0.6
github.com/lucas-clemente/quic-go v0.26.0 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.20.0
github.com/libp2p/go-libp2p-kbucket v0.5.0
github.com/libp2p/go-libp2p-pubsub v0.8.3
github.com/libp2p/go-msgio v0.2.0
github.com/mattn/go-colorable v0.1.8
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multiaddr v0.4.1
github.com/multiformats/go-multiaddr v0.7.0
github.com/pkg/errors v0.9.1
github.com/qianlnk/pgbar v0.0.0-20210208085217-8c19b9f2477e
github.com/qianlnk/to v0.0.0-20191230085244-91e712717368 // indirect
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563
github.com/rs/cors v1.7.0
github.com/shopspring/decimal v1.2.0
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tjfoc/gmsm v1.3.2
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
google.golang.org/protobuf v1.28.1
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/go-playground/webhooks.v5 v5.2.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
Expand Down
624 changes: 237 additions & 387 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions system/p2p/dht/addrbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
p2pty "github.com/33cn/chain33/system/p2p/dht/types"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/wallet/bipwallet"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions system/p2p/dht/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"

p2pty "github.com/33cn/chain33/system/p2p/dht/types"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peerstore"
"github.com/multiformats/go-multiaddr"
)

Expand Down
6 changes: 3 additions & 3 deletions system/p2p/dht/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

p2pty "github.com/33cn/chain33/system/p2p/dht/types"
blankhost "github.com/libp2p/go-libp2p-blankhost"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
)

func getNetHosts(ctx context.Context, n int, t *testing.T) []host.Host {
Expand Down
16 changes: 8 additions & 8 deletions system/p2p/dht/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"github.com/33cn/chain33/system/p2p/dht/extension"
p2pty "github.com/33cn/chain33/system/p2p/dht/types"
"github.com/33cn/chain33/types"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
discovery "github.com/libp2p/go-libp2p-discovery"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
rout "github.com/libp2p/go-libp2p/p2p/discovery/routing"
dht "github.com/libp2p/go-libp2p-kad-dht"
kbt "github.com/libp2p/go-libp2p-kbucket"
)
Expand All @@ -21,18 +21,18 @@ const (
dhtProtoID = "/%s-%d/kad/1.0.0" //title-channel/kad/1.0.0
)

// Discovery dht discovery
// Discovery dht rout
type Discovery struct {
ctx context.Context
kademliaDHT *dht.IpfsDHT
RoutingDiscovery *discovery.RoutingDiscovery
RoutingDiscovery *rout.RoutingDiscovery
mdnsService *extension.MDNS
subCfg *p2pty.P2PSubConfig
bootstraps []peer.AddrInfo
host host.Host
}

// InitDhtDiscovery init dht discovery
// InitDhtDiscovery init dht rout
func InitDhtDiscovery(ctx context.Context, host host.Host, peersInfo []peer.AddrInfo, chainCfg *types.Chain33Config, subCfg *p2pty.P2PSubConfig) *Discovery {

// Make the DHT,不同的ID进入不同的网络。
Expand Down Expand Up @@ -61,7 +61,7 @@ func (d *Discovery) Start() {
if err := d.kademliaDHT.Bootstrap(d.ctx); err != nil {
log.Error("Bootstrap", "err", err.Error())
}
d.RoutingDiscovery = discovery.NewRoutingDiscovery(d.kademliaDHT)
d.RoutingDiscovery = rout.NewRoutingDiscovery(d.kademliaDHT)
}

//Close close the dht
Expand Down
8 changes: 4 additions & 4 deletions system/p2p/dht/extension/mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"time"

"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
discovery "github.com/libp2p/go-libp2p/p2p/discovery/mdns_legacy"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
discovery "github.com/libp2p/go-libp2p/p2p/discovery/mdns"
)

// MDNS mdns
Expand All @@ -27,7 +27,7 @@ func (n *discoveryNotifee) HandlePeerFound(pi peer.AddrInfo) {

// NewMDNS Initialize the MDNS service
func NewMDNS(ctx context.Context, peerhost host.Host, serviceTag string) (*MDNS, error) {
ser, err := discovery.NewMdnsService(ctx, peerhost, time.Minute*1, serviceTag)
ser := discovery.NewMdnsService(peerhost, time.Minute*1, serviceTag)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions system/p2p/dht/extension/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/33cn/chain33/common/log/log15"
p2ptypes "github.com/33cn/chain33/system/p2p/dht/types"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
)

Expand Down
2 changes: 1 addition & 1 deletion system/p2p/dht/extension/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

p2pty "github.com/33cn/chain33/system/p2p/dht/types"

core "github.com/libp2p/go-libp2p-core"
core "github.com/libp2p/go-libp2p/core"
"github.com/stretchr/testify/require"
)

Expand Down
16 changes: 8 additions & 8 deletions system/p2p/dht/extension/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"context"
"time"

circuit "github.com/libp2p/go-libp2p-circuit"
coredis "github.com/libp2p/go-libp2p-core/discovery"
host "github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
discovery "github.com/libp2p/go-libp2p-discovery"
swarm "github.com/libp2p/go-libp2p-swarm"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
relay "github.com/libp2p/go-libp2p/p2p/host/relay"
circuit "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated
coredis "github.com/libp2p/go-libp2p/core/discovery"
host "github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
discovery "github.com/libp2p/go-libp2p/p2p/discovery"
swarm "github.com/libp2p/go-libp2p/p2p/net/swarm"
swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
relay "github.com/libp2p/go-libp2p/p2p/host/relaysvc"
)

// Relay p2p relay
Expand Down
8 changes: 4 additions & 4 deletions system/p2p/dht/extension/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"testing"
"time"

circuit "github.com/libp2p/go-libp2p-circuit"
circuit "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated
"github.com/stretchr/testify/assert"

bhost "github.com/libp2p/go-libp2p-blankhost"
"github.com/libp2p/go-libp2p-core/host"
discovery "github.com/libp2p/go-libp2p-discovery"
"github.com/libp2p/go-libp2p/core/host"
discovery "github.com/libp2p/go-libp2p/p2p/discovery"
dht "github.com/libp2p/go-libp2p-kad-dht"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions system/p2p/dht/extension/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"sync"
"time"

"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p/core/host"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
pubsub "github.com/libp2p/go-libp2p-pubsub"
)

Expand Down
2 changes: 1 addition & 1 deletion system/p2p/dht/extension/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

blankhost "github.com/libp2p/go-libp2p-blankhost"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb"
"github.com/stretchr/testify/require"
Expand Down
8 changes: 4 additions & 4 deletions system/p2p/dht/manage/connectionGater.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/33cn/chain33/types"

"github.com/kevinms/leakybucket-go"
"github.com/libp2p/go-libp2p-core/control"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/control"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multiaddr"

//net "github.com/multiformats/go-multiaddr-net"
Expand Down
8 changes: 4 additions & 4 deletions system/p2p/dht/manage/connectionGater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/assert"

"github.com/libp2p/go-libp2p"
core "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
core "github.com/libp2p/go-libp2p/core"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/require"
)
Expand Down
8 changes: 4 additions & 4 deletions system/p2p/dht/manage/conns.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/33cn/chain33/common/log/log15"
p2pty "github.com/33cn/chain33/system/p2p/dht/types"
"github.com/33cn/chain33/types"
core "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
core "github.com/libp2p/go-libp2p/core"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
kb "github.com/libp2p/go-libp2p-kbucket"
"github.com/multiformats/go-multiaddr"
)
Expand Down
12 changes: 6 additions & 6 deletions system/p2p/dht/manage/conns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import (
p2pty "github.com/33cn/chain33/system/p2p/dht/types"
"github.com/33cn/chain33/types"
"github.com/libp2p/go-libp2p"
bhost "github.com/libp2p/go-libp2p-blankhost"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
bhost "github.com/libp2p/go-libp2p/p2p/host/blank"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
dht "github.com/libp2p/go-libp2p-kad-dht"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
"github.com/multiformats/go-multiaddr"

"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p/core/network"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
4 changes: 2 additions & 2 deletions system/p2p/dht/manage/peerinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
)

// PeerInfoManager peer info manager
Expand Down
12 changes: 6 additions & 6 deletions system/p2p/dht/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import (
"github.com/33cn/chain33/types"
libp2pLog "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p"
circuit "github.com/libp2p/go-libp2p-circuit"
circuit "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated"
connmgr "github.com/libp2p/go-libp2p-connmgr"
core "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/peer"
discovery "github.com/libp2p/go-libp2p-discovery"
core "github.com/libp2p/go-libp2p/core"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/peer"
discovery "github.com/libp2p/go-libp2p/p2p/discovery/routing"
"github.com/multiformats/go-multiaddr"
)

Expand Down
12 changes: 6 additions & 6 deletions system/p2p/dht/p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"
"time"

core "github.com/libp2p/go-libp2p-core"
core "github.com/libp2p/go-libp2p/core"

"github.com/stretchr/testify/assert"

Expand All @@ -30,11 +30,11 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/require"
)
Expand Down
Loading

0 comments on commit 88be560

Please sign in to comment.