Commit Graph

1103 Commits

Author SHA1 Message Date
bors[bot]
015d81cc6e
Merge #329
329: Implement /dht/query r=ljedrz a=ljedrz

Builds on https://github.com/rs-ipfs/rust-ipfs/pull/328, only the last commit is new.

Implement the `/dht/query` endpoint; most of the functionality was already there, as it appears this is just what `Kademlia::get_closest_peers` provides.

Blocked by https://github.com/rs-ipfs/rust-ipfs/pull/328.


Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-21 13:35:28 +00:00
bors[bot]
e68f577f1c
Merge #328
328: Implement /dht/findprovs and /dht/provide r=ljedrz a=ljedrz

Builds on https://github.com/rs-ipfs/rust-ipfs/pull/323, the first 2 commits belong to that one.

Adds `/dht/findprovs` and `/dht/provide` HTTP endpoints conforming to the [IPFS HTTP API](https://docs.ipfs.io/reference/http/api/). Not sure we should be returning the full JSON described there, which I commented on, but the new functionality is there and the test passes nicely.

Blocked by https://github.com/rs-ipfs/rust-ipfs/pull/323.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-21 13:16:51 +00:00
bors[bot]
b9d611cd7f
Merge #323
323: make dht/findpeer search the non-local DHT if necessary r=koivunej a=ljedrz

As promised in https://github.com/rs-ipfs/rust-ipfs/pull/320, this follow-up implements an "active" DHT search as a fallback for the initial local-only mechanism and updates the existing test to properly verify that this works.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-21 12:49:50 +00:00
bors[bot]
c6c6d176ff
Merge #330
330: Update pull_request_template.md r=ljedrz a=aphelionz

This PR updates the pull_request_template.md so that it contains rules we can all adhere to

Co-authored-by: Mark Robert Henderson <henderson.mark@gmail.com>
2020-08-21 12:11:07 +00:00
Mark Robert Henderson
370150bf0a
Update pull_request_template.md 2020-08-21 07:51:50 -04:00
ljedrz
d84d64cdc9 feat: implement /dht/query (i.e. get_closest_peers)
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-21 13:23:47 +02:00
ljedrz
6d2cdb71f2 test: check the DHT provide and get_providers functionalities
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-21 12:51:35 +02:00
ljedrz
c4b9358d7e docs: comment on some /dht features
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-21 11:20:13 +02:00
ljedrz
7f7ef95f1f feat: implement /dht/provide
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-21 11:17:14 +02:00
Mark Robert Henderson
e3bd63aa49
Moving PR template to ./github/pull_request_template.md (#326)
* move pull_request_template.md

-- Committer note: no reason to bother bors with this, also trying out if anything breaks by doing a github ui merge.
2020-08-20 22:31:29 +03:00
bors[bot]
8d7caf3cca
Merge #325
325: Rename pull-request-template.md to pull_request_template.md r=koivunej a=aphelionz

This PR renames the PR template so that it will actually show up

Co-authored-by: Mark Robert Henderson <henderson.mark@gmail.com>
2020-08-20 19:06:12 +00:00
Mark Robert Henderson
4cfd5d16af
Rename pull-request-template.md to pull_request_template.md
This PR renames the PR template so that it will actually show up
2020-08-20 15:05:05 -04:00
ljedrz
3e2e09ee8c feat: implement /dht/findprovs
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-20 19:18:02 +02:00
ljedrz
a33ee5fe09 feat: make dht/findpeer search the non-local DHT if necessary
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-20 19:05:50 +02:00
ljedrz
cb534f9a4d feat: improve the find_peer_dht test
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-20 12:38:08 +02:00
bors[bot]
140a86bdcc
Merge #320
320: Implement Ipfs::find_peer and /dht/findpeer r=koivunej a=ljedrz

Builds on https://github.com/rs-ipfs/rust-ipfs/pull/319, only the last 2 commits are new.

Introduces `Ipfs::find_peer` and `/dht/findpeer` that return addresses belonging to the given `PeerId`; if they are connected to already, the values are returned right away, otherwise the local DHT records are checked.

Blocked by https://github.com/rs-ipfs/rust-ipfs/pull/319.



Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-20 10:18:15 +00:00
bors[bot]
4f762446f7
Merge #321
321: fix: make ipfs-http to use ipfs::IpfsPath r=ljedrz a=koivunej

First step towards solving the #238 

- fix `ipfs::IpfsPath`
  - swapped `ipfs::path::SubPath` for `String` (commit has reason)
  - removed `IpfsPath::push(&mut self, segment: impl Into<SubPath>)`
  - remove the implicit ending empty path segment (seemed intentional, don't know why that was there)
  - migrate tests
    - most notably add support for `cid/a/b/c` cases
    - move "good_but_unsupported" over to "good_paths" (as ipfs::IpfsPath validates more)
- make ipfs-http use `ipfs::IpfsPath`

This specifically doesn't include:

- separation of different kinds of IpfsPaths (`CidPath`, `IpnsPath`)
  - instead there is currently an expect over at http side for cid paths
- probably a good idea to refactor out the `Vec<String>` (sub)path somehow; it might be heavily reusable for unixfs for example
- moving the resolving over to ipfs from the current not so great `ipfs_http::v0::refs::walk_paths` 

These should be handled on next PRs. The end result here is not too pretty but it shouldn't break much either.

Big unsolved mysteries:

- how to implement conformance test compatible refs once this has been moved over to ipfs (probably need to adjust the test)

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-08-20 09:12:49 +00:00
ljedrz
4f2ffe702e
perf: reorder checks to maximize short-circuiting speed
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2020-08-20 10:12:00 +02:00
bors[bot]
19abc0bc5d
Merge #322
322: ci: update run-vcpkg (get windows caching) r=ljedrz a=koivunej

according to commits there have been some changes related to caching,
unable to determine if they actually fix anything.

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2020-08-20 07:09:18 +00:00
Joonas Koivunen
586520e043 ci: remove commented out parts (rerun) 2020-08-20 09:30:37 +03:00
Joonas Koivunen
6d88f12c4a ci: update run-vcpkg (hope for caching)
according to commits there have been some changes related to caching,
unable to determine if they actually fix anything.
2020-08-20 08:55:16 +03:00
Joonas Koivunen
61b8b6ff1e doc: note reason for strange structuring 2020-08-19 21:56:34 +03:00
Joonas Koivunen
d75ea86685 chore: clippy 2020-08-19 21:50:52 +03:00
Joonas Koivunen
714ecaf093 refactor: remove http IpfsPath and tests 2020-08-19 21:49:07 +03:00
Joonas Koivunen
a57b11ba77 refactor: http: switch to ipfs::path::IpfsPath 2020-08-19 21:49:07 +03:00
Joonas Koivunen
a597c0201a refactor: drop IpfsPath::push in ipfs 2020-08-19 21:49:07 +03:00
Joonas Koivunen
2731c2eac1 refactor: migrate path parsing test cases over 2020-08-19 21:49:07 +03:00
Joonas Koivunen
fa652784d5 refactor: remove walk options from http::IpfsPath
definitely wrong place to have those options, and those should have test
cases, since the defaults were ... mixed.
2020-08-19 21:49:07 +03:00
Joonas Koivunen
ba81695178 doc: add FIXME for bad visited usage 2020-08-19 21:49:07 +03:00
Joonas Koivunen
9182ff4d6a doc: update stale FIXME into different FIXME 2020-08-19 21:49:07 +03:00
Joonas Koivunen
3935cf0c49 refactor: remove WalkSuccess::EmptyPath 2020-08-19 21:49:07 +03:00
Joonas Koivunen
ff4037db73 refactor: remove unused pub method 2020-08-19 21:49:06 +03:00
Joonas Koivunen
af8870aaae refactor: remove commented out code 2020-08-19 21:49:06 +03:00
Joonas Koivunen
e0c3a81672 refactor: align paths on the ipfs side 2020-08-19 21:49:06 +03:00
Joonas Koivunen
9ab014f487 refactor: remove warning on ipfs::path::IpfsPath 2020-08-19 21:49:06 +03:00
Joonas Koivunen
960ba71a23 refactor: ipfs-http path towards ipfs::path::IpfsPath
first step, lot of commented out code left behind. it was definitely bad
idea to mix the IpfsPath and the iteration over that path.
2020-08-19 21:49:06 +03:00
Joonas Koivunen
a6918d9413 doc: note the refs timeout test case 2020-08-19 21:49:06 +03:00
Joonas Koivunen
07d7adfaea refactor: fix back resolving plain iplds 2020-08-19 21:49:06 +03:00
Joonas Koivunen
81644418ef fix: replace SubPath with String
we cannot really do upfront parsing of subpaths to indices or strings
since ipld maps can contain stringified numbers as keys, so we dont know
if something is a key into map or vec index by looking at the path.
2020-08-19 21:48:58 +03:00
bors[bot]
e75103f890
Merge #319
319: Introduce KadResult r=koivunej a=ljedrz

I've been planning to add some of the `/dht` functionalities and since it looks like it's going to be a bit complicated, I'd like to split these upcoming changes into meaningful bits.

First up: the ability to get results from `Kademlia`'s `SubscriptionRegistry`. While working on this I noticed that some of the results can be provided multiple times (e.g. `BootstrapOk` that indicates the number of peers left to bootstrap against), which should solve the mystery of `Kademlia` not adhering to the `debug_assert` we have in `SubscriptionRegistry::finish_subscription`.

As an accidental drive-by there's also a fix to the `Kademlia` bootstrap test which was silently failing after we introduced the `Multiaddr` wrappers.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-19 16:33:27 +00:00
bors[bot]
91d696525e
Merge #318
318: Update libp2p and use TokioMdns r=koivunej a=ljedrz

`libp2p 0.24` enables us to only depend on a single async executor (in our case, `tokio`).

A small change in the code, a big win for `Cargo.lock`.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-19 16:16:44 +00:00
ljedrz
32815129f1 feat: introduce /dht/findpeer
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 16:51:43 +02:00
ljedrz
e397a0a213 feat: introduce Ipfs::find_peer
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 15:59:26 +02:00
ljedrz
8489557fc7 chore: improve dht bootstrap logging
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 12:37:55 +02:00
ljedrz
5fdc4bd45d chore: downgrade SubscriptionRegistry::shutdown logs
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 12:20:37 +02:00
ljedrz
39d6459d6e fix: fix the kademlia bootstrapping test (post-Multiaddr-wrapper fallout)
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 11:54:54 +02:00
ljedrz
aa053c6cfa fix: only finish Kad subscriptions that are actually over
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 10:58:53 +02:00
ljedrz
e9695a39cf feat: allow Kademlia to return query results
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 10:13:23 +02:00
ljedrz
eb9a8f2e5e feat: update libp2p and use TokioMdns
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-19 09:35:35 +02:00
bors[bot]
34205806a9
Merge #315
315: Use explicit Multiaddr wrappers r=koivunej a=ljedrz

Whether a `Multiaddr` contains `Protocol::P2p` (i.e. essentially `/p2p/PeerId`) or not has a lot of bearing on conformance tests, the internal object and APIs and error-handling. Since it is easy to introduce related human errors, it would be a good idea to enforce some type safety here by introducing 2 wrapper objects: `MultiaddrWoPeerId` and `MultiaddrWithPeerId`.

The extent to which they should be applied (in lieu of `Multiaddr`) is a matter for discussion - in my initial attempt I decided to apply them quite liberally, as it results in more type safety (there are still a few plain `Multiaddr`s left though).

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-18 16:53:28 +00:00