Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct protocol names for ipfs services #3132

Merged
merged 1 commit into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions diagnostics/diag.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import (
var log = logging.Logger("diagnostics")

// ProtocolDiag is the diagnostics protocol.ID
var ProtocolDiag protocol.ID = "/ipfs/diagnostics"
var ProtocolDiag protocol.ID = "/ipfs/diag/net/1.0.0"
var ProtocolDiagOld protocol.ID = "/ipfs/diagnostics"

var ErrAlreadyRunning = errors.New("diagnostic with that ID already running")

Expand Down Expand Up @@ -54,6 +55,7 @@ func NewDiagnostics(self peer.ID, h host.Host) *Diagnostics {
}

h.SetStreamHandler(ProtocolDiag, d.handleNewStream)
h.SetStreamHandler(ProtocolDiagOld, d.handleNewStream)
return d
}

Expand Down Expand Up @@ -203,7 +205,7 @@ func (d *Diagnostics) getDiagnosticFromPeers(ctx context.Context, peers map[peer
}

func (d *Diagnostics) getDiagnosticFromPeer(ctx context.Context, p peer.ID, pmes *pb.Message) (<-chan *DiagInfo, error) {
s, err := d.host.NewStream(ctx, p, ProtocolDiag)
s, err := d.host.NewStream(ctx, p, ProtocolDiag, ProtocolDiagOld)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion exchange/bitswap/network/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏽

var ProtocolBitswapOld protocol.ID = "/ipfs/bitswap"

// BitSwapNetwork provides network connectivity for BitSwap sessions
type BitSwapNetwork interface {
Expand Down
4 changes: 2 additions & 2 deletions exchange/bitswap/network/ipfs_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion routing/dht/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import (

var log = logging.Logger("dht")

var ProtocolDHT protocol.ID = "/ipfs/dht"
var ProtocolDHT protocol.ID = "/ipfs/kad/1.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏽

var ProtocolDHTOld protocol.ID = "/ipfs/dht"

// NumBootstrapQueries defines the number of random dht queries to do to
// collect members of the routing table.
Expand Down Expand Up @@ -85,6 +86,7 @@ func NewDHT(ctx context.Context, h host.Host, dstore ds.Batching) *IpfsDHT {
dht.ctx = ctx

h.SetStreamHandler(ProtocolDHT, dht.handleNewStream)
h.SetStreamHandler(ProtocolDHTOld, dht.handleNewStream)
dht.providers = providers.NewProviderManager(dht.ctx, dht.self, dstore)
dht.proc.AddChild(dht.providers.Process())
goprocessctx.CloseAfterContext(dht.proc, ctx)
Expand Down