post waku relay message error handling
This commit is contained in:
parent
8f30fa1463
commit
a4ee858607
2
nwaku.go
2
nwaku.go
|
@ -38,7 +38,7 @@ func main() {
|
|||
|
||||
// Publish
|
||||
var message = nwaku.WakuRelayMessage{Payload: "0x1a2b3c4d5e6f", ContentTopic: contentTopic}
|
||||
var res = nwaku.PostWakuRelayMessage(client, message)
|
||||
var res, _ = nwaku.PostWakuRelayMessage(client, message)
|
||||
fmt.Println("Publish", res)
|
||||
|
||||
<-nodeStopped
|
||||
|
|
|
@ -28,15 +28,15 @@ func GetWakuStoreMessages(client *rpc.Client, contentTopic string) (StoreRespons
|
|||
|
||||
}
|
||||
|
||||
func PostWakuRelayMessage(client *rpc.Client, message WakuRelayMessage) bool {
|
||||
func PostWakuRelayMessage(client *rpc.Client, message WakuRelayMessage) (bool, error) {
|
||||
var topic = "/waku/2/default-waku/proto"
|
||||
var res bool
|
||||
|
||||
if err := client.Call(&res, "post_waku_v2_relay_v1_message", topic, message); err != nil {
|
||||
panic(err)
|
||||
return res, err
|
||||
}
|
||||
|
||||
return res
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// TODO Subscribe, then poll for getting messages
|
||||
|
|
Loading…
Reference in New Issue