-
Notifications
You must be signed in to change notification settings - Fork 958
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-ipfs? #233
Comments
@adamski With a working libp2p, you can simply connect to any existing ipfs node and start speaking the protocols you want. You would have to reimplement some of those, but the ipfs protocols are actually quite simple. Bitswap is just a single protobuf that you send to request blocks and receive (the same protobuf) to receive those blocks. You could probably implement cpp-ipfs using rust-libp2p pretty easily ;) |
Great, thats very encouraging, thanks. |
@whyrusleeping Coming back to this - are there any examples of using libp2p to speak to IPFS? Are there any docs that explain some of the terms here, e.g. "protobuf"? |
@tomaka are you able to help with this at all? Any helpful links to similar JS code you can point me to? |
Other than ipfs? (ipfs uses libp2p to talk to other ipfs nodes) What bits do you want to do? If you just want to be able to fetch data from ipfs nodes, you'll want to implement bitswap. The go implementation of that is here: https://github.com/ipfs/go-bitswap The raw protobuf message is defined here: https://github.com/ipfs/go-bitswap/blob/master/message/pb/message.proto |
Yes, I just want to fetch and provide data to other IPFS nodes. Thanks for the links! |
Does anyone here have a rough idea of days required to implement this? I'm in the process of applying for a research collaboration grant with a local university where implementing rust-ipfs will be the main focus. Thanks. |
Implementing the bitswap protocol (the name of the protocol used by IPFS) shouldn't be very difficult, as far as I know (I haven't looked into it). However you would also need to implement record stores in Kademlia (#146) and create the CLI interface. |
Thanks. I assume that the Kademlia record store is for local storage of other nodes on the network? Would that be based on https://github.com/libp2p/interface-record-store, or more similar to https://github.com/libp2p/js-libp2p-kad-dht? Is there any documentation that explains some of this stuff? |
Let's move the discussion to #146 |
I got bitswap working. The weird thing is that I always get a negative response to find_provider. By hardcoding |
This might be caused by #694 |
@dvc94ch do you have your code available online somewhere? |
There are still some issues with it. I can publish it this week, just haven't gotten around to it yet. |
@tomaka Does the chat example still work in master? I've been struggling with some kind of deadlock problem where the first message is received, but the reply never is, so I've tried tracing calls to NetworkBehaviour and UpgradeInbound/UpgradeOutbound and comparing it to the chat example, but I can't get the chat example working anymore. |
Never mind, it inexplicably works again after rebooting. weird |
#910 should have fixed the example sometimes deadlocking. |
I believe the problem is with the mplex muxer. I enabled the yamux muxer and it works. This diff should break the chat application.
|
@gnunicorn Looking up providers in the dht still doesn't work, but two rust-ipfs clients can exchange blocks if they're on the same LAN. The go-ipfs and js-ipfs clients arent discovered via mdns. |
Go-ipfs and js-ipfs implement mDNS differently than the libp2p specs. I went with following the specs, but the consequence is that we don't discover the Go and Js nodes. |
@dvc94ch thanks for your efforts! I think, to make a Rust IPFS implementation as useful as possible it needs to be able to talk to existing Go and JS nodes. But perhaps that is outside the scope of rust-libp2p. |
@tomaka , if you know the difference(s) or can point to what you know to be incompatible, maybe you could put that into a ticket and we can provide a |
I don't actually know what they are doing. I sniffed their network traffic and it was very different from what the specifications mention. For the details one would have to read their source code. I remember talking to someone from Protocol Labs about this, who mentioned that they wanted to eventually switch to what the specifications were. |
I hacked the
In addition to that the |
Yeah, #734 |
What's the likelihood of For my particular use case, I don't mind having only nodes I set up being discoverable (local / remote data replication), but eventually I want to be able to have those nodes discoverable by JS and Go nodes and vice versa. |
Curious. Running
confirmed |
I think @richardschneider worked on this interop last, maybe they can clear something up. |
Indeed a known issue: libp2p/go-libp2p#176 (comment) |
#968 is now able to discover legacy IPFS clients in js and go. However, as both of them are technically specific to the ipfs-domain, I am not sure we want to have that code in the regular libp2p code, but also don't really see a way to make it more generic or nicer. I am thinking of future-gating it... |
@gnunicorn maybe the best solution is the one all large corporations use. Write a spec for the rust-libp2p-mdns implementation, get it accepted in libp2p/specs and let every one else fix their code. |
There's already a spec and the rust-libp2p-mdns implementation hopefully follows it. We're basically at the last step. |
Some things are specific to rust-libp2p no? Like the service tag must be |
That's exactly what is specified here: https://github.com/libp2p/specs/blob/2f3e55d391338a32a7cb67e4e4aa7b78d02e0d8c/discovery/mdns.md |
Hadn't seen it because it's not in master... Thanks! So @gnunicorn and I found an issue where the multiaddr returned by the legacy mdns was unsupported which is fixed now and that the jsipfs node fails an identity check if you attempt to connect before the peer was discovered. I'm not sure what the next steps are other than waiting. |
@dvc94ch Hi! Do you, by any chance, have this hack available somewhere? I'm trying to connect rust-libp2p with js-libp2p, and having all kind of troubles. Incompatibility between Rust & JS mDNS is one of them. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I'm looking around for an IPFS implementation I can use in a cross-platform desktop/mobile application. I've been playing with https://github.com/Agorise/c-ipfs, but it seems to be incomplete and unstable from my testing.
I don't necessary need a full IPFS implementation, but would ideally like to be able to interact with nodes powered by go-ipfs. My use case is "offline first" application user data storage, and I'd like to replace my current dependency on Couchbase server infastructure with IPFS.
In order to use this library I would need to create a C++ wrapper for it, but it seems that things are moving and changing fast here so I wonder if its better to wait until the API has settled?
The text was updated successfully, but these errors were encountered: