Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
b0ac2b8d
Unverified
提交
b0ac2b8d
authored
3月 22, 2018
作者:
Whyrusleeping
提交者:
GitHub
3月 22, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4816 from ipfs/fix/t0063-test-profile
Fix t0063-daemon-init.sh by adding test profile to daemon
上级
1be6513c
6b671251
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
4 行删除
+13
-4
daemon.go
cmd/ipfs/daemon.go
+5
-1
init.go
cmd/ipfs/init.go
+7
-2
t0063-daemon-init.sh
test/sharness/t0063-daemon-init.sh
+1
-1
没有找到文件。
cmd/ipfs/daemon.go
浏览文件 @
b0ac2b8d
...
...
@@ -34,6 +34,7 @@ const (
adjustFDLimitKwd
=
"manage-fdlimit"
enableGCKwd
=
"enable-gc"
initOptionKwd
=
"init"
initProfileOptionKwd
=
"init-profile"
ipfsMountKwd
=
"mount-ipfs"
ipnsMountKwd
=
"mount-ipns"
migrateKwd
=
"migrate"
...
...
@@ -148,6 +149,7 @@ Headers.
Options
:
[]
cmdkit
.
Option
{
cmdkit
.
BoolOption
(
initOptionKwd
,
"Initialize ipfs with default settings if not already initialized"
),
cmdkit
.
StringOption
(
initProfileOptionKwd
,
"Configuration profiles to apply for --init. See ipfs init --help for more"
),
cmdkit
.
StringOption
(
routingOptionKwd
,
"Overrides the routing option"
)
.
WithDefault
(
"dht"
),
cmdkit
.
BoolOption
(
mountKwd
,
"Mounts IPFS to the filesystem"
),
cmdkit
.
BoolOption
(
writableKwd
,
"Enable writing objects (with POST, PUT and DELETE)"
),
...
...
@@ -222,7 +224,9 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
cfg
:=
cctx
.
ConfigRoot
if
!
fsrepo
.
IsInitialized
(
cfg
)
{
err
:=
initWithDefaults
(
os
.
Stdout
,
cfg
)
profiles
,
_
:=
req
.
Options
[
initProfileOptionKwd
]
.
(
string
)
err
:=
initWithDefaults
(
os
.
Stdout
,
cfg
,
profiles
)
if
err
!=
nil
{
re
.
SetError
(
err
,
cmdkit
.
ErrNormal
)
return
...
...
cmd/ipfs/init.go
浏览文件 @
b0ac2b8d
...
...
@@ -134,8 +134,13 @@ var errRepoExists = errors.New(`ipfs configuration file already exists!
Reinitializing would overwrite your keys.
`
)
func
initWithDefaults
(
out
io
.
Writer
,
repoRoot
string
)
error
{
return
doInit
(
out
,
repoRoot
,
false
,
nBitsForKeypairDefault
,
nil
,
nil
)
func
initWithDefaults
(
out
io
.
Writer
,
repoRoot
string
,
profile
string
)
error
{
var
profiles
[]
string
if
profile
!=
""
{
profiles
=
strings
.
Split
(
profile
,
","
)
}
return
doInit
(
out
,
repoRoot
,
false
,
nBitsForKeypairDefault
,
profiles
,
nil
)
}
func
doInit
(
out
io
.
Writer
,
repoRoot
string
,
empty
bool
,
nBitsForKeypair
int
,
confProfiles
[]
string
,
conf
*
config
.
Config
)
error
{
...
...
test/sharness/t0063-daemon-init.sh
浏览文件 @
b0ac2b8d
...
...
@@ -26,7 +26,7 @@ test_ipfs_daemon_init() {
# server.
test_expect_success
"'ipfs daemon --init' succeeds"
'
ipfs daemon --init >actual_daemon 2>daemon_err &
ipfs daemon --init
--init-profile=test
>actual_daemon 2>daemon_err &
IPFS_PID=$!
sleep 2 &&
if ! kill -0 $IPFS_PID; then cat daemon_err; return 1; fi
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论