rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

All crates should have a consistent API & naming

Open thomaseizinger opened this issue 4 years ago • 4 comments

Discussed in https://github.com/libp2p/rust-libp2p/discussions/2174.

Summary:

Rename symbols within libp2p- sub crates such that they can best be references via the module that is re-exported from the libp2p meta-crate. For example:

use libp2p::ping;

let behaviour = ping::Behaviour::new(ping::Config::default());

Crates

  • [x] https://github.com/libp2p/rust-libp2p/pull/2215
  • [x] https://github.com/libp2p/rust-libp2p/pull/2937
  • [x] https://github.com/libp2p/rust-libp2p/pull/2927
  • [x] https://github.com/libp2p/rust-libp2p/pull/2961
  • [x] https://github.com/libp2p/rust-libp2p/pull/3159
  • [x] https://github.com/libp2p/rust-libp2p/pull/3238
  • [x] https://github.com/libp2p/rust-libp2p/pull/3214
  • [x] https://github.com/libp2p/rust-libp2p/pull/3096
  • [x] https://github.com/libp2p/rust-libp2p/pull/3303
  • [x] https://github.com/libp2p/rust-libp2p/pull/3852
  • [x] https://github.com/libp2p/rust-libp2p/pull/3768
  • [x] https://github.com/libp2p/rust-libp2p/pull/4535
  • [x] https://github.com/libp2p/rust-libp2p/issues/4485
  • [x] https://github.com/libp2p/rust-libp2p/issues/4486
  • [x] https://github.com/libp2p/rust-libp2p/pull/5855
  • [x] https://github.com/libp2p/rust-libp2p/pull/5870
  • [x] https://github.com/libp2p/rust-libp2p/pull/5873
  • [ ] libp2p-uds:

thomaseizinger avatar Sep 07 '21 01:09 thomaseizinger

I followed the same approach outlined here in https://github.com/libp2p/rust-libp2p/pull/2859 and introduced top-level dummy and keep_alive modules in libp2p-swarm. I think eventually, it would be great if we can also introduce these top-level modules in libp2p and re-export these kind of modules there. That would allow us to group things like dummy::Behaviour and dummy::ConnectionHandler together under libp2p::dummy which would be consistent with the re-export of sub-crates like libp2p::ping or libp2p::kad.

thomaseizinger avatar Sep 27 '22 02:09 thomaseizinger

@jxs @thomaseizinger Hey guys, can I help with the UDS, if that one is still needed?

momoshell avatar Oct 27 '25 10:10 momoshell

hi @momoshell thanks for the interest, yeah, go for it, I think it's only the UdsConfig type

jxs avatar Oct 28 '25 15:10 jxs

@jxs and done! ✅

hi @momoshell thanks for the interest...

My pleasure! Since I've been using this library in production for a few years now, it's only natural to give something back. Will be jumping on other issues, if you guys let me, that is 😊

momoshell avatar Oct 30 '25 09:10 momoshell