Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
bc02a61e
Commit
bc02a61e
authored
Jun 12, 2019
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: flush pin on block put
parent
ccef991a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
core/commands/block.go
core/commands/block.go
+3
-3
core/coreapi/block.go
core/coreapi/block.go
+3
-0
No files found.
core/commands/block.go
View file @
bc02a61e
...
...
@@ -123,10 +123,10 @@ var blockPutCmd = &cmds.Command{
Tagline
:
"Store input as an IPFS block."
,
ShortDescription
:
`
'ipfs block put' is a plumbing command for storing raw IPFS blocks.
It reads from stdin, and
<key> is a base58 encoded multihash
.
It reads from stdin, and
outputs a multihash to stdout
.
By default
CIDv0 is going to be generated
. Setting 'mhtype' to anything
other
than 'sha2-256' or format to anything other than 'v0' will result in CIDv1.
By default
the multihash is output in CIDv0 format
. Setting 'mhtype' to anything
other
than 'sha2-256' or format to anything other than 'v0' will result in CIDv1.
`
,
},
...
...
core/coreapi/block.go
View file @
bc02a61e
...
...
@@ -56,6 +56,9 @@ func (api *BlockAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Bloc
if
settings
.
Pin
{
api
.
pinning
.
PinWithMode
(
b
.
Cid
(),
pin
.
Recursive
)
if
err
:=
api
.
pinning
.
Flush
();
err
!=
nil
{
return
nil
,
err
}
}
return
&
BlockStat
{
path
:
path
.
IpldPath
(
b
.
Cid
()),
size
:
len
(
data
)},
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment