Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
853ed0be
提交
853ed0be
authored
9月 26, 2019
作者:
Steven Allen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: fix deprecation warnings
上级
9ee4adfc
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
12 行增加
和
10 行删除
+12
-10
id.go
core/commands/id.go
+2
-1
core.go
core/core.go
+0
-7
gateway.go
core/corehttp/gateway.go
+1
-1
gateway_test.go
core/corehttp/gateway_test.go
+1
-1
groups.go
core/node/groups.go
+1
-0
libp2p.go
core/node/libp2p/libp2p.go
+4
-0
version.go
version.go
+3
-0
没有找到文件。
core/commands/id.go
浏览文件 @
853ed0be
...
...
@@ -8,6 +8,7 @@ import (
"io"
"strings"
version
"github.com/ipfs/go-ipfs"
core
"github.com/ipfs/go-ipfs/core"
cmdenv
"github.com/ipfs/go-ipfs/core/commands/cmdenv"
...
...
@@ -189,6 +190,6 @@ func printSelf(node *core.IpfsNode) (interface{}, error) {
}
}
info
.
ProtocolVersion
=
identify
.
LibP2PVersion
info
.
AgentVersion
=
identify
.
ClientVersion
info
.
AgentVersion
=
version
.
UserAgent
return
info
,
nil
}
core/core.go
浏览文件 @
853ed0be
...
...
@@ -12,10 +12,8 @@ package core
import
(
"context"
"io"
"path"
"github.com/ipfs/go-filestore"
version
"github.com/ipfs/go-ipfs"
"github.com/ipfs/go-ipfs/core/bootstrap"
"github.com/ipfs/go-ipfs/core/node"
"github.com/ipfs/go-ipfs/core/node/libp2p"
...
...
@@ -49,15 +47,10 @@ import (
record
"github.com/libp2p/go-libp2p-record"
"github.com/libp2p/go-libp2p/p2p/discovery"
p2pbhost
"github.com/libp2p/go-libp2p/p2p/host/basic"
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
)
var
log
=
logging
.
Logger
(
"core"
)
func
init
()
{
identify
.
ClientVersion
=
path
.
Join
(
"go-ipfs"
,
version
.
CurrentVersionNumber
,
version
.
CurrentCommit
)
}
// IpfsNode is IPFS Core module. It represents an IPFS instance.
type
IpfsNode
struct
{
...
...
core/corehttp/gateway.go
浏览文件 @
853ed0be
...
...
@@ -104,7 +104,7 @@ func VersionOption() ServeOption {
return
func
(
_
*
core
.
IpfsNode
,
_
net
.
Listener
,
mux
*
http
.
ServeMux
)
(
*
http
.
ServeMux
,
error
)
{
mux
.
HandleFunc
(
"/version"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
fmt
.
Fprintf
(
w
,
"Commit: %s
\n
"
,
version
.
CurrentCommit
)
fmt
.
Fprintf
(
w
,
"Client Version: %s
\n
"
,
id
.
ClientVersion
)
fmt
.
Fprintf
(
w
,
"Client Version: %s
\n
"
,
version
.
UserAgent
)
fmt
.
Fprintf
(
w
,
"Protocol Version: %s
\n
"
,
id
.
LibP2PVersion
)
})
return
mux
,
nil
...
...
core/corehttp/gateway_test.go
浏览文件 @
853ed0be
...
...
@@ -608,7 +608,7 @@ func TestVersion(t *testing.T) {
t
.
Fatalf
(
"response doesn't contain commit:
\n
%s"
,
s
)
}
if
!
strings
.
Contains
(
s
,
"Client Version: "
+
id
.
ClientVersion
)
{
if
!
strings
.
Contains
(
s
,
"Client Version: "
+
version
.
UserAgent
)
{
t
.
Fatalf
(
"response doesn't contain client version:
\n
%s"
,
s
)
}
...
...
core/node/groups.go
浏览文件 @
853ed0be
...
...
@@ -23,6 +23,7 @@ import (
)
var
BaseLibP2P
=
fx
.
Options
(
fx
.
Provide
(
libp2p
.
UserAgent
),
fx
.
Provide
(
libp2p
.
PNet
),
fx
.
Provide
(
libp2p
.
ConnectionManager
),
fx
.
Provide
(
libp2p
.
DefaultTransports
),
...
...
core/node/libp2p/libp2p.go
浏览文件 @
853ed0be
...
...
@@ -3,6 +3,8 @@ package libp2p
import
(
"time"
version
"github.com/ipfs/go-ipfs"
logging
"github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-connmgr"
...
...
@@ -22,6 +24,8 @@ type Libp2pOpts struct {
// Misc options
var
UserAgent
=
simpleOpt
(
libp2p
.
UserAgent
(
version
.
UserAgent
))
func
ConnectionManager
(
low
,
high
int
,
grace
time
.
Duration
)
func
()
(
opts
Libp2pOpts
,
err
error
)
{
return
func
()
(
opts
Libp2pOpts
,
err
error
)
{
cm
:=
connmgr
.
NewConnManager
(
low
,
high
,
grace
)
...
...
version.go
浏览文件 @
853ed0be
...
...
@@ -7,3 +7,6 @@ var CurrentCommit string
const
CurrentVersionNumber
=
"0.5.0-dev"
const
ApiVersion
=
"/go-ipfs/"
+
CurrentVersionNumber
+
"/"
// UserAgent is the libp2p user agent used by go-ipfs.
var
UserAgent
=
ApiVersion
+
CurrentCommit
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论