libp2p / js-libp2p

The JavaScript Implementation of libp2p networking stack.
https://libp2p.io
Other
2.29k stars 438 forks source link

feat!: split identify and identify-push #2387

Closed wemeetagain closed 4 months ago

wemeetagain commented 7 months ago

Description

Add two options to the identify module to disable various parts of identify-push

Change checklist

achingbrain commented 7 months ago

Could these options be consolidated?

It would avoid the situation where a user sets both runOnSelfUpdate and disableIdentifyPush to true and expects something to happen.

Also, can you add some tests to ensure there are no regressions?

wemeetagain commented 7 months ago

IMO they are two separate features. One stops the outbound messages that automatically happen (but still allows manual outbound messages and allows handling inbound messages). One stops the handling of inbound messages.

could we split the identify module into two? Then we wouldn't need the disable feature. like:

createLibp2p({
  services: {
    identify: identify({...}),
    identifyPush: identifyPush({...}),
  }
})
achingbrain commented 7 months ago

could we split the identify module into two?

This sounds like a good solution since it's a separate protocol, it could be exported from @libp2p/identify for convenience though since most people would want both most of the time.