Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
1acb4503
提交
1acb4503
authored
4月 01, 2019
作者:
Łukasz Magiera
提交者:
Steven Allen
4月 17, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some blockstore type mixups
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
上级
bfaffb2d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
7 行删除
+14
-7
core.go
core/core.go
+1
-1
ncore.go
core/ncore.go
+9
-6
t0270-filestore.sh
test/sharness/t0270-filestore.sh
+4
-0
没有找到文件。
core/core.go
浏览文件 @
1acb4503
...
...
@@ -109,7 +109,7 @@ type IpfsNode struct {
Peerstore
pstore
.
Peerstore
`optional:"true"`
// storage for other Peer instances
Blockstore
bstore
.
GCBlockstore
// the block store (lower level)
Filestore
*
filestore
.
Filestore
// the filestore blockstore
BaseBlocks
bstore
.
Blockstore
// the raw blockstore, no filestore wrapping
BaseBlocks
BaseBlocks
// the raw blockstore, no filestore wrapping
GCLocker
bstore
.
GCLocker
// the locker used to protect the blockstore during gc
Blocks
bserv
.
BlockService
// the block service, get/add blocks.
DAG
ipld
.
DAGService
// the merkle dag service, get/add objects.
...
...
core/ncore.go
浏览文件 @
1acb4503
...
...
@@ -115,7 +115,9 @@ func datastoreCtor(repo repo.Repo) ds.Datastore {
return
repo
.
Datastore
()
}
func
baseBlockstoreCtor
(
repo
repo
.
Repo
,
cfg
*
iconfig
.
Config
,
bcfg
*
BuildCfg
,
lc
fx
.
Lifecycle
)
(
bs
bstore
.
Blockstore
,
err
error
)
{
type
BaseBlocks
bstore
.
Blockstore
func
baseBlockstoreCtor
(
repo
repo
.
Repo
,
cfg
*
iconfig
.
Config
,
bcfg
*
BuildCfg
,
lc
fx
.
Lifecycle
)
(
bs
BaseBlocks
,
err
error
)
{
rds
:=
&
retry
.
Datastore
{
Batching
:
repo
.
Datastore
(),
Delay
:
time
.
Millisecond
*
200
,
...
...
@@ -157,16 +159,17 @@ func baseBlockstoreCtor(repo repo.Repo, cfg *iconfig.Config, bcfg *BuildCfg, lc
return
}
func
gcBlockstoreCtor
(
repo
repo
.
Repo
,
b
s
bstore
.
Blockstore
,
cfg
*
iconfig
.
Config
)
(
gclocker
bstore
.
GCLocker
,
gcbs
bstore
.
GC
Blockstore
,
fstore
*
filestore
.
Filestore
)
{
func
gcBlockstoreCtor
(
repo
repo
.
Repo
,
b
b
BaseBlocks
,
cfg
*
iconfig
.
Config
)
(
gclocker
bstore
.
GCLocker
,
gcbs
bstore
.
GCBlockstore
,
bs
bstore
.
Blockstore
,
fstore
*
filestore
.
Filestore
)
{
gclocker
=
bstore
.
NewGCLocker
()
gcbs
=
bstore
.
NewGCBlockstore
(
b
s
,
gclocker
)
gcbs
=
bstore
.
NewGCBlockstore
(
b
b
,
gclocker
)
if
cfg
.
Experimental
.
FilestoreEnabled
||
cfg
.
Experimental
.
UrlstoreEnabled
{
// hash security
fstore
=
filestore
.
NewFilestore
(
b
s
,
repo
.
FileManager
())
//TODO: mark optional
fstore
=
filestore
.
NewFilestore
(
b
b
,
repo
.
FileManager
())
//TODO: mark optional
gcbs
=
bstore
.
NewGCBlockstore
(
fstore
,
gclocker
)
gcbs
=
&
verifbs
.
VerifBSGC
{
GCBlockstore
:
gcbs
}
}
bs
=
gcbs
return
}
...
...
@@ -574,7 +577,7 @@ func dagCtor(bs bserv.BlockService) format.DAGService {
return
merkledag
.
NewDAGService
(
bs
)
}
func
onlineExchangeCtor
(
lc
fx
.
Lifecycle
,
host
p2phost
.
Host
,
rt
routing
.
IpfsRouting
,
bs
bstore
.
Blockstore
)
exchange
.
Interface
{
func
onlineExchangeCtor
(
lc
fx
.
Lifecycle
,
host
p2phost
.
Host
,
rt
routing
.
IpfsRouting
,
bs
bstore
.
GC
Blockstore
)
exchange
.
Interface
{
bitswapNetwork
:=
bsnet
.
NewFromIpfsHost
(
host
,
rt
)
return
bitswap
.
New
(
lifecycleCtx
(
lc
),
bitswapNetwork
,
bs
)
}
...
...
@@ -664,7 +667,7 @@ func providerCtor(lc fx.Lifecycle, queue *provider.Queue, rt routing.IpfsRouting
return
provider
.
NewProvider
(
lifecycleCtx
(
lc
),
queue
,
rt
)
}
func
reproviderCtor
(
lc
fx
.
Lifecycle
,
cfg
*
iconfig
.
Config
,
bs
bstore
.
Blockstore
,
ds
format
.
DAGService
,
pinning
pin
.
Pinner
,
rt
routing
.
IpfsRouting
)
(
*
rp
.
Reprovider
,
error
)
{
func
reproviderCtor
(
lc
fx
.
Lifecycle
,
cfg
*
iconfig
.
Config
,
bs
BaseBlocks
,
ds
format
.
DAGService
,
pinning
pin
.
Pinner
,
rt
routing
.
IpfsRouting
)
(
*
rp
.
Reprovider
,
error
)
{
var
keyProvider
rp
.
KeyChanFunc
switch
cfg
.
Reprovider
.
Strategy
{
...
...
test/sharness/t0270-filestore.sh
浏览文件 @
1acb4503
...
...
@@ -74,6 +74,8 @@ init_ipfs_filestore() {
grep "either the filestore or the urlstore must be enabled" add_out
'
assert_repo_size_less_than 1000000
test_expect_success
"enable urlstore config setting"
'
ipfs config --json Experimental.UrlstoreEnabled true
'
...
...
@@ -84,6 +86,8 @@ init_ipfs_filestore() {
grep "filestore is not enabled" add_out
'
assert_repo_size_less_than 1000000
test_expect_success
"enable filestore config setting"
'
ipfs config --json Experimental.UrlstoreEnabled true &&
ipfs config --json Experimental.FilestoreEnabled true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论