2023-08-10 13:30:38 +00:00
|
|
|
package gowaku
|
|
|
|
|
|
|
|
import "github.com/waku-org/go-waku/library"
|
|
|
|
|
|
|
|
// LightpushPublish is used to publish a WakuMessage in a pubsub topic using Lightpush protocol
|
2023-12-15 14:46:21 +00:00
|
|
|
func LightpushPublish(instanceID uint, messageJSON string, topic string, peerID string, ms int) string {
|
|
|
|
instance, err := library.GetInstance(instanceID)
|
|
|
|
if err != nil {
|
|
|
|
return makeJSONResponse(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
response, err := library.LightpushPublish(instance, messageJSON, topic, peerID, ms)
|
2023-08-10 13:30:38 +00:00
|
|
|
return prepareJSONResponse(response, err)
|
|
|
|
}
|