-
Notifications
You must be signed in to change notification settings - Fork 95
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
Proposal: Seperate packages for each system #4
Comments
I am a fan of using multiple packages, but I suggest doing so internally and not polluting the global namespace or a package manager with them. This is a standalone application, not a package. ipfs.api and naming already exists in the form of https://github.com/ipfs/python-ipfs-api and since they are universal (can be used with any ipfs implementation) it does not make sense to put it in the same package/namespace as this project. |
I think the more standalone packages that can be used by other things, the better. (Yes published to package managers). A convention could be used like in node ipfs: In particular, all the network stuff, definitely make it separate packages. Name the main one libp2p -- and check with @diasdavid and I on it -- we're actively modularizing it and making the pieces even more useful — On Tue, Oct 6, 2015 at 9:07 AM, BrendanBenshoof notifications@github.com
|
I believe it would be also good to align organisation conventions across implementations (e.g. node-ipfs-bitswap, go-ipfs-bitswap, py-ipfs-bitswap and others all do the same thing and offer the same interface). So on this, I happy to bring more libp2p context, the IPFS network stack. |
@diasdavid Would we then use submodules for those packages into this repository? My intent was to allow user-side or project-side swapping of each subpackage for either alternate Python implementations or for C, Go, or other implementations, for speed, while not breaking the API. |
@SilverWingedSeraph the Node.js implementation is breaking everything into modules per repo https://github.com/ipfs/node-ipfs#roadmap. modularity and composability ftw :) |
OK, I updated my comment to reflect the naming convention, and the proper use of |
We have solved a lot of the dht related problems over at UrDHT. The latest Kademlia DHT logic has not left the simulator and been implemented into UrDHT yet, but we can use it soon. I should test if my kademlia peer selection criteria plays well with the other nodes using the k-buckets approach |
@diasdavid To clarify, do you mean we should create additional repos and use git submodules, or that we should make Python modules for each section in this repository? Sorry, the word "module" is a bit unclear here. |
@SilverWingedSeraph I was pointing out that on the same train of thought that you proposed with It would be good for the ecosystem to have the same level of modularity across implementations, so that a user of 'libp2p' in Node.js can have the same expectations when using its 'go', 'python', 'rust', etc implementations. Now if the best option is to create several repos vs git submodules vs python modules, I believe that depends on what is defined as best practice for the python ecosystem (I honestly don't know what is the convention for Python). |
I think it basically depends on whether or not we want to allow people to use our functionality piecemeal. If we want, say,
|
Correct me if I'm wrong @diasdavid , but I believe the closest translation of what is happening in the nodejs implemention to what we could do here would be:
We can use this repository as the mothership and have it contain git submodules/subtrees. I'm still reading through the go-ipfs code so my knowledge of the project is somewhat shoddy, but to me it looks like it'd be cool to split the functionality into multiple repositories and have each piece work in a stand-alone fashion for that ease of use in other projects. |
I'm worried about how this would affect imports, e.g.: >>> from test.ipf-test import foo
File "<stdin>", line 1
from test.ipf-test import foo
SyntaxError: invalid syntax The issue is My read on the general in the greater Python community is that it seems like modularizing sub-packages into separate repositories is fairly rare, possibly due to the perceived overhead with git submodules. Python also favors a lot of imports between sub-packages (as long as they aren't circular references 😏), so there aren't as many advantages to this structure out in the wild generally. I believe in JS and golang that sort of encapsulation offers more benefits. The I'm not completely against a separate repo, but I'm personally with @BrendanBenshoof and think we should keep everything in one repo. Edit: re-reading, I'm not sure if @BrendanBenshoof is advocating for or against git submodules. I favor sub-package (i.e. Python package) encapsulation, but believe git submodules are probably unnecessary/more trouble than they're worth in this case. |
I suggest that we separate the
ipfs
package into packages for each IPFS subsystem:*
ipfs-api
- Used to connect to Py-IPFS by applications. This is where most users should touch. From https://github.com/ipfs/python-ipfs-api*
ipfs-naming
oripfs-ipns
- Provides access to the IPNS pulbic key infrastructure and naming system. Handles HRNs and mutable pointers*
ipfs-merkledag
- Provides access to Merkledag for resolving paths*
ipfs-block
- Provides access to the block exchange system for transferring data.*
ipfs-routing
- Provides access to the routing system, probably mostly DHT andmdns
*
ipfs-network
- Provides access to the lowest level IPFS network transport functions, like NAT traversal/hole punching, encryption/signing, and multi/broadcastingClient applications would initialize the stack from the bottom up: choose a transport and encryption with
ipfs-network
, connect to the DHT withipfs-routing
, then useipfs-naming
(ipfs-ipns
) to find the location of desired content andipfs-merkledag
andipfs-block
to recall that data.On the other hand, if an instance of IPFS is already running on the system (which is preferred), they could simply use
ipfs-api
to interact with it.The text was updated successfully, but these errors were encountered: