Commit Graph

350 Commits

Author SHA1 Message Date
Mark Robert Henderson
da6752725c
Update README.md (#161) 2020-04-18 12:30:09 -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
7209bb9be9 fix: cidv0<->cidv1 now passing all tests 2020-04-17 16:19:03 +03:00
Joonas Koivunen
204141c6bf doc: the CidUpgrade extension traits 2020-04-17 16:19:03 +03:00
Joonas Koivunen
93483038bc feat: store always cidv1
this is quite minimal implementation, but it should handle all cases.
for background, the cidv0 can always be converted to cidv1.
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
53f28c7c7e chore: enable clippy for workspace 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
771f376192 fix: require Cargo.lock is up to date with ci builds 2020-04-15 09:54:53 -04:00
Joonas Koivunen
4141cdb844 fix: build examples and tests on non-cross platforms 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
4f3b53c1ca fix: cleaner Cargo.lock 2020-04-15 09:47:02 -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
bf7b0535ae chore: Cargo.lock 2020-04-14 08:04:06 -04:00
Mark Henderson
b6430b56c9 rustfmt 2020-04-14 08:04:06 -04:00
Mark Robert Henderson
5c53e5fb65 Delete config 2020-04-14 08:04:06 -04:00
Mark Robert Henderson
63f81b605a Update Cargo.toml 2020-04-14 08:04:06 -04:00
Mark Robert Henderson
d822838629 Update Cargo.toml
Co-Authored-By: Joonas Koivunen <joonas.koivunen@gmail.com>
2020-04-14 08:04:06 -04:00
David Craven
028b8074c3 wip dag put 2020-04-14 08:04:06 -04:00
Joonas Koivunen
89e3f7c5e5 fix: disable IpfsOptions::default for tests
this is the only way I found to minimize additional dead_code lints
while not allowing this method to be called from tests.
2020-04-02 13:04:25 +03:00
Joonas Koivunen
18dd8cb3ce fix: remove use of IpfsOptions::default in tests
This has been the cause of number of test failures which happen when a
two threads are executing the IpfsOption::default at the same time.

 * https://github.com/ipfs-rust/rust-ipfs/pull/131/checks?check_run_id=551965765#step:12:90
 * other's have already been re-run and can't easily be found
2020-04-02 13:04:25 +03:00
Joonas Koivunen
5e3afef59c refactor: remove obsolete test comment 2020-04-02 13:04:00 +03:00
Joonas Koivunen
e1d836a137 chore: update cargo lock
unsure why this happens given the changes.
2020-04-02 13:04:00 +03: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
85bd2cd705 add: salvaged exchange_block
This is from davids non-mergeable branch.

Co-authored-by: David Craven <david@craven.ch>
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
608ca9f174 feat: bitswap stats with repo changes
this adds a BlockPut result in two places which is inferior to the more
complete bitswap refactoring. BlockPut will let the caller know if the
block was added or if it existed already. This is poorly implemented in
the fs blockstore.
2020-04-02 13:04:00 +03:00
Joonas Koivunen
868f4a8722 add: bitswap wantlist getters
compared to original version, attempt to differentiate peer vs. local at
method level. could probably be at the ipfs level as well?
2020-04-02 13:04:00 +03:00
Joonas Koivunen
cd26d39857 refactor: remove AsMut<Pubsub> in favor of getter
neither looks too good but AsMut<Pubsub> trick cannot be played with
multiple components so there goes that idea.
2020-04-02 13:04:00 +03:00
Joonas Koivunen
a068e2565b add: boilerplate for bitswap apis 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
44e91e290e chore: forgotten cargo fmt 2020-04-01 14:30:25 +02:00
Joonas Koivunen
b60c99dbdb add: test for cancelled subscriptionfuture
was thinking that leaving the waker there might need to be fixed but
apparently it causes no problems.
2020-04-01 14:30:25 +02:00