Commit Graph

11097 Commits

Author SHA1 Message Date
Whyrusleeping
0461716b3b
Merge pull request #5200 from ipfs/fix/5197
fix dht commands when pubsub routing is enabled
2018-07-09 01:41:31 -07:00
Spartucus
6f08c9e466
Refactor code
Keep the code style consistent. since all package alias are lowercase words, no need Camel Peak Name.

License: MIT
Signed-off-by: Spartucus <niubob@163.com>
2018-07-09 16:36:01 +08:00
Steven Allen
7df7d11199 fix dht commands when pubsub routing is enabled
Instead of checking if Routing is a DHT (because it can now be a tiered
router and still contain a DHT), stash the DHT in a separate field in the IPFS
node (same as we do with the PSRouter).

fixes #5197

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-09 09:58:44 +02:00
Hector Sanjuan
9c8d994c76 remove debug print statement
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-07-08 13:01:54 +02:00
Hector Sanjuan
9d88d2cde8 RepoStat: address review comments
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-07-08 13:01:54 +02:00
Hector Sanjuan
37d4989647 Sharness: add tests for ipfs repo stat --size-only
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-07-08 13:01:46 +02:00
Hector Sanjuan
79b388c690 Feat: use datastore.DiskUsage() and add --size-only to "repo stat"
This makes use of the PersistentDatastore DiskUsage method to
obtain the Repo's storage usage (GetStorageUsage()).

Additionally, the --size-only flag has been added to the
"ipfs repo stat" command. This avoids counting the number of objects
in the repository and returns faster.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-07-08 13:01:46 +02:00
Steven Allen
6a81c72cfb correctly handle multi-hop dnslink resolution
Namesys returns `ErrResolveRecursion` when it stops recursing due to a depth
limit. It doesn't return success.

Alternative to #5199.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-07 00:18:30 -07:00
Steven Allen
cb0ad0d6ce fix starting iptb nodes with additional arguments
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-06 23:33:12 -07:00
Steven Allen
efa4e332e9 update routing helpers to fix an issue in the parallel find providers
See: https://github.com/libp2p/go-libp2p-routing-helpers/pull/3

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-06 23:32:28 -07:00
Lucas Molas
18361d3849 unixfs: remove Get prefix from FSNode accessors
See https://golang.org/doc/effective_go.html#Getters.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-06 13:29:47 -03:00
Lucas Molas
acb9e23163 pbdagreader: use FSNode instead of protobuf structure
Focus on the UnixFS layer and avoid explicit references to protocol buffers
format (used to serialize objects of that layer). Use the `unixfs.FSNode`
structure which it abstracts from the `unixfs.pb.Data` format.

Replace `PBDagReader` field `ftpb.Data` with `ft.FSNode`, renaming it to `file`
(which is the type of UnixFS object represented in the reader) and changing its
comment removing the "cached" reference, as this structure is not used here as a
cache (`PBDagReader` doesn't modify the DAG, it's read-only). Also, removed
unused `ProtoNode` field to avoid confusions, as it would normally be present if
the `FSNode` was in fact used as a cache of the contents of the `ProtoNode`.

An example of the advantage of shifting the focus from the format to the UnixFS
layer is dropping the of use `len(pb.Blocksizes)` in favor of the more clear
`NumChildren()` abstraction.

Added `BlockSize()` accessor.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-06 13:27:18 -03:00
Steven Allen
7fd34048ab explain when a promise can be canceled in pbdagreader
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-05 17:06:50 -07:00
Whyrusleeping
e7938a1834
Merge pull request #5196 from ipfs/release-0.4.16-rc2
Ipfs 0.4.16 release candidate 2
2018-07-05 16:16:30 -07:00
Jeromy
0bde02e59a Ipfs 0.4.16 release candidate 2
License: MIT
Signed-off-by: Whyrusleeping <why@ipfs.com>
2018-07-05 15:39:43 -07:00
Whyrusleeping
48577e0a4c
Merge pull request #5194 from ipfs/fix/5191
when running an external command, only construct a node if running in online mode
2018-07-05 15:10:49 -07:00
Steven Allen
667a9c8999 add test for sharness locking
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-05 14:33:01 -07:00
Steven Allen
b6081be32a only construct a node in online mode when running external commands.
This breaks commands like `ipfs update` that expect IPFS to *not* be running.

fixes #5191

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-05 14:32:44 -07:00
Lucas Molas
6ceb9373c6 dagreader: remove Offset() method
Remove `Offset()` from the `DagReader` interface. It's not part of the Unix API
and it wasn't used anywhere except for the tests (a helper function was added to
replace it).

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-04 23:51:10 -03:00
Lucas Molas
cbc239ce44 sharness: add files ls test (without -l)
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-02 17:17:46 -03:00
Lucas Molas
dfe64980ce cmd: fix files ls to report hash and size for files
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-02 17:17:43 -03:00
Whyrusleeping
7e8f6c9604
Merge pull request #5164 from alfiedotwtf/master
Grammar fix
2018-06-30 00:17:23 -07:00
Lucas Molas
f5e7fe28dd mfs: remove DAGService from Root
The `Root` structure now explicitly contains a `Directory` (instead of an
`FSNode` interface), use that `Directory`'s `DAGService` instead of its own
`dserv` variable (which was used only once in `closeChild()`). The `DAGService`
in the `Root` and the `Directory` was the same (passed as an argument in the
`NewRoot` initializer function).

