1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-15 07:58:15 +08:00

181 Commits

Author SHA1 Message Date
4fdfbc7d32 compute add size in background to not stall add operation
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
efac042e82 rework editor creation and finalization
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
b6f28dad1b Add a --pin option to ipfs add (allowing --pin=false)
Implements a solution for #1908

This PR replaces #1909

License: MIT
Signed-off-by: Andrew Chin <achin@eminence32.net>
2016-01-12 08:22:55 -08:00
rht
86901aff3c Move parts of ipfs add into core/coreunix
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2016-01-12 08:22:55 -08:00
b12ee40aba implement mark and sweep GC
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

dont GC blocks used by pinner

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

comment GC algo

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

add lock to blockstore to prevent GC from eating wanted blocks

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

improve FetchGraph

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

separate interfaces for blockstore and GCBlockstore

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

reintroduce indirect pinning, add enumerateChildren dag method

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:21:13 -08:00
c9ce2e724a Simplify Pinner interface by folding ManualPinner into Pinner
Pinner had method GetManual that returned a ManualPinner, so every
Pinner had to implement ManualPinner anyway.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:17:17 -08:00
a6eb32b77c Fix path parsing for add command
License: MIT
Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
2015-12-22 10:59:17 -05:00
rht
48a33ffb67 Add fixed period repo GC + test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-11-10 14:03:29 +07:00
dc85abb77b adds -H as short option for 'ipfs add --hidden'
License: MIT
Signed-off-by: Caio Alonso <caio@caioalonso.com>
2015-10-10 12:47:12 -03:00
308ab9a2ea remove error log i forgot to remove from another PR
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-05 16:05:00 -07:00
b3aee2872f move mem-dag construction to its own function, and actually call WriteOutputTo
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-05 04:56:55 +02:00
30d10ce4f4 add-only-hash no longer stores entirety of everything in memory
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-05 04:56:55 +02:00
56f01e4981 rm panic
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-02 11:03:07 -07:00
9bbd9b061d give ipfs get symlink support
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-30 23:34:02 -07:00
d993bc04d6 implement symlinks in unixfs, first draft
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-30 13:33:42 -07:00
94000e6490 replace nodebuilder with a nicer interface
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

use NewNode instead of NewIPFSNode in most of the codebase

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

make mocknet work with node constructor better

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

finish cleanup of old construction method

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

blockservice.New doesnt return an error anymore

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

break up node construction into separate function

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

add error case to default filling on node constructor

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-27 08:43:10 -07:00
978c9fa16f cmds/add: use dagutils.Editor, like patch
This changes the pin behavior. It uses the filenames given through
the api, and allows files to be streamed faltly (not a hierarchy),
which is easier for other things (like vinyl in node-ipfs-api land).
Files can also be entirely out of order, and the garbage intermediate
directories will not be pinned (gc-ed later).

The changes also mean the output of add has changed slightly-- it
no longer shows the local path added, but rather the dag path
relative to the added roots. This is a small difference, but changes
tests.

The dagutils.Editor creates a lot of chaff (intermediate objects)
along the way. Wonder how we might minimize the writes to the
datastore...

This commit also removes the "NilRepo()" part of the --only-hash
mode. We need to store at least in an in-mem repo/datastore because
otherwise the dagutils.Editor breaks.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-12 08:24:06 +02:00
39a23392c1 use rabin fingerprinting for a chunker
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

implement rabin fingerprinting as a chunker for ipfs

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

vendor correctly

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

refactor chunking interface a little

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

work chunking interface changes up into importer

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

move chunker type parsing into its own file in chunk

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-08 15:33:10 -07:00
4a7c1cf802 add -w improvement: wrap multiple files in one dir
> ipfs add a b c
  added Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 a
  added QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM b
  added QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 c
  added QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3

  > ipfs ls QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3
  Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 10 a
  QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM 10 b
  QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 10 c

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-29 03:07:39 -07:00
6e6badf105 add -w: fix to work correctly with dirs.
this commit changes the behavior of ipfs add -w:

- it makes it able to work with ipfs add -r <dir>
- instead of hacking around the add, we simply just add a wrapper
  directory around the whole result of the add. this means that
  ipfs add -w calls will output _two_ lines, but this is actually
  more correct than outputting one line, as two objects were added.
  this _may_ break scripts out there which expect the output to
  look a certain way. we should consider whether the old output is
  more _useful_ (even if less in-line with the model.)

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-29 02:30:08 -07:00
rht
818d3af827 Clear progress bar on ipfs cat exit
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-24 23:04:57 +07:00
bb3a75aa08 remove context from context
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 20:53:06 -07:00
e55a130b49 Add hidden file support to add
License: MIT
Signed-off-by: Gaetan Voyer-Perrault <gatesvp@gmail.com>
2015-07-09 04:07:34 -07:00
e42c967297 add option to only hash input
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-22 15:21:53 -07:00
600e1523e4 Wired up the trickle dag flag for the add command
License: MIT
Signed-off-by: Dylan Powers <dylan.kyle.powers@gmail.com>
2015-06-16 15:40:26 -07:00
dd928a2b1d change pinning to happen in a callback 2015-05-28 08:52:20 -07:00
a67af7d9c1 remove unnecessary flush, and buffer output channel 2015-05-18 14:55:58 -07:00
c322a4eb0f core/commands/add: Change add() to only accept a single reader
The change to an array of readers comes from e096060b
(refactor(core/commands2/add) split loop, 2014-11-06), where it's used
to setup readers for each path in the argument list.  However, since
6faeee83 (cmds2/add: temp fix for -r. horrible hack, 2014-11-11) the
argument looping moved outside of add() and into Run(), so we can drop
the multiple-reader support from add().

