Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
03904074
提交
03904074
authored
8月 26, 2016
作者:
Jeromy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use correct protocol names for ipfs services
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
上级
594ae64f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
11 行增加
和
6 行删除
+11
-6
diag.go
diagnostics/diag.go
+4
-2
interface.go
exchange/bitswap/network/interface.go
+2
-1
ipfs_impl.go
exchange/bitswap/network/ipfs_impl.go
+2
-2
dht.go
routing/dht/dht.go
+3
-1
没有找到文件。
diagnostics/diag.go
浏览文件 @
03904074
...
...
@@ -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"
)
...
...
@@ -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
}
...
...
@@ -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
}
...
...
exchange/bitswap/network/interface.go
浏览文件 @
03904074
...
...
@@ -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
{
...
...
exchange/bitswap/network/ipfs_impl.go
浏览文件 @
03904074
...
...
@@ -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
(
...
...
routing/dht/dht.go
浏览文件 @
03904074
...
...
@@ -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"
var
ProtocolDHTOld
protocol
.
ID
=
"/ipfs/dht"
// NumBootstrapQueries defines the number of random dht queries to do to
// collect members of the routing table.
...
...
@@ -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
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论