From 15c35a5a95b226be66a77ed7ea87754c31d6c650 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 14 Dec 2019 19:38:36 +0100 Subject: [PATCH] doc: update documentation for /ipfs -> /p2p multiaddr switch See: https://github.com/libp2p/libp2p/issues/79 --- core/commands/p2p.go | 4 ++-- core/commands/swarm.go | 4 ++-- docs/examples/go-ipfs-as-a-library/main.go | 18 +++++++++--------- docs/experimental-features.md | 12 ++++++------ docs/file-transfer.md | 4 ++-- docs/transports.md | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/core/commands/p2p.go b/core/commands/p2p.go index c84c8e3bc..afd6c03bd 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -87,8 +87,8 @@ Forward connections made to to . connections and/or handlers. It must be prefixed with '` + P2PProtoPrefix + `'. Example: - ipfs p2p forward ` + P2PProtoPrefix + `myproto /ip4/127.0.0.1/tcp/4567 /ipfs/QmPeer - - Forward connections to 127.0.0.1:4567 to '` + P2PProtoPrefix + `myproto' service on /ipfs/QmPeer + ipfs p2p forward ` + P2PProtoPrefix + `myproto /ip4/127.0.0.1/tcp/4567 /p2p/QmPeer + - Forward connections to 127.0.0.1:4567 to '` + P2PProtoPrefix + `myproto' service on /p2p/QmPeer `, }, diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 2f7542ea8..31cd8e6f4 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -354,7 +354,7 @@ var swarmConnectCmd = &cmds.Command{ The address format is an IPFS multiaddr: -ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ +ipfs swarm connect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ `, }, Arguments: []cmds.Argument{ @@ -399,7 +399,7 @@ var swarmDisconnectCmd = &cmds.Command{ 'ipfs swarm disconnect' closes a connection to a peer address. The address format is an IPFS multiaddr: -ipfs swarm disconnect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ +ipfs swarm disconnect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ The disconnect is not permanent; if ipfs needs to talk to that address later, it will reconnect. diff --git a/docs/examples/go-ipfs-as-a-library/main.go b/docs/examples/go-ipfs-as-a-library/main.go index 55eb157f6..cc390eceb 100644 --- a/docs/examples/go-ipfs-as-a-library/main.go +++ b/docs/examples/go-ipfs-as-a-library/main.go @@ -293,19 +293,19 @@ func main() { bootstrapNodes := []string{ // IPFS Bootstrapper nodes. - "/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", - "/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", - "/dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb", - "/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", + "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", + "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", + "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb", + "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", // IPFS Cluster Pinning nodes - "/ip4/138.201.67.219/tcp/4001/ipfs/QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA", - "/ip4/138.201.67.220/tcp/4001/ipfs/QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i", - "/ip4/138.201.68.74/tcp/4001/ipfs/QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR", - "/ip4/94.130.135.167/tcp/4001/ipfs/QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE", + "/ip4/138.201.67.219/tcp/4001/p2p/QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA", + "/ip4/138.201.67.220/tcp/4001/p2p/QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i", + "/ip4/138.201.68.74/tcp/4001/p2p/QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR", + "/ip4/94.130.135.167/tcp/4001/p2p/QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE", // You can add more nodes here, for example, another IPFS node you might have running locally, mine was: - // "/ip4/127.0.0.1/tcp/4010/ipfs/QmZp2fhDLxjYue2RiUvLwT9MWdnbDxam32qYFnGmxZDh5L", + // "/ip4/127.0.0.1/tcp/4010/p2p/QmZp2fhDLxjYue2RiUvLwT9MWdnbDxam32qYFnGmxZDh5L", } go connectToPeers(ctx, ipfs, bootstrapNodes) diff --git a/docs/experimental-features.md b/docs/experimental-features.md index f7121850e..296368452 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -229,7 +229,7 @@ ipfs bootstrap add For example: ``` -ipfs bootstrap add /ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64 +ipfs bootstrap add /ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64 ``` Bootstrap nodes are no different from all other nodes in the network apart from @@ -302,7 +302,7 @@ connections on `127.0.0.1:SOME_PORT` to the server node listening on `/x/kickass/1.0`. ```sh -> ipfs p2p forward /x/kickass/1.0 /ip4/127.0.0.1/tcp/$SOME_PORT /ipfs/$SERVER_ID +> ipfs p2p forward /x/kickass/1.0 /ip4/127.0.0.1/tcp/$SOME_PORT /p2p/$SERVER_ID ``` Next, have your application open a connection to `127.0.0.1:$SOME_PORT`. This @@ -343,7 +343,7 @@ ipfs p2p listen /x/ssh /ip4/127.0.0.1/tcp/22 ***Then, on "client" node:*** ```sh -ipfs p2p forward /x/ssh /ip4/127.0.0.1/tcp/2222 /ipfs/$SERVER_ID +ipfs p2p forward /x/ssh /ip4/127.0.0.1/tcp/2222 /p2p/$SERVER_ID ``` You should now be able to connect to your ssh server through a libp2p connection @@ -465,13 +465,13 @@ already online node would have to be restarted. In order to connect peers QmA and QmB through a relay node QmRelay: - Both peers should connect to the relay: -`ipfs swarm connect /transport/address/ipfs/QmRelay` +`ipfs swarm connect /transport/address/p2p/QmRelay` - Peer QmA can then connect to peer QmB using the relay: -`ipfs swarm connect /ipfs/QmRelay/p2p-circuit/ipfs/QmB` +`ipfs swarm connect /p2p/QmRelay/p2p-circuit/p2p/QmB` Peers can also connect with an unspecific relay address, which will try to dial through known relays: -`ipfs swarm connect /p2p-circuit/ipfs/QmB` +`ipfs swarm connect /p2p-circuit/p2p/QmB` Peers can see their (unspecific) relay address in the output of `ipfs swarm addrs listen` diff --git a/docs/file-transfer.md b/docs/file-transfer.md index 39cc63809..247993489 100644 --- a/docs/file-transfer.md +++ b/docs/file-transfer.md @@ -45,8 +45,8 @@ addresses (like the example below), then your nodes are online. "ID": "QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", "PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb6znj3LQZKP1+X81exf+vbnqNCMtHjZ5RKTCm7Fytnfe+AI1fhs9YbZdkgFkM1HLxmIOLQj2bMXPIGxUM+EnewN8tWurx4B3+lR/LWNwNYcCFL+jF2ltc6SE6BC8kMLEZd4zidOLPZ8lIRpd0x3qmsjhGefuRwrKeKlR4tQ3C76ziOms47uLdiVVkl5LyJ5+mn4rXOjNKt/oy2O4m1St7X7/yNt8qQgYsPfe/hCOywxCEIHEkqmil+vn7bu4RpAtsUzCcBDoLUIWuU3i6qfytD05hP8Clo+at+l//ctjMxylf3IQ5qyP+yfvazk+WHcsB0tWueEmiU5P2nfUUIR3AgMBAAE=", "Addresses": [ - "/ip4/127.0.0.1/tcp/4001/ipfs/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", - "/ip4/192.168.2.131/tcp/4001/ipfs/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", + "/ip4/127.0.0.1/tcp/4001/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", + "/ip4/192.168.2.131/tcp/4001/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8", ], "AgentVersion": "go-ipfs/0.4.11-dev/", "ProtocolVersion": "ipfs/0.1.0" diff --git a/docs/transports.md b/docs/transports.md index 39ce127db..f70fff6d7 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -1,6 +1,6 @@ ## /ws and /wss -- websockets -If you want browsers to connect to e.g. `/dns4/example.com/tcp/443/wss/ipfs/QmFoo` +If you want browsers to connect to e.g. `/dns4/example.com/tcp/443/wss/p2p/QmFoo` - [ ] An SSL cert matching the `/dns4` or `/dns6` name - [ ] go-ipfs listening on `/ip4/127.0.0.1/tcp/8081/ws`