Adding a file can create multiple nodes (e.g. the splitter can chunk
the file into several blocks), but:

1. we were only appending a single node per reader to our returned
   list, and
2. we are only using the final node in that returned list,

so this commit also adjusts add() to return a single node reference
instead on an array of nodes.
2015-04-23 09:41:59 -07:00
861f30cc12 don't readd entire directories recursively 2015-04-20 16:21:00 -07:00
218aeeb77e cmds/add: silent error fix 2015-04-20 01:18:42 -07:00
140cd1fd1b remove debugerrors
We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
2015-04-20 00:35:35 -07:00
0a6b880bee fix for #1008 and other pinning fixes
This commit adds a new set of sharness tests for pinning, and addresses
bugs that were pointed out by said tests.

test/sharness: added more pinning tests

Pinning is currently broken. See issue #1051. This commit introduces
a few more pinning tests. These are by no means exhaustive, but
definitely surface the present problems going on. I believe these
tests are correct, but not sure. Pushing them as failing so that
pinning is fixed in this PR.

make pinning and merkledag.Get take contexts

improve 'add' commands usage of pinning

FIXUP: fix 'pin lists look good'

ipfs-pin-stat simple script to help check pinning

This is a simple shell script to help check pinning.

We ought to strive towards making adding commands this easy.
The http api is great and powerful, but our setup right now
gets in the way. Perhaps we can clean up that area.

updated t0081-repo-pinning

- fixed a couple bugs with the tests
- made it a bit clearer (still a lot going on)
- the remaining tests are correct and highlight a problem with
  pinning. Namely, that recursive pinning is buggy. At least:
  towards the end of the test, $HASH_DIR4 and $HASH_FILE4 should
  be pinned indirectly, but they're not. And thus get gc-ed out.
  There may be other problems too.

cc @whyrusleeping

fix grep params for context deadline check

fix bugs in pin and pin tests

check for block local before checking recursive pin
2015-04-19 23:40:25 -07:00
69db1b4ec5 bugfix: add was not setting error 2015-04-12 07:53:04 -07:00
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
15b181ffe2 return early from add PostRun if error is set 2015-02-19 13:52:30 -08:00
140c70d772 document some packages 2015-02-10 22:59:10 +00:00
1ad5b345b8 core/commands: add: Added -w/--wrap-with-directory option 2015-02-02 10:07:35 -08:00
5706471897 commands: Made PostRun signature match Run 2015-01-23 18:29:31 -08:00
3fc9bedb0b commands: Made Std{in|out|err} accessible in Request/Response 2015-01-23 18:29:31 -08:00
b77d1c21b6 core/commands: add: Don't show progress bar when using --quiet option 2015-01-23 18:29:31 -08:00
121dfb10b4 core/commands: Fixed progress bar line clear race condition in 'add' 2015-01-23 18:29:31 -08:00
2363cb63e6 core/commands: Fixed 'add' progress bar sometimes not clearing progress bar output line 2015-01-23 18:29:31 -08:00
c3ea164f64 core/commands: Added progress bars for 'add'
squash! core/commands: Added progress bars for 'add'

Use vendored progress bar lib in 'add'
2015-01-23 18:29:30 -08:00
7b4de230eb commands: Refactored Command#Run function signature to (req Request, res Response) 2015-01-23 18:29:29 -08:00
31ae178078 commands: Support outputting <-chan interface{} 2015-01-21 04:28:02 +00:00
b91db68056 update pinning to new semantics, and fix a couple bugs 2015-01-21 04:28:01 +00:00
920ddc7fc3 Merge pull request #553 from jbenet/serial-file
Serial File Opening
2015-01-13 23:30:08 -08:00
70adc21d08 core/commands: Enable stdin arguments for 'add' and 'cat', resolves #542 2015-01-13 22:51:10 -08:00
7a579bbf79 commands: Moved files code into 'commands/files' subpackage 2015-01-13 22:50:53 -08:00
6236ef7fdb core/commands: Made add command output a channel
core/commands: Don't use pointers for Type field
2015-01-06 15:55:16 -08:00