Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
3d28165c
Unverified
提交
3d28165c
authored
10月 30, 2018
作者:
Steven Allen
提交者:
GitHub
10月 30, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5698 from ipfs/fix/libp2p-ping
ping: switch to the ping service enabled in the libp2p constructor
上级
545c8807
cc0d6d73
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
3 行增加
和
7 行删除
+3
-7
ping.go
core/commands/ping.go
+2
-1
core.go
core/core.go
+1
-6
没有找到文件。
core/commands/ping.go
浏览文件 @
3d28165c
...
...
@@ -14,6 +14,7 @@ import (
ma
"gx/ipfs/QmT4U94DnD8FRfqr21obWY32HLM5VExccPKMjQHofeYqr9/go-multiaddr"
"gx/ipfs/QmTRhk7cgjUf2gfQ3p2M9KPECNZEW9XUrmHcFCgog4cPgB/go-libp2p-peer"
pstore
"gx/ipfs/QmTTJcDL3gsnGDALjh2fDGg1onGRUdVgNL2hU2WEZcVrMX/go-libp2p-peerstore"
ping
"gx/ipfs/QmUDTcnDp2WssbmiDLC6aYurUeyt7QeRakHUQMxA2mZ5iB/go-libp2p/p2p/protocol/ping"
iaddr
"gx/ipfs/QmZc5PLgxW61uTPG24TroxHDF6xzgbhZZQf5i53ciQC47Y/go-ipfs-addr"
cmdkit
"gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
)
...
...
@@ -104,7 +105,7 @@ trip latency information.
ctx
,
cancel
:=
context
.
WithTimeout
(
req
.
Context
,
kPingTimeout
*
time
.
Duration
(
numPings
))
defer
cancel
()
pings
,
err
:=
n
.
Ping
.
Ping
(
ctx
,
pid
)
pings
,
err
:=
ping
.
Ping
(
ctx
,
n
.
PeerHost
,
pid
)
if
err
!=
nil
{
return
res
.
Emit
(
&
PingResult
{
Success
:
false
,
...
...
core/core.go
浏览文件 @
3d28165c
...
...
@@ -52,7 +52,6 @@ import (
p2pbhost
"gx/ipfs/QmUDTcnDp2WssbmiDLC6aYurUeyt7QeRakHUQMxA2mZ5iB/go-libp2p/p2p/host/basic"
rhost
"gx/ipfs/QmUDTcnDp2WssbmiDLC6aYurUeyt7QeRakHUQMxA2mZ5iB/go-libp2p/p2p/host/routed"
identify
"gx/ipfs/QmUDTcnDp2WssbmiDLC6aYurUeyt7QeRakHUQMxA2mZ5iB/go-libp2p/p2p/protocol/identify"
ping
"gx/ipfs/QmUDTcnDp2WssbmiDLC6aYurUeyt7QeRakHUQMxA2mZ5iB/go-libp2p/p2p/protocol/ping"
psrouter
"gx/ipfs/QmUhJjacEW7gDGsvxzn8NqyfCWRksgTtYeaGvQmgYvrmWH/go-libp2p-pubsub-router"
quic
"gx/ipfs/QmVX7uSFmFLZRFsN9QNPDJf7Pmhuv4GdedrKYrt2xXm5ag/go-libp2p-quic-transport"
circuit
"gx/ipfs/QmVYDvJjiKb9iFEyHxx4i1TJSRBLkQhGb5Fc8XpmDuNCEA/go-libp2p-circuit"
...
...
@@ -133,8 +132,7 @@ type IpfsNode struct {
Routing
routing
.
IpfsRouting
// the routing system. recommend ipfs-dht
Exchange
exchange
.
Interface
// the block exchange + strategy (bitswap)
Namesys
namesys
.
NameSystem
// the name system, resolves paths to hashes
Ping
*
ping
.
PingService
Reprovider
*
rp
.
Reprovider
// the value reprovider system
Reprovider
*
rp
.
Reprovider
// the value reprovider system
IpnsRepub
*
ipnsrp
.
Republisher
PubSub
*
pubsub
.
PubSub
...
...
@@ -464,9 +462,6 @@ func (n *IpfsNode) HandlePeerFound(p pstore.PeerInfo) {
// startOnlineServicesWithHost is the set of services which need to be
// initialized with the host and _before_ we start listening.
func
(
n
*
IpfsNode
)
startOnlineServicesWithHost
(
ctx
context
.
Context
,
host
p2phost
.
Host
,
routingOption
RoutingOption
,
enablePubsub
bool
,
enableIpnsps
bool
)
error
{
// setup diagnostics service
n
.
Ping
=
ping
.
NewPingService
(
host
)
if
enablePubsub
||
enableIpnsps
{
cfg
,
err
:=
n
.
Repo
.
Config
()
if
err
!=
nil
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论