waku debug info error
This commit is contained in:
parent
484a63daf1
commit
34d23c1d22
2
nwaku.go
2
nwaku.go
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue