206 Commits

Author SHA1 Message Date
Joonas Koivunen
5534fef2b8 refactor: wrap_in_directory => wrap_with_directory
just aligning the terminology and trying not to invent new terms.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
14112c3dca feat: /add?wrap_with_directory=true
previous implementation included "defaulting the name for the wrapper
dir" which was extra and not expected by the interface tests.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
65acedae1d fix: normalize prefix slash away to enable more tests 2020-08-07 15:06:55 +03:00
Joonas Koivunen
4077de1a0f fix: report adderrors so that js-ipfs-http-client errors
the mechanism is to just push a new line of MessageResponse. it's a
hack, but at least the js-ipfs-http-client fails.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
57737b49c6 refactor: detupleify into (Owned)?TreeNode 2020-08-07 15:06:55 +03:00
Joonas Koivunen
548dbe2873 chore: appease clippy
single while let Some(_) = ... changed to is_some().
2020-08-07 15:06:55 +03:00
Joonas Koivunen
bb9555b14e doc: explain anyhow dependency 2020-08-07 15:06:55 +03:00
Joonas Koivunen
f0bb5b41fd feat: create empty directories without metadata
this is the go-ipfs 0.5 level support for add and directories. next up
will be parsing the headers as unixfsv1.5 metadata and using those with
the directories *and* files.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
ccd6bbe248 feat: build directory trees on /add 2020-08-07 15:06:53 +03:00
Joonas Koivunen
c59a4cbe22 refactor: try make /add streaming 2020-08-07 15:05:05 +03:00
ljedrz
d2016f0193 fix: use tokio::test in http instead of its async_std counterpart
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-07 09:27:15 +02:00
bors[bot]
b99288b7b1
Merge #290
290: Some maintenance r=koivunej a=ljedrz

Some maintenance work so as not to conflict too much with the pending PRs:
- depend on cid instead of libipld where only Cid is used
- update the `domain` dep (big `Cargo.lock` wins)

cc #75 

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-06 13:23:45 +00:00
ljedrz
f5f6790062 chore: depend on cid instead of libipld where only Cid is used
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 11:38:27 +02:00
Joonas Koivunen
5b6b5ddb1b fix: update async-stream to 0.3
this uses the rust 1.45 features to remove recursion inside the macro.
great for #284 which adds even more complicated async-stream(s).
2020-08-06 11:10:07 +03:00
Caio
94d9b0a358 Future-proof unused dependencies 2020-08-01 13:44:27 -03:00
Caio
d3bd3f649f Use default-features = false where applicable 2020-08-01 13:29:48 -03:00
bors[bot]
c6b68cc0fa
Merge #272
272: Split Entry into two different enums to remove unnecessary expects r=koivunej a=c410-f3r

Second take on #200 

`Entry` is now composed of `Bucket(...)` and `Metadata(MetadataEntry { ... })` to separate things that have and doesn't have metadata, which avoids returning optional values derived from a single entry-point.

Next PR will address the newly introduced double matching while iterating over `continue_walk` but it will require deeper logical changes.

Co-authored-by: Caio <c410.f3r@gmail.com>
2020-07-31 12:39:16 +00:00
Caio
1f8cd25fd9 Split Entry into two different enums 2020-07-31 08:39:47 -03:00
ljedrz
e820e7a5e8 feat: keep a node's Span instead of its name
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 17:32:25 +02:00
ljedrz
0abe1b4aa4 refactor: improve node init in some tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 15:59:14 +02:00
ljedrz
0140c673b8 feat: attach tracing to nodes
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 14:53:38 +02:00
ljedrz
a284c1f841 feat: replace log with tracing
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-29 14:50:00 +02:00
ljedrz
3b6ad52d85 chore: update remaining deps
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-28 13:44:45 +02:00
bors[bot]
f60ac1a8c2
Merge #267
267: ci: use vcpkg for openssl on windows r=ljedrz a=koivunej

Hoping to find something to help with #261:
 - switch to using [lukka/run-vcpkg](https://github.com/lukka/run-vcpkg)
 - get rid of the llvm dependency on windows (it was not needed)
 - update openssl dep to 0.10.30

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2020-07-28 10:50:00 +00:00
Joonas Koivunen
2bd1f588a0 chore: update openssl dep 2020-07-28 13:34:25 +03:00
bors[bot]
9e491a68f3
Merge #259
259: Multihash-based repo r=koivunej a=ljedrz

We currently have an ad-hoc `Cid`-upgrading mechanism in place for the legacy `v0` version that is complicated and error-prone; when working on the `SubscriptionRegistry` I had to disable some of those upgrades, but some of them were still applied in the `Repo` (and necessary in order for the conformance tests to pass), making it hard to work on further functionalities like content discovery.

The solution I came up with is to introduce a `RepoCid` wrapper in order to make the keys in `Repo` objects operate on the associated `Multihash` instead of the whole `Cid`. Changing them to plain `Multihash`es wouldn't work, as we are still expected to return `Cid`s for the purposes of e.g. `Ipfs::local_refs` and I'm pretty sure some of the conformance tests still expect the full `Cid` to be available.

The only drawback is some extra `clone()`ing, but the improvement in code clarity and the unblocking of further changes is well worth it. This change also simplifies one of our conformance test patches (local refs).

~~I'm marking this PR as a draft in hopes that I can still come up with some solution to the extra cloning.~~ This is hard; I'm not able to do this at the moment, but this shouldn't be a blocker.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-07-28 07:30:09 +00:00
Caio
1107b29114 Rustfmt 2020-07-27 13:16:54 -03:00
Caio
e42b88c6a6 Use async macro for tests 2020-07-27 13:00:40 -03:00
ljedrz
7201b1b82f fix: adjust test_inner_local
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-23 13:58:49 +02:00
ljedrz
b41490fe31 fix: classic Default::default() fun plus remove explicit kad protocol names
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 15:47:25 +02:00
ljedrz
ff1765ba10 fix: remove unused params in Node::new and IpfsOptions::inmemory_with_generated_keys
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 15:35:25 +02:00
ljedrz
e2297fd53a fix: update a few tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 13:31:46 +02:00
ljedrz
3bb0a65e04 feat: add and test peer discovery
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 12:00:56 +02:00
ljedrz
cc26f40d14 feat: update libp2p again
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-21 14:50:06 +02:00
ljedrz
88c7219790 feat: update some dependencies
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-21 10:31:55 +02:00
Joonas Koivunen
d20a84b164 add: at least some shutdown logging 2020-07-20 13:36:09 +03:00
bors[bot]
d207d1aac6
Merge #240
240: Initial file add r=koivunej a=koivunej

Adds initial file adding through `/add` interface. Does very little of else.

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2020-07-16 07:49:14 +00:00
Joonas Koivunen
eb58d7b898 fix: single file add test case 2020-07-16 10:18:07 +03:00
Joonas Koivunen
4c58cfc12b refactor: learn about the /add progress, document 2020-07-14 17:15:28 +03:00
Joonas Koivunen
63056a5d82 fix: clippy, avoid a clone 2020-07-14 17:13:49 +03:00
Joonas Koivunen
152086f146 fix: hook the /add impl up 2020-07-14 16:50:25 +03:00
Joonas Koivunen
d54b3b78fa chore: minor reformatting for multipart body 2020-07-14 16:09:19 +03:00
Joonas Koivunen
cfec7584b6 feat: single file /add
doesnt really handle anything gracefully yet.
2020-07-14 16:09:02 +03:00
ljedrz
23ee954bc1 perf: don't use format! where to_string() is enough
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-13 15:43:42 +02:00
Joonas Koivunen
a890964a39 chore: use released mpart-async 2020-07-10 09:31:09 +03:00
bors[bot]
4e6fbdbc58
Merge #233
233: Add http timeouts r=ljedrz a=koivunej

Related to #228, this adds timeout handling to:

 * `block/get`
 * `dag/resolve`
 * `refs` (partial)
 * `cat` (partial)
 * `get` (partial)

Partial means only the initial step of at minimum path walking has the timeout. We cannot yet return errors from streamed bodies because of the lack of `Trailer` support in hyper, so no "request timeout" is enforced once we get to streaming the body.

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2020-07-09 15:15:39 +00:00
Joonas Koivunen
f75af14d3f
doc: fix typos
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-07-09 18:13:49 +03:00
Joonas Koivunen
d00eb829f9 refactor: simplify maybe_timeout 2020-07-09 18:12:48 +03:00
Joonas Koivunen
a7e10a17d8 doc: StringSerialized, add deref(mut)? 2020-07-09 17:52:47 +03:00
Joonas Koivunen
741d81a7ba refactor: inline StatResponse 2020-07-09 17:31:16 +03:00