waku debug info error

This commit is contained in:
Oskar Thoren 2021-06-10 22:35:43 +08:00
parent 484a63daf1
commit 34d23c1d22
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
2 changed files with 4 additions and 5 deletions

View File

@ -31,7 +31,7 @@ func main() {
var contentTopic = "/toy-chat/2/huilong/proto"
// Get node info
var wakuInfo = nwaku.GetWakuDebugInfo(client)
var wakuInfo, _ = nwaku.GetWakuDebugInfo(client)
fmt.Println("WakuInfo ListenStr", wakuInfo.ListenStr)
// Query messages

View File

@ -4,14 +4,14 @@ import (
"github.com/ethereum/go-ethereum/rpc"
)
func GetWakuDebugInfo(client *rpc.Client) WakuInfo {
func GetWakuDebugInfo(client *rpc.Client) (WakuInfo, error) {
var wakuInfo WakuInfo
if err := client.Call(&wakuInfo, "get_waku_v2_debug_v1_info"); err != nil {
panic(err)
return wakuInfo, err
}
return wakuInfo
return wakuInfo, nil
}
func GetWakuStoreMessages(client *rpc.Client, contentTopic string) (StoreResponse, error) {
@ -66,4 +66,3 @@ func GetWakuRelayMessages(client *rpc.Client, topic string) ([]WakuMessage, erro
// - Exposing higher level methods as API
// - Consider using methods scoped to rpc.Client instead
// - Support more args in store rpc call
// - Uniform error handling