Commit 628442e8 authored by Jeromy's avatar Jeromy

use correct protocol names for ipfs services

License: MIT
Signed-off-by: default avatarJeromy <why@ipfs.io>
parent f3ea01e9
...@@ -8,7 +8,8 @@ import ( ...@@ -8,7 +8,8 @@ import (
protocol "gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/protocol" protocol "gx/ipfs/Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS/go-libp2p/p2p/protocol"
) )
var ProtocolBitswap protocol.ID = "/ipfs/bitswap" var ProtocolBitswap protocol.ID = "/ipfs/bitswap/1.0.0"
var ProtocolBitswapOld protocol.ID = "/ipfs/bitswap"
// BitSwapNetwork provides network connectivity for BitSwap sessions // BitSwapNetwork provides network connectivity for BitSwap sessions
type BitSwapNetwork interface { type BitSwapNetwork interface {
......
...@@ -26,7 +26,7 @@ func NewFromIpfsHost(host host.Host, r routing.ContentRouting) BitSwapNetwork { ...@@ -26,7 +26,7 @@ func NewFromIpfsHost(host host.Host, r routing.ContentRouting) BitSwapNetwork {
routing: r, routing: r,
} }
host.SetStreamHandler(ProtocolBitswap, bitswapNetwork.handleNewStream) host.SetStreamHandler(ProtocolBitswap, bitswapNetwork.handleNewStream)
host.SetStreamHandler("/bitswap/1.0.0", bitswapNetwork.handleNewStream) host.SetStreamHandler(ProtocolBitswapOld, bitswapNetwork.handleNewStream)
host.Network().Notify((*netNotifiee)(&bitswapNetwork)) host.Network().Notify((*netNotifiee)(&bitswapNetwork))
// TODO: StopNotify. // TODO: StopNotify.
...@@ -73,7 +73,7 @@ func (bsnet *impl) newStreamToPeer(ctx context.Context, p peer.ID) (inet.Stream, ...@@ -73,7 +73,7 @@ func (bsnet *impl) newStreamToPeer(ctx context.Context, p peer.ID) (inet.Stream,
return nil, err return nil, err
} }
return bsnet.host.NewStream(ctx, p, "/bitswap/1.0.0", ProtocolBitswap) return bsnet.host.NewStream(ctx, p, ProtocolBitswap, ProtocolBitswapOld)
} }
func (bsnet *impl) SendMessage( func (bsnet *impl) SendMessage(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment