Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
4dca1f24
提交
4dca1f24
authored
1月 03, 2016
作者:
Jeromy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
better doc strings
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
上级
d4ffc945
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
25 行删除
+19
-25
patch.go
core/commands/object/patch.go
+19
-25
没有找到文件。
core/commands/object/patch.go
浏览文件 @
4dca1f24
...
@@ -20,29 +20,8 @@ var ObjectPatchCmd = &cmds.Command{
...
@@ -20,29 +20,8 @@ var ObjectPatchCmd = &cmds.Command{
Tagline
:
"Create a new merkledag object based on an existing one"
,
Tagline
:
"Create a new merkledag object based on an existing one"
,
ShortDescription
:
`
ShortDescription
:
`
'ipfs object patch <root> <cmd> <args>' is a plumbing command used to
'ipfs object patch <root> <cmd> <args>' is a plumbing command used to
build custom DAG objects. It adds and removes links from objects, creating a new
build custom DAG objects. It mutates objects, creating new objects as a
object as a result. This is the merkle-dag version of modifying an object. It
result. This is the merkle-dag version of modifying an object.
can also set the data inside a node with 'set-data' and append to that data as
well with 'append-data'.
Patch commands:
add-link <name> <ref> - adds a link to a node
rm-link <name> - removes a link from a node
set-data - sets a nodes data from stdin
append-data - appends to a nodes data from stdin
ipfs object patch $FOO_BAR rm-link foo
This removes the link named foo from the hash in $FOO_BAR and returns the
resulting object hash.
The data inside the node can be modified as well:
ipfs object patch $FOO_BAR set-data < file.dat
ipfs object patch $FOO_BAR append-data < file.dat
`
,
`
,
},
},
Arguments
:
[]
cmds
.
Argument
{},
Arguments
:
[]
cmds
.
Argument
{},
...
@@ -67,7 +46,15 @@ var patchAppendDataCmd = &cmds.Command{
...
@@ -67,7 +46,15 @@ var patchAppendDataCmd = &cmds.Command{
Helptext
:
cmds
.
HelpText
{
Helptext
:
cmds
.
HelpText
{
Tagline
:
"Append data to the data segment of a dag node"
,
Tagline
:
"Append data to the data segment of a dag node"
,
ShortDescription
:
`
ShortDescription
:
`
`
,
Append data to what already exists in the data segment in the given object.
EXAMPLE:
$ echo "hello" | ipfs object patch $HASH append-data
note: this does not append data to a 'file', it modifies the actual raw
data within an object. Objects have a max size of 1MB and objects larger than
the limit will not be respected by the network.
`
,
},
},
Arguments
:
[]
cmds
.
Argument
{
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"root"
,
true
,
false
,
"the hash of the node to modify"
),
cmds
.
StringArg
(
"root"
,
true
,
false
,
"the hash of the node to modify"
),
...
@@ -162,7 +149,12 @@ var patchSetDataCmd = &cmds.Command{
...
@@ -162,7 +149,12 @@ var patchSetDataCmd = &cmds.Command{
}
}
var
patchRmLinkCmd
=
&
cmds
.
Command
{
var
patchRmLinkCmd
=
&
cmds
.
Command
{
Helptext
:
cmds
.
HelpText
{},
Helptext
:
cmds
.
HelpText
{
Tagline
:
"remove a link from an object"
,
ShortDescription
:
`
removes a link by the given name from root.
`
,
},
Arguments
:
[]
cmds
.
Argument
{
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"root"
,
true
,
false
,
"the hash of the node to modify"
),
cmds
.
StringArg
(
"root"
,
true
,
false
,
"the hash of the node to modify"
),
cmds
.
StringArg
(
"link"
,
true
,
false
,
"name of the link to remove"
),
cmds
.
StringArg
(
"link"
,
true
,
false
,
"name of the link to remove"
),
...
@@ -220,6 +212,8 @@ var patchAddLinkCmd = &cmds.Command{
...
@@ -220,6 +212,8 @@ var patchAddLinkCmd = &cmds.Command{
Helptext
:
cmds
.
HelpText
{
Helptext
:
cmds
.
HelpText
{
Tagline
:
"add a link to a given object"
,
Tagline
:
"add a link to a given object"
,
ShortDescription
:
`
ShortDescription
:
`
Add a merkle-link to the given object and return the hash of the result.
Examples:
Examples:
EMPTY_DIR=$(ipfs object new unixfs-dir)
EMPTY_DIR=$(ipfs object new unixfs-dir)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论