Commit aa3684f8 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #3132 from ipfs/feat/versioned-protos

use correct protocol names for ipfs services
parents 540558d2 628442e8
......@@ -8,7 +8,8 @@ import (
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
type BitSwapNetwork interface {
......
......@@ -26,7 +26,7 @@ func NewFromIpfsHost(host host.Host, r routing.ContentRouting) BitSwapNetwork {
routing: r,
}
host.SetStreamHandler(ProtocolBitswap, bitswapNetwork.handleNewStream)
host.SetStreamHandler("/bitswap/1.0.0", bitswapNetwork.handleNewStream)
host.SetStreamHandler(ProtocolBitswapOld, bitswapNetwork.handleNewStream)
host.Network().Notify((*netNotifiee)(&bitswapNetwork))
// TODO: StopNotify.
......@@ -73,7 +73,7 @@ func (bsnet *impl) newStreamToPeer(ctx context.Context, p peer.ID) (inet.Stream,
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(
......
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