Open rvalle opened 8 months ago
@lexnv I am looking into it. This seems not obvious, by the way behaviors are created and initialized after/become swarm is created.
I currently need the behavior PeerId+Discovery and you use also the PeerId+Discovery+Notification, are you planning on putting together other sets?
Perhaps we could provide utility swarm creation for the typical ones.
One way to approach this would be to make the default-behavior exposed by the subp2p explorer have an optional notifications::behavior::Notifications
. This way users can enable it or disable it depending on their workflow.
In the meanwhile, I think you could use the following approach:
And define your own custom Behavior protocol, similar to:
Having an optional notifications, or a behavior with optional sub-behaviors sounds ideal. I will investigate.
Yes, perhaps we can start by the default behaviour.
Projects depending on subp2p explorer will need to build a swarm too.
It would be beneficial to move the swarm building code to utility including the typical sets of behaviors used, while still allowing for a custom set of behaviors.
This would also facilitate managing the later #3 migration.