Skip to content

Commit

Permalink
update go-libp2p to v0.28.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jun 27, 2023
1 parent f2a6c4f commit d65efdb
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 117 deletions.
2 changes: 0 additions & 2 deletions core/commands/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
pstore "github.com/libp2p/go-libp2p/core/peerstore"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
)

const offlineIDErrorMessage = "'ipfs id' cannot query information on remote peers without a running daemon; if you only want to convert --peerid-base, pass --offline option"
Expand Down Expand Up @@ -217,7 +216,6 @@ func printSelf(keyEnc ke.KeyEncoder, node *core.IpfsNode) (interface{}, error) {
info.Protocols = node.PeerHost.Mux().Protocols()
sort.Slice(info.Protocols, func(i, j int) bool { return info.Protocols[i] < info.Protocols[j] })
}
info.ProtocolVersion = identify.DefaultProtocolVersion
info.AgentVersion = version.GetUserAgentVersion()
return info, nil
}
8 changes: 3 additions & 5 deletions core/corehttp/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ import (
"github.com/ipfs/boxo/gateway"
"github.com/ipfs/boxo/namesys"
offlineroute "github.com/ipfs/boxo/routing/offline"
cid "github.com/ipfs/go-cid"
"github.com/ipfs/go-cid"
version "github.com/ipfs/kubo"
config "github.com/ipfs/kubo/config"
core "github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core/node"
"github.com/libp2p/go-libp2p/core/routing"
id "github.com/libp2p/go-libp2p/p2p/protocol/identify"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
)

Expand Down Expand Up @@ -72,7 +71,6 @@ func VersionOption() ServeOption {
mux.HandleFunc("/version", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Commit: %s\n", version.CurrentCommit)
fmt.Fprintf(w, "Client Version: %s\n", version.GetUserAgentVersion())
fmt.Fprintf(w, "Protocol Version: %s\n", id.DefaultProtocolVersion)
})
return mux, nil
}
Expand Down
17 changes: 6 additions & 11 deletions core/corehttp/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import (
"strings"
"testing"

namesys "github.com/ipfs/boxo/namesys"
"github.com/ipfs/boxo/namesys"
version "github.com/ipfs/kubo"
core "github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core/coreapi"
repo "github.com/ipfs/kubo/repo"
"github.com/ipfs/kubo/repo"
"github.com/stretchr/testify/assert"

iface "github.com/ipfs/boxo/coreiface"
nsopts "github.com/ipfs/boxo/coreiface/options/namesys"
path "github.com/ipfs/boxo/path"
datastore "github.com/ipfs/go-datastore"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-datastore"
syncds "github.com/ipfs/go-datastore/sync"
config "github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/config"
ci "github.com/libp2p/go-libp2p/core/crypto"
id "github.com/libp2p/go-libp2p/p2p/protocol/identify"
)

type mockNamesys map[string]path.Path
Expand Down Expand Up @@ -169,10 +168,6 @@ func TestVersion(t *testing.T) {
if !strings.Contains(s, "Client Version: "+version.GetUserAgentVersion()) {
t.Fatalf("response doesn't contain client version:\n%s", s)
}

if !strings.Contains(s, "Protocol Version: "+id.DefaultProtocolVersion) {
t.Fatalf("response doesn't contain protocol version:\n%s", s)
}
}

func TestDeserializedResponsesInheritance(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/kubo-as-a-library/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/ipfs/kubo => ./../../..
require (
github.com/ipfs/boxo v0.10.2-0.20230627105028-a87f9ed0b2a9
github.com/ipfs/kubo v0.0.0-00010101000000-000000000000
github.com/libp2p/go-libp2p v0.27.7
github.com/libp2p/go-libp2p v0.28.1
github.com/multiformats/go-multiaddr v0.9.0
)

Expand Down Expand Up @@ -52,6 +52,7 @@ require (
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down Expand Up @@ -109,7 +110,7 @@ require (
github.com/libp2p/go-libp2p-xor v0.1.0 // indirect
github.com/libp2p/go-mplex v0.7.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
github.com/libp2p/go-reuseport v0.3.0 // indirect
github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
Expand Down Expand Up @@ -194,5 +195,4 @@ require (
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
Loading

0 comments on commit d65efdb

Please sign in to comment.