This leaves the `Root` structure with only a `Directory` and a `Republisher` and
allows to better rethink its role and whether if those two structures should be
grouped together (and if that group's name should be `Root`).

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-06-29 12:08:59 -03:00
Lucas Molas
ba7338543f mfs: remove unused Root variables node and Type
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-06-29 12:06:06 -03:00
Lucas Molas
08922d239d mfs: make Root value a Directory
Make `Root` value explicitly a `Directory` structure instead of the `FSNode`
interface (which also allowed the `File` type). This helps to make the code
easier to reason about: the root of an MFS layout is always a directory, not a
(single) file.

Rename `GetValue()` to `GetDirectory()` to also make it more explicit, the
renamed function now returns a `Directory` so there is no need for type
assertions that were previously done on the `FSNode` interface to check that it
was actually a `Directory`.

`NewRoot()` now doesn't allow to create `Root` structures from DAG nodes that
contain UnixFS files.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-06-29 11:30:53 -03:00
Alfie John
9fd74b3c0a Grammar fix
License: MIT
Signed-off-by: Alfie John <alfie@alfie.wtf>
2018-06-29 11:57:19 +10:00
Whyrusleeping
336520d4ef
Merge pull request #5167 from djdv/fix-addr
add: use file name instead of path name
2018-06-28 12:18:12 -07:00
camelmasa
6da92a1f0a Fix wrong added filename
License: MIT
Signed-off-by: Masahiro Saito <camelmasa@gmail.com>
2018-06-28 09:07:23 -04:00
Whyrusleeping
b183da36f7
Merge pull request #5159 from ipfs/release-0.4.16-rc1
Ipfs v0.4.16-rc1
2018-06-27 19:37:09 -07:00
Steven Allen
5c0dc6a968 test dag reader context cancellation
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-27 17:51:26 -07:00
Steven Allen
ff3efb5646 always prefetch at least 5 blocks ahead
This should reduce stuttering when streaming.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-27 17:51:08 -07:00
Steven Allen
0344e3e602 better handle context cancellations in the PBDagReader
Good: If a previous read is canceled, we cancel the preloads that the read
triggered.
Bad: Future reads at that point will fail.

This fixes that issue.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-27 17:06:30 -07:00
Steven Allen
12719a788f use copy instead of looping
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-27 16:52:57 -07:00
Jeromy
5819868184 Ipfs v0.4.16-rc1
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-06-27 12:34:49 -07:00
Whyrusleeping
f5d810932e
Merge pull request #5158 from ipfs/gx/update
gx update
2018-06-26 17:54:18 -07:00
Steven Allen
780f110aad add test for /p2p addresses
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-26 17:11:40 -07:00
Steven Allen
3eba14aa24 gx update
Updates:

* go-kad-dht: Query performance improvements, DHT client fixes, validates
  records on *local* put.
* go-libp2p-swarm/go-libp2p-transport: Timeout improvements.
* go-multiaddr-net: Exposes useful Conn methods (CloseWrite, CloseRead, etc.)
* go-log: fixes possible panic when enabling/disabling events.
* go-multiaddr: fixes possible panic when stringifying malformed multiaddrs,
  adds support for consuming /p2p/ multiaddrs.

fixes #5113
unblocks #4895

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-26 17:11:33 -07:00
Whyrusleeping
ad83b6fa2d
Merge pull request #5114 from ipfs/fix/fix-dht-tests
fixup DHT sharness tests
2018-06-26 13:43:08 -07:00
Whyrusleeping
ecf7d157a6
Merge pull request #5116 from ipfs/fix/offline-routing-validate
add record validation to offline routing
2018-06-25 19:15:06 -07:00
Steven Allen
384e2c40b2 add a failing test case for calling dht put with a bad key
see #5113

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-25 18:15:33 -07:00
Steven Allen
6112150d04 fix dht sharness tests
We can't currently put binary values due to API limitations. This worked before
because the DHT wasn't checking values on local put.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-25 18:15:33 -07:00
Steven Allen
352ec3561c add record validation to offline routing
fixes #5115

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-25 18:14:25 -07:00
Whyrusleeping
777d306f6e
Merge pull request #5144 from ipfs/fix/5143
explicitly import go-multiaddr-dns in config/bootstrap_peers
2018-06-25 17:55:53 -07:00
Whyrusleeping
be20903673
Merge pull request #5137 from Mr0grog/docs/5136-resource-requirements
Add system requirements to README
2018-06-22 11:14:58 -07:00
Steven Allen
cf2be45873 explicitly import go-multiaddr-dns in config/bootstrap_peers
We need it to parse the dnsaddr addresses. While we import it elsewhere, we
should really be importing it every where we need it so that other users can
import our packages directly.

fixes #5143

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-06-21 14:35:43 -07:00
achingbrain
3cdaea663c feat: Allow specifing how object data is encoded
Adds a --data-encoding flag to `ipfs object get` to let the user
specify base64 encoding for object data.

License: MIT
Signed-off-by: Alex Potsides <alex@achingbrain.net>
2018-06-19 16:37:45 +01:00
Rob Brackett
215443c495
Add system requirements to README, fixes #5136
License: MIT
Signed-off-by: Rob Brackett <rob@robbrackett.com>
2018-06-18 16:50:58 -07:00
Whyrusleeping
2a9de81e64
Merge pull request #5071 from ipfs/feat/ci/archive-trash-dirs
ci: Archive sharness trash dirs
2018-06-18 02:06:31 +08:00
Whyrusleeping
ebb040aa65
Merge pull request #5125 from ipfs/fix/5099
make republisher test robust against timing issues
2018-06-18 01:59:24 +08:00
Whyrusleeping
b516aa1c31
Merge pull request #5122 from ipfs/kevina/filestore-hookup-fix
Fix how filestore is hooked up.
2018-06-18 01:56:52 +08:00