Commit Graph

278 Commits

Author SHA1 Message Date
ljedrz
8c92c34d44 perf: remove an unneeded map presence check
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-06-29 12:10:23 +02:00
bors[bot]
008693fcd1
Merge #210
210: A round of cleanups r=koivunej a=ljedrz

Assorted drive-by cleanups and small refactorings; individual commits describe the specific changes.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-06-29 08:43:47 +00:00
Joonas Koivunen
50ae390e66 fix: return "n/a" in verbose swarm peers response
this follows the lead of js-ipfs with the "n/a".
2020-06-26 18:17:42 +03:00
ljedrz
a8103cb14c refactor: simplify a From impl for PubsubHttpApiMessage
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-06-26 15:27:07 +02:00
ljedrz
2603532027 refactor: make pubsub methods move their params
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-06-26 15:11:05 +02:00
ljedrz
8c89714da9 refactor: simplify one match expression
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-06-26 15:11:05 +02:00
Joonas Koivunen
d1cd15b4ec
Merge pull request #193 from eqlabs/fix_use_tempfile
fix test using non-unique tempfile
2020-06-18 01:16:08 +03:00
Joonas Koivunen
3ba5ddf1a3 fix test using non-unique tempfile 2020-06-18 00:55:11 +03:00
Joonas Koivunen
22aaec2377 refactor: remove unshared use
unshare was required as hyper was forced to require the body stream to
be Sync due to compiler issue while it was not really needed. Latest
hyper now has this workaround built-in.
2020-06-17 23:07:39 +03:00
Joonas Koivunen
27085b3095 chore: update hyper and warp to latest 2020-06-17 23:07:39 +03:00
Joonas Koivunen
3bfa506f69 refactor: suggestions from code review
Including mostly comment fixes and removal of an extra &mut.

Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-06-17 17:27:05 +03:00
Joonas Koivunen
9aa9322a33 refactor: remove unused warnings on windows 2020-06-17 17:27:05 +03:00
Joonas Koivunen
24e4c4da42 chore: cargo fmt 2020-06-17 17:27:05 +03:00
Joonas Koivunen
0d2dd477e9 doc: refresh and check out cargo docs 2020-06-17 17:27:05 +03:00
Joonas Koivunen
c874e1165a fix: windows build 2020-06-17 17:27:05 +03:00
Joonas Koivunen
6be2556341 chore: cargo fmt 2020-06-17 17:27:05 +03:00
Joonas Koivunen
f5ada8728d add(http): multiblock file /get test
this does not hit the buffer cycling cases but hits all other file
cases.
2020-06-17 17:27:05 +03:00
Joonas Koivunen
7e0fcd05b3 refactor(http): more /get test support 2020-06-17 17:27:05 +03:00
Joonas Koivunen
bd6a974db5 refactor: simplify to simple buffer in TarHelper
two buffers would allow better reusing, but only with concurrency.
2020-06-17 17:27:05 +03:00
Joonas Koivunen
6eb276eb28 add: test /get for long and file names 2020-06-17 17:27:05 +03:00
Joonas Koivunen
9151834ba3 chore: cleanup warnings, fmt 2020-06-17 17:27:05 +03:00
Joonas Koivunen
350bb9ccf7 fix: hopefully get windows compiling 2020-06-17 17:27:05 +03:00
Joonas Koivunen
92cc2ab353 fix panicing with long link names 2020-06-17 17:27:05 +03:00
Joonas Koivunen
6a96593866 refactor: make Walker easier to use
turns out the internal structure almost supported this already, but
`self.current` needed to be done an Option.
2020-06-17 17:27:05 +03:00
Joonas Koivunen
e25a23380c refactor: split tar helper to own module 2020-06-17 17:27:05 +03:00
Joonas Koivunen
f71c212edd chore: fmt and clippy warnings 2020-06-17 17:27:05 +03:00
Joonas Koivunen
948eeff48f refactor: rename FileMetadata to ipfs_unixfs::Metadata 2020-06-17 17:27:05 +03:00
Joonas Koivunen
9b18427e16 refactor: move ipfs_unixfs::dir::walk to top level 2020-06-17 17:27:05 +03:00
Joonas Koivunen
d61b0424d8 fix: use errors instead of unwraps in /get as well 2020-06-17 17:27:05 +03:00
Joonas Koivunen
7feededa81 fix: refs must use new ipfspath.follow_dagpb_data 2020-06-17 17:27:05 +03:00
Joonas Koivunen
3da2bc7028 fix: last cat conformance test failure 2020-06-17 17:27:05 +03:00
Joonas Koivunen
07ae552634 doc: add comments to tar export 2020-06-17 17:27:05 +03:00
Joonas Koivunen
cbd2d4a992 feat: add follow_dagpb_data option to ipfspath 2020-06-17 17:27:05 +03:00
Joonas Koivunen
8ada8370c4 fix: get walking interop tests to complete 2020-06-17 17:27:05 +03:00
Joonas Koivunen
6671e74113 feat: /get http endpoint
does not at all pass any tests. we need to add a root path param, which
will be a string version of the requested Cid for the http api. Also,
with this, it becomes possible to hide everything (files, symlinks)
under a single walk api.
2020-06-17 17:26:39 +03:00
Joonas Koivunen
169be7b562 refactor: extract special dagpb handling out 2020-06-11 19:10:46 +03:00
Joonas Koivunen
38e41ff79d
Apply suggestions from code review
Forgot this from the first batch..

Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-06-11 19:09:47 +03:00
Joonas Koivunen
d5be60249c
Apply suggestions from code review
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-06-11 18:55:02 +03:00
Joonas Koivunen
38b7e4bd61 doc: add comments for the long function 2020-06-11 17:20:19 +03:00
Joonas Koivunen
6102488e23 chore: cargo fmt 2020-06-11 16:54:05 +03:00
Joonas Koivunen
31b30cddf5 fix: load the block always on walk_paths
this was a curious bug: to pass the test on interface-ipfs-core we need
to be still loading the first block and we must not be on the stream
phase. apparently the http cancellation works differently depending on
whether any response headers have been sent or not as the test fails if
the headers and cancelled error is sent.

the issue of returning either an loaded raw block or possibly projected
Ipld value was solved by introducing yet another enum Loaded. I did
consider `Either` from crate either, and `Result<Box<[u8]>, Ipld>` but
the custom enum at least allows us to write a documentation story what
the alternatives represent.
2020-06-11 16:48:43 +03:00
Joonas Koivunen
2d99d1aed2 fix: adjust default log levels with the addition of a crate 2020-06-11 16:48:20 +03:00
Joonas Koivunen
5fed9c5220 chore: cargo fmt 2020-06-11 13:45:57 +03:00
Joonas Koivunen
b65f6b7590 fix: handle corner case gracefully in walk_path
also: the walk_path should become ipfs::resolve(IpfsPath).
2020-06-11 13:44:57 +03:00
Joonas Koivunen
da7f2b4882 fix: get dag tests passing again
the remaining issue is how to handle the path resolving for the ugly
error mangling case...
2020-06-11 13:03:40 +03:00
Joonas Koivunen
392840c0ad chore: cargo fmt 2020-06-10 20:32:58 +03:00
Joonas Koivunen
0aca44906e refactor: move test case over to ipfs-unixfs 2020-06-10 20:32:58 +03:00
Joonas Koivunen
819d8ebc53 fix: resolve ipfspaths with ipfs-unixfs on dag-pb
dag-pb can have HAMT sharded directories which don't at least directly
translate over to IPLD.
2020-06-10 20:32:58 +03:00
Joonas Koivunen
4bdce1d273 add initial version of /cat endpoint
this passes 9/13 tests in the interface-ipfs-core.
2020-06-09 12:27:57 +03:00
Joonas Koivunen
d9a273fc9b refactor: unify StreamResponses
these were simply forgotten behind, which lead to responses returning
different headers.
2020-06-09 12:10:55 +03:00
Joonas Koivunen
3f7e25491f
Merge pull request #179 from eqlabs/fix-links
Fix links
2020-06-08 15:49:12 +03:00
Joonas Koivunen
fc37f6903f doc: add why recursion_limit is specified 2020-06-08 15:03:34 +03:00
Joonas Koivunen
c23ad56836 fix: s/ipfs-rust/rs-ipfs 2020-06-08 14:22:03 +03:00
Joonas Koivunen
ad4601a37d fix: add T: Send bound for Unshared<T>
not exactly sure how critical this is, but all of the thinking which was
done for "is this Stream impl ok" was based on the assumption that the
Unshared value was Send, as it was but this was never added as a bound.
2020-04-21 06:55:05 -04:00
Joonas Koivunen
0ee98a4c08 fix: decrease ipfs-http compilation times 50%
by boxing the filters on debug builds.
2020-04-18 19:26:29 -04:00
Mark Robert Henderson
a2f32f0b59 Update refs.rs 2020-04-18 09:13:47 -04:00
Mark Henderson
4e33eabccb fix: minor refs/local and block/rm bugs 2020-04-18 09:13:47 -04:00
Mark Henderson
f4cc4a5a5c feat: /block/rm endpoint
Adding list to BlockStore trait and cleanup support

Adding list functionality and tests

wip dag put

Update Cargo.toml

Co-Authored-By: Joonas Koivunen <joonas.koivunen@gmail.com>

Delete config

fix: switching back to Vecs

feat: adding list functions to repo and ipfs

feat: working endpoint

fix: more sane newline adding

fix: clippy

fix: cargo fmt

wip: block.rm

cargo fmt

Delete refs.rs

Update lib.rs

Update fs.rs

Update v0.rs

Update v0.rs

Update fs.rs

Update mod.rs

Update mem.rs

Update mem.rs

WIP

fix: removing to_owned

WIP: Got it working but need to implement unshared and then clean up

WIP: Compiling, but empty results probably due to clone

fix: cargo fmt

feat: new result enums and implementation

fix: cargo fmt

wip: 5/8 passing tests, need options and cid in errors

wip: PR comments

fix: last test passing 🎉

fix: cargo fmt

fix: clippy and fmt

chore: socializing things

fix: adding support folder

fix: redundant clone

chore: move HandledErr

chore: fmt and TODO removal

fix: clippy

fix: cargo fmt and clippy

chore: moving to block/options.rs

fix: otiginal Cid

fix: tests

fix: clippy tests
2020-04-17 15:51:01 -04:00
Joonas Koivunen
7994ae1c81 fix: list will now always return cidv1
the test case expected mixed cidv0 and cidv1... I didn't see it coming,
and it's quite unfortunate that we cannot support both, but at the same
time I think the end result is ok.
2020-04-17 16:19:03 +03:00
Joonas Koivunen
26f2146d11 refactor: doc upcoming features and last failing test 2020-04-17 16:19:03 +03:00
Joonas Koivunen
2a31185937 refactor: doc and remove empty path special case 2020-04-17 16:19:03 +03:00
Joonas Koivunen
aa7743af9c wip: we need a new block get call
dag.resolve isn't supposed to start fetching any blocks.
2020-04-17 16:19:03 +03:00
Joonas Koivunen
bff0534725 fix: resolve Data and Links under dag-pb2ipld nodes 2020-04-17 16:19:03 +03:00
Joonas Koivunen
efff60a41c wip: initial hack of dag.resolve 2020-04-17 16:19:03 +03:00
Joonas Koivunen
f080ac9056 fix: dag.put create cidv0 for dagpb with sha2-256 2020-04-17 16:19:03 +03:00
Joonas Koivunen
158d36ba16 chore: cargo fmt again 2020-04-16 22:13:14 -04:00
Joonas Koivunen
0ed641c705 refactor: remove clippy warnings
it is quite difficult to remember the --workspace --tests parameters..
2020-04-16 22:13:14 -04:00
Joonas Koivunen
114638be4b fix: use correct query param name
this gets us to pass all conformance tests for dag.put.
2020-04-16 16:46:54 +03:00
Joonas Koivunen
4269887cb2 chore: cargo fmt 2020-04-16 16:40:40 +03:00
Joonas Koivunen
1ea02418a5 refactor: get rid of clippy warnings 2020-04-16 16:40:40 +03:00
Joonas Koivunen
79985e4140
Add refs endpoint (#147)
A lot of code but going back and forth as well.

* fix: request logger name for good

* wip: initial broilerplate

* feat: ipfspath parsing and walking

* refactor: rewrite to walk the path before streaming

* fix: handling 0 for ipld link

* wip: get first tests to pass

still need to figure out the Send + Sync + 'static bound, issue is with
Sync, which might come from the refs used, get_block(&cid)..

this required some unsafety to be able to present the Stream as Send +
Sync + 'static as required by hyper. not 100% sure if that pin_project
is ok to do, but the only interfaces exposed are callable as futures so
it shouldn't be too bad.

* feat: format string support
* add: manual RefsOptions deserialization to have multiple `arg`

* fix: resolve multiple paths

I had not originally noticed that we need to do the walk from multiple
paths.

* add: dag-pb specific ipfspath walking

* add: make IpfsPath better debuggable

* wip: adjust logging

* add: yield ipld parsing failed err's

* add: "specialize" ipld_links for dag-pb

* feat: support visiting unique nodes

* fix: instead of stopping, filter out too deep elements

also, this should be done when expanding the nodes, not at this stage.

* refactor: reorg and document

originally it was easier to write everything to the same file, but it
gets difficult to read after 1000 lines. while reorganising stuff into
more tight modules, some direct calls were changed not to be needed,
like RefsOptions creating the EdgeFormatter; the EdgeFormatter is not
created in the refs function itself.

chopped off parts:

 * RefsOptions stuff to refs/options.rs
 * EdgeFormatter and the string format to refs/format.rs
 * Unshared to refs/unshared.rs
 * HandledErr, StreamResponse to refs/support.rs

* refactor: minor cleanup and docs

* fix: refs tests, enable unique test

* fix: use specific rust-ipld version with cbor fix

the situation is not good, as it would make sense to re-export libipld
from ipfs as parts are already re-exported but with strange names.

* refactor: allow dead_code StringError::new

* refactor: use the Edge for refs-local as well

* chore: cargo fmt and reorder tests

* doc: replace fixme with confirmed

* add: port tests for ipfspath

* fix: unignore good_but_unsupported test

* add: test cases for slash dedup per discussion

* add: walk dag-cbor tests for IpfsPath

* add: dag-pb path walking test

* add: tests for walking over a cbor link

* add: test case for dapb link listing

* fix: refs_local test, move all tests under mod test

* fix: remove unwrap from refs-local

kept the return value as a stream. it'll at least save us the trouble of
concatenating all of the values into a big vector.
2020-04-16 16:39:48 +03:00
Joonas Koivunen
a89ce4be45 chore: cargo fmt missing from master 2020-04-15 09:54:53 -04:00
Joonas Koivunen
97b5817381 refactor: remove unnecessary mut refs
unsure why this isn't picked up by clippy.
2020-04-15 09:54:53 -04:00
Mark Henderson
c8cabd1616 feat: /refs/local endpoint
Adding list to BlockStore trait and cleanup support

Adding list functionality and tests

wip dag put

Update Cargo.toml

Co-Authored-By: Joonas Koivunen <joonas.koivunen@gmail.com>

Update Cargo.toml

Delete config

rustfmt

fix: examples and unused"

fix: switching back to Vecs

feat: adding list functions to repo and ipfs

feat: working endpoint

fix: more sane newline adding

fix: clippy

fix: cargo fmt

fix: inner Result

fix: warp filter chain fixes part 1

fix: HandledErr and some cargo fmt

fix: StringError

removing HandledErr

fix: HandledErr

fix: unwrap placement
2020-04-14 12:26:31 -04:00
Mark Henderson
d3912d511b fix: examples and unused" 2020-04-14 08:04:06 -04:00
Mark Henderson
b6430b56c9 rustfmt 2020-04-14 08:04:06 -04:00
Mark Robert Henderson
63f81b605a Update Cargo.toml 2020-04-14 08:04:06 -04:00
David Craven
028b8074c3 wip dag put 2020-04-14 08:04:06 -04:00
Joonas Koivunen
2af43b4782 refactor: to_vec to into_vec per clippy 2020-04-02 13:04:00 +03:00
Joonas Koivunen
c1b1626399 chore: cargo fmt 2020-04-02 13:04:00 +03:00
Joonas Koivunen
0c9b997ea4 add: http log pid for easier correlation 2020-04-02 13:04:00 +03:00
Joonas Koivunen
f0cbecc92e fix: enable bitswap logging by default 2020-04-02 13:04:00 +03:00
Joonas Koivunen
72ff94cecf wip salvage
This is originally from the non-merging branch by David in
https://github.com/ipfs-rust/rust-ipfs/pull/126.

Co-authored-by: David Craven <david@craven.ch>
2020-04-02 13:04:00 +03:00
Joonas Koivunen
fb6e80b954 add: shutdown to release subscriptionfuts on exit
without this any future created by get_block will never complete, which
will hang http requests with the block api for example.
2020-04-01 14:30:25 +02:00
Joonas Koivunen
6cbf679644
Add pubsub http (#120)
* add: pubsub http api
* add: get shoveling and subscription complications going

currently the missing piece is seeing locally sent messages in the
subscribed streams, then maybe creating a more complicated API for
subscribing which will require a single task for shoveling into the
responses.

* chore: lower timeout to pass the tests

Should probably have another drop sender here.

* fix: close stream on first error

tokio::sync::broadcast will continue after telling how many items were
lost, which seems likely with the small buffer and quickly firing more
than the buffer elements.

* fix: raise the buffer size for subscribe responses
* feat: use custom rust-libp2p to pass tests

the v0.16.2-with-floodsub-opts includes "subscribers see locally
published messages" which is needed for the conformance tests to pass.
this has been PR'd as https://github.com/libp2p/rust-libp2p/pull/1520.

* fix: pubsub test after changing the floodsub impl
2020-03-25 21:42:06 +02:00
Joonas Koivunen
374512a948 fix: stop doing reading common config during tests
IpfsOptions::<T>::default() reads from disk, which I had forgotten when
writing the test case.
2020-03-22 17:49:49 -03:00
Joonas Koivunen
c33b87e8ef refactor: remove extra version fields
Created https://github.com/ferristseng/rust-ipfs-api/issues/46 instead.
2020-03-22 17:48:43 -03:00
Joonas Koivunen
89354e7075 fix: version to contain all fields for tests
incl. additional fields for rust-ipfs-api.
2020-03-22 17:48:43 -03:00
Joonas Koivunen
f624d1f7bd fix: both crate names were wrong by default
This is a leftover from PR #103.
2020-03-22 09:00:49 -03:00
David Craven
07481a65b3 Make mdns togglable. 2020-03-21 12:41:21 -03:00
David Craven
f121a21c81 Implement swarm http api. 2020-03-21 12:41:21 -03:00
Joonas Koivunen
ebcb230d6b refactor: rename rust-ipfs-http to ipfs-http 2020-03-17 11:14:03 +02:00
Joonas Koivunen
9ae816e363 add: README for http 2020-03-17 11:14:03 +02:00
Joonas Koivunen
1f6e081fb9 chore: remove unused arg warnings 2020-03-17 11:08:33 +02:00
Joonas Koivunen
c96c020b79 chore: cargo fmt again 2020-03-17 11:08:33 +02:00
Joonas Koivunen
21a6bbc621 refactor: simplify bounds 2020-03-17 11:08:33 +02:00
Joonas Koivunen
8bf88b972c doc: remove handled notes 2020-03-17 11:08:33 +02:00
Joonas Koivunen
8c7f9a3ce3 refactor: tests under v0::tests 2020-03-17 11:08:33 +02:00
Joonas Koivunen
5661eeb66a refactor: get rid of clippy warning 2020-03-17 11:08:33 +02:00
Joonas Koivunen
2111575c36 chore: cargo fmt 2020-03-17 11:08:33 +02:00
Joonas Koivunen
d13fe11dee refactor: move routes to lib, add tests 2020-03-17 11:08:33 +02:00
Joonas Koivunen
8b1abb3333 fix: log warning instead of eprintln 2020-03-17 11:08:33 +02:00
Joonas Koivunen
fde925f26a refactor: move MessageResp etc under v0::support 2020-03-17 11:08:33 +02:00
Joonas Koivunen
46ae2e2586 chore: clippy and other warnings 2020-03-17 11:08:33 +02:00
Joonas Koivunen
971b30a90b chore: cargo fmt 2020-03-17 11:08:33 +02:00
Joonas Koivunen
a065912219 fix: respond errors in ipfs api fashion
in warp this means recovering from the rejections in some filter chain.
they also need to be done in the order of "detail" to general (not
found, method not allowed) in order to match the most specific first.
2020-03-17 11:08:33 +02:00
Joonas Koivunen
8f4311aef6 fix: use exact path with /shutdown 2020-03-17 11:08:33 +02:00
Joonas Koivunen
5adea41251 wip: wrangle identity into more warpish ways 2020-03-17 11:08:33 +02:00
Joonas Koivunen
d348199568 add: common errors, recover handler
recover handler should be able to transform all errors to ipfs api
responses.
2020-03-17 11:08:33 +02:00
Joonas Koivunen
1777020cb3 refactor: move with_ipfs under ::v0 2020-03-17 11:08:33 +02:00
Joonas Koivunen
752968f12d doc: add notes on messageresponse 2020-03-17 10:34:43 +02:00
Joonas Koivunen
8f9d0440f6 refactor: use warp::query at least
I was initially thinking that the `query` might need to be changed away,
but it might provide just the rejection we'd need in order to recover
and give that similar error message back.
2020-03-17 10:34:43 +02:00
Joonas Koivunen
9e44c069d3 feat: propagate ipfs to filters, local id query
when query parsing fails, go-ipfs returns 500 and the
v0::ResponseMessage for which this adds a builder. Perhaps we'll need a
custom query parsing filter and an Ser/Deserialize implementation for Cids,
Multiaddrs, PeerIds and whatnot, which luckily might all have FromStr
already.

the current structure in the big handler of id needs refactoring, and a
way to handle the rejections.
2020-03-17 10:34:43 +02:00
Joonas Koivunen
cb664e11f8 fix: go back to using futures channels
we cannot simply replace async aware channels with crossbeam channels,
which cannot wake us up. keeping the channel buffer size at 1 to catch
any errors.
2020-03-17 10:34:43 +02:00
David Craven
d755576a17 Add boilerplate. 2020-03-13 13:53:55 +01:00
Joonas Koivunen
e0179d5ef4 add: test for loading go-ipfs 0.4.23 rsa key 2020-03-12 16:30:36 +02:00
Joonas Koivunen
6b780a767d add: tests for pem_to_der 2020-03-12 16:30:36 +02:00
Joonas Koivunen
53236d6665 fix: deny init with <= 2048 bit keys
this might need to be changed silently to 2048 if the tests use 1024 bit
keys.
2020-03-12 16:30:36 +02:00
Joonas Koivunen
5fb9add3c3 doc: add doc comments for config 2020-03-12 16:30:36 +02:00
Joonas Koivunen
abb6ef1e0a fix: warning on unused variable 2020-03-12 16:30:36 +02:00
Joonas Koivunen
f3e0b8a890 chore: cargo fmt 2020-03-12 16:30:36 +02:00
Joonas Koivunen
f690d51b8e fix: output the generated peerid in main 2020-03-12 16:30:36 +02:00
Joonas Koivunen
9b76a35275 fix: use base64pad instead of base64, field names 2020-03-12 16:30:36 +02:00
Joonas Koivunen
47b9d02a2a feat: rsa keygen using openssl with compat storage
taking on the openssl dependency is used for:

 - rsa key generation
 - from/to `pkcs#1` and `pkcs#8` transformations

Crate `rsa` was also considered but it does not support exporting keys
in any format at the moment and it's import code looks different from
`ring`s (this could be the case of not importing the "precomputed"
values in `rsa`).

The `pkcs#1` is (hopefully) used with go-ipfs-config/go-libp2p
compatible key storage but rust-libp2p/ring need the key in `pkcs#8` der
format. PEM parsing and PEM to DER was implemented by hand as it looked
like the existingly depended on crates are not compatible as much as
possible.
2020-03-12 16:30:36 +02:00
Joonas Koivunen
826755500a refactor: move v0::version in own module 2020-03-12 16:30:36 +02:00
Joonas Koivunen
992838f9a2 add: /api/v0/version with query args 2020-03-11 14:02:29 -04:00
Joonas Koivunen
c316a1c824 add: build metadata with vergen
this could be moved over to rust-ipfs but I think that people will
prefer to track their own binarys version (which is tracked hopefully in
a vcs) instead of their `rust-ipfs` deps version, which will be in their
`Cargo.lock` file.
2020-03-11 14:02:29 -04:00
Joonas Koivunen
e032d3d4aa
Http v0 for testing (#71)
* add first draft of the http api

* chore note on the difficulties with with_graceful_shutdown

* add the second required output line by js-ipfsd-ctl

* run cargo fmt for different formatting from rls?

* chore note on (stalled) progress

* add remaining cli args boilerplate

what is missing now is using ephemeral addresses with the warp, as
js-ipfsd-ctl doesn't always to shutdown the older one, or then it just
doesn't shut down correctly.

* fix bind to ephemeral localhost port

* add env_logger initialization

* fix faked multiaddr typo

never remember its "ip4" instead of "ipv4"

* fix do GET on every method in /id

for some reason js-ipfsd-ctl will do a POST against /api/v0/id.

* chore run cargo fmt

* Adding placeholder NOT_IMPLEMENTED endpiints

* rustfmt

* Feedback from PR

* Update http/Cargo.toml

Co-Authored-By: Joonas Koivunen <joonas@equilibrium.co>

Co-authored-by: Mark Robert Henderson <henderson.mark@gmail.com>
2020-03-05 21:38:44 +02:00