You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
It would be valuable to add custom behaviours to the embedded mode of iroh. We (ceramic network) are exploring embedding iroh into a Rust implementation of our Ceramic node. Having the ability to write our own protocols (aka behaviours) will enable us to leverage iroh's features while customizing it for our own network needs as well.
Design
By design, behaviours are meant to be composable. Therefore it makes the most since to extend iroh's network logic via behaviours. The goals of a change would be:
have the ability to compose custom behaviours with the existing NodeBehaviour,
have the ability to handle behaviour events in hosting application.
The second point is a bit vague and I will likely need to explore it more before understanding exactly what hosting applications would need from their custom behaviours.
Implementation Ideas
I took a look at the code and I have a rough plan for how we could accomplish this feature.
Make the existing behaviour parameterized by an additional custom behaviour, i.e. NodeBehaviour<B: NetworkBehaviour>
Add custom_behaviour field to existing behaviour via a Toggle behaviour. i.e. custom_behaviour: Toggle<B>
Plumb adding a custom behaviour out through the IrohBuilder API so consumers can specify their custom behaviour. Should be possible to do this in a backward compatible way such that only new code wishing to use this feature needs to update to consume these new APIs.
Those are my ideas, I am willing to submit a PR for this work (in fact I have a hacky version working already), however I wanted to discuss first before dropping a PR that changes lots of API surface area.
The text was updated successfully, but these errors were encountered:
It would be valuable to add custom behaviours to the embedded mode of iroh. We (ceramic network) are exploring embedding iroh into a Rust implementation of our Ceramic node. Having the ability to write our own protocols (aka behaviours) will enable us to leverage iroh's features while customizing it for our own network needs as well.
Design
By design, behaviours are meant to be composable. Therefore it makes the most since to extend iroh's network logic via behaviours. The goals of a change would be:
The second point is a bit vague and I will likely need to explore it more before understanding exactly what hosting applications would need from their custom behaviours.
Implementation Ideas
I took a look at the code and I have a rough plan for how we could accomplish this feature.
NodeBehaviour<B: NetworkBehaviour>
custom_behaviour
field to existing behaviour via aToggle
behaviour. i.e.custom_behaviour: Toggle<B>
IrohBuilder
API so consumers can specify their custom behaviour. Should be possible to do this in a backward compatible way such that only new code wishing to use this feature needs to update to consume these new APIs.Those are my ideas, I am willing to submit a PR for this work (in fact I have a hacky version working already), however I wanted to discuss first before dropping a PR that changes lots of API surface area.
The text was updated successfully, but these errors were encountered: