Skip to content

ipfs: Fix for latest IPFS API language#14

Open
kallisti5 wants to merge 1 commit into
gkbrk:masterfrom
kallisti5:master
Open

ipfs: Fix for latest IPFS API language#14
kallisti5 wants to merge 1 commit into
gkbrk:masterfrom
kallisti5:master

Conversation

@kallisti5
Copy link
Copy Markdown

  • Fixes library to work with latest API version
    from IPFS. The API requests all changed to POST from GET
    (even where POST doesn't make sense)
  • Interesting IPFS completely changed the API, but didn't
    bump v0 to v1 :-|
  • This breaks compatibility with any old versions
    (0.9.0 or before) but makes the crate work with recent
    versions (0.10.0 - 0.13.0)

* Fixes library to work with latest API version
  from IPFS. The API requests all changed to POST from GET
  (even where POST doesn't make sense)
* Interesting IPFS completely changed the API, but didn't
  bump v0 to v1 :-|
* This breaks compatibility with any old versions
 (0.9.0 or before) but makes the crate work with recent
 versions (0.10.0 - 0.13.0)
@kallisti5
Copy link
Copy Markdown
Author

This one will solve #12

[kallisti5@eris rust-ipfs-api]$ cargo test
warning: field is never read: `version`
  --> src/version.rs:10:5
   |
10 |     version: String,
   |     ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: field is never read: `commit`
  --> src/version.rs:11:5
   |
11 |     commit: String,
   |     ^^^^^^^^^^^^^^

warning: field is never read: `repo`
  --> src/version.rs:12:5
   |
12 |     repo: String,
   |     ^^^^^^^^^^^^

warning: field is never read: `system`
  --> src/version.rs:13:5
   |
13 |     system: String,
   |     ^^^^^^^^^^^^^^

warning: field is never read: `golang`
  --> src/version.rs:14:5
   |
14 |     golang: String
   |     ^^^^^^^^^^^^^^

warning: `ipfsapi` (lib) generated 5 warnings
warning: `ipfsapi` (lib test) generated 5 warnings (5 duplicates)
    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running unittests (target/debug/deps/ipfsapi-38db13c00250870a)

running 6 tests
test object::tests::test_object_stats ... ok
test block::tests::test_block_put ... ok
test cat::tests::test_cat_bytes ... ok
test cat::tests::test_cat_string ... ok
test block::tests::test_block_get ... ok
test pin::tests::test_pin_full ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s

   Doc-tests ipfsapi

running 4 tests
test src/cat.rs - cat::IpfsApi::cat (line 13) ... ignored
test src/ipns.rs - ipns::IpfsApi::name_resolve (line 13) ... ignored
test src/lib.rs - IpfsApi::new (line 33) ... ignored
test src/pubsub.rs - pubsub::IpfsApi::pubsub_subscribe (line 44) ... ignored

test result: ok. 0 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 0.00s

That was run on a IPFS 0.12.x node.

@kallisti5
Copy link
Copy Markdown
Author

kallisti5 commented Jun 11, 2022

@gkbrk any interest in turning the rust crate over to me to maintain if you no longer have time for this project?

You can add an owner on crates.io. Add Owner -> kallisti5

@gkbrk
Copy link
Copy Markdown
Owner

gkbrk commented Oct 1, 2022

This breaks compatibility with any old versions (0.9.0 or before) but makes the crate work with recent versions (0.10.0 - 0.13.0).

I don't think we should care about those versions. Most likely they won't be able to interoperate with the rest of the IPFS network as they extend and change the protocol anyway. Even if they don't, it's not a good security practice to run those versions I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants