From c6192cebf462bffcfed88012a7f18836f0499857 Mon Sep 17 00:00:00 2001 From: Kishan Mohanbhai Sagathiya Date: Sun, 11 Aug 2019 19:06:45 +0530 Subject: [PATCH] Use `p2p` protocol name over `ipfs` for multiaddr --- api/rest/client/client_test.go | 2 +- api/util.go | 2 +- cmd/ipfs-cluster-ctl/main.go | 2 +- pstoremgr/pstoremgr_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/rest/client/client_test.go b/api/rest/client/client_test.go index 6d0ee13a..e39aed42 100644 --- a/api/rest/client/client_test.go +++ b/api/rest/client/client_test.go @@ -62,7 +62,7 @@ func apiMAddr(a *rest.API) ma.Multiaddr { } func peerMAddr(a *rest.API) ma.Multiaddr { - ipfsAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s", peer.IDB58Encode(a.Host().ID()))) + ipfsAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/p2p/%s", peer.IDB58Encode(a.Host().ID()))) for _, a := range a.Host().Addrs() { if _, err := a.ValueForProtocol(ma.P_IP4); err == nil { return a.Encapsulate(ipfsAddr) diff --git a/api/util.go b/api/util.go index 9f8a38ae..a044d0f2 100644 --- a/api/util.go +++ b/api/util.go @@ -35,7 +35,7 @@ func StringsToPeers(strs []string) []peer.ID { // peer ID is bad. func MustLibp2pMultiaddrJoin(addr Multiaddr, p peer.ID) Multiaddr { v := addr.Value() - pidAddr, err := ma.NewMultiaddr("/ipfs/" + peer.IDB58Encode(p)) + pidAddr, err := ma.NewMultiaddr("/p2p/" + peer.IDB58Encode(p)) // let this break badly if err != nil { panic("called MustLibp2pMultiaddrJoin with bad peer!") diff --git a/cmd/ipfs-cluster-ctl/main.go b/cmd/ipfs-cluster-ctl/main.go index f49df483..dd400e51 100644 --- a/cmd/ipfs-cluster-ctl/main.go +++ b/cmd/ipfs-cluster-ctl/main.go @@ -58,7 +58,7 @@ responses in a user-readable format. The location of the IPFS Cluster server is assumed to be %s, but can be configured with the --host option. To use the secure libp2p-http API endpoint, use "--host" with the full cluster libp2p listener -address (including the "/ipfs/" part), and --secret (the +address (including the "/p2p/" part), and --secret (the 32-byte cluster secret as it appears in the cluster configuration). For feedback, bug reports or any additional information, visit diff --git a/pstoremgr/pstoremgr_test.go b/pstoremgr/pstoremgr_test.go index 64711745..a6517e87 100644 --- a/pstoremgr/pstoremgr_test.go +++ b/pstoremgr/pstoremgr_test.go @@ -28,7 +28,7 @@ func clean(pm *Manager) { } func testAddr(loc string, pid peer.ID) ma.Multiaddr { - m, _ := ma.NewMultiaddr(loc + "/ipfs/" + peer.IDB58Encode(pid)) + m, _ := ma.NewMultiaddr(loc + "/p2p/" + peer.IDB58Encode(pid)) return m }