Skip to content

Commit

Permalink
returning seqs in libwaku as comma separated strings (#3121)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer authored Oct 16, 2024
1 parent 18c375a commit 3321fd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/json
import chronicles, chronos, results, eth/p2p/discoveryv5/enr
import chronicles, chronos, results, eth/p2p/discoveryv5/enr, strutils
import ../../../../waku/factory/waku, ../../../../waku/node/waku_node

type DebugNodeMsgType* = enum
Expand Down Expand Up @@ -28,7 +28,8 @@ proc process*(

case self.operation
of RETRIEVE_LISTENING_ADDRESSES:
return ok($(%*waku.node.getMultiaddresses()))
## returns a comma-separated string of the listen addresses
return ok(waku.node.getMultiaddresses().join(","))
of RETRIEVE_MY_ENR:
return ok(waku.node.enr.toURI())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/json
import chronos, chronicles, results, libp2p/multiaddress
import chronos, chronicles, results, strutils, libp2p/multiaddress
import
../../../../waku/factory/waku,
../../../../waku/discovery/waku_dnsdisc,
Expand Down Expand Up @@ -129,7 +129,8 @@ proc process*(
error "GET_BOOTSTRAP_NODES failed", error = error
return err($error)

return ok($(%*nodes))
## returns a comma-separated string of bootstrap nodes' multiaddresses
return ok(nodes.join(","))
of UPDATE_DISCV5_BOOTSTRAP_NODES:
updateDiscv5BootstrapNodes($self[].nodes, waku).isOkOr:
error "UPDATE_DISCV5_BOOTSTRAP_NODES failed", error = error
Expand Down

0 comments on commit 3321fd0

Please sign in to comment.