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

libp2p NetworkBehaviour implementation is not extensible. #495

Open
cobward opened this issue Feb 14, 2022 · 0 comments
Open

libp2p NetworkBehaviour implementation is not extensible. #495

cobward opened this issue Feb 14, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@cobward
Copy link

cobward commented Feb 14, 2022

In the current state this crate cannot be used to build any application on top of IPFS. We have a use-case which requires private swarms, custom authentication between peers and additional network behaviour. The implementation of NetworkBehaviour in this crate is not extensible in its current form, so there are limitations on how we can use this crate to implement the behaviour we need.

We would require that the Behaviour struct is extended with an optional custom field, which can be supplied to extend the behaviour of the swarm. This custom behaviour should have high-level access to IPFS methods. It should be possible to construct an IPFS instance using this behaviour, but as much as possible construction of a vanilla IPFS instance should not be compromised.

I had previously considered exposing a method on UninitialisedIpfs to allow the declaration of a SwarmEvent handler which would be called within the main loop of IpfsFuture. This was possible, but I felt it would not be very user-friendly, and not in the spirit of libp2p.

I have a WIP which I will raise as a PR soon, but if anyone has comments or feedback before I do so I will take them on board.

@cobward cobward added the enhancement New feature or request label Feb 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant