Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Re-exports from ipfs #154

Open
koivunej opened this issue Apr 15, 2020 · 1 comment
Open

Re-exports from ipfs #154

koivunej opened this issue Apr 15, 2020 · 1 comment

Comments

@koivunej
Copy link
Collaborator

Currently it's a bit of a mess. There are some parts of libipld re-exported but that is not enough and we need to depend on libipld directly on http and examples. I noticed this when I needed to get a working revision of rust-ipld and I needed to upgrade the rev to three places in #147. Intentionally trying to do as little of this in #147 so just setting the rev's on the dependencies in Cargo.tomls.

Not exactly sure what would be the correct way forward. Since the libipld is used on public api I think we should just export it, maybe even completly under for example ipfs::ipld.

Cid and cid::Codec are also re-exported but not cid::Error which is a bit strange. I think the leaning towards re-exporting it under ipfs::cid.

For libp2p things are pretty ok at the moment. For some reason libp2p::core::ConnectedPoint is re-exported even though it's only used under src/p2p/swarm.rs. Multiaddr, PeerId, PublicKey, Keypair seem like useful to have. Should these also be under ipfs::libp2p...? I don't think so, but I guess we'll learn more when someone wants to use a custom combination of some rust-libp2p features with the code from ipfs.

@cdata
Copy link
Contributor

cdata commented Jan 25, 2022

FYI in Git HEAD only Cid is re-exported. cid::Codec is not, and this makes it very hairy to construct a Cid from outside the crate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants