Closed richard-ramos closed 1 year ago
Slight inconsistency in the waku api was discovered when using discv5:
node.discv5_start()
.node.stop()
is called, it stops discv5 internally.node.discv5_stop()
is called before node.stop()
then a subsequent node.stop()
makes go-waku panic, but waku-bindings
keeps waiting for a function to return.Leaving this here as we might want to add some notes regarding this functionality or make changes to the api.
Slight inconsistency in the waku api was discovered when using discv5:
- When a node is initialised with discv5 enabled, it just "mounts" the discv5 and discv5 needs to be started separately with
node.discv5_start()
.- When
node.stop()
is called, it stops discv5 internally.- If
node.discv5_stop()
is called beforenode.stop()
then a subsequentnode.stop()
makes go-waku panic, butwaku-bindings
keeps waiting for a function to return.Leaving this here as we might want to add some notes regarding this functionality or make changes to the api.
@richard-ramos are you aware of this? ^^^^
I think either we make it automatic, so when enabling discv5 the service is auto started/stoped. Or it need to be started/stoped manually be the caller.
I did not know. I can work on a fix - would you prefer discv5 is automatically started/stopped? should simplify the API for sure.
@richard-ramos yeah, I would say that is better that if enabled, then the service is started and stopped automatically and that's all.
Adds the following new items to go-waku c-bindings:
New config items:
discV5
: Enable DiscoveryV5. Defaultfalse
discV5BootstrapNodes
: Array of bootstrap nodes ENR Example (these values can be obtained from fleets.status.im):discV5UDPPort
: UDP port for DiscoveryV5 Default9000
New functions
extern char* waku_discv5_start()
Starts the DiscoveryV5 service to discover and connect to new peers
Returns
A
JsonResponse
. If the execution is successful, theresult
field is set totrue
.For example:
extern char* waku_discv5_stop()
Stops the DiscoveryV5 service
Returns
A
JsonResponse
. If the execution is successful, theresult
field is set totrue
.For example:
See: https://github.com/waku-org/go-waku/pull/400