ferristseng / rust-ipfs-api

IPFS HTTP client in Rust
Apache License 2.0
247 stars 68 forks source link

what about the offline option #62

Closed ec1oud closed 2 years ago

ec1oud commented 3 years ago

ipfs name publish bafy... --offline works fast on the command line, but by default we still wait for the publishing to succeed, so rust code that calls name_publish is slow. There should be a way to give the offline option to any function, including this one. See https://github.com/ipfs/js-ipfs/pull/2569 and sorry if I'm missing something; I'm still new to rust.

ferristseng commented 3 years ago

This has been the pattern for adding options to the API calls: https://github.com/ferristseng/rust-ipfs-api/pull/61

ec1oud commented 3 years ago

It's not so important though, because offline means it will never be published, only local, which is not what I was looking for.

jcaesar commented 3 years ago

The offline option is kind of important because it's the only sane way that allows checking whether content is local: https://discuss.ipfs.io/t/how-to-check-if-an-ipfs-object-is-on-your-local-node/1250/2 I was planning on adding it for that.

@ferristseng That pattern won't help in this case, since it's a global option, applicable to any command.

jcaesar commented 2 years ago

I suppose #87 closes this?