mirror of https://github.com/waku-org/nwaku.git
Log more in store protocol (#493)
Makes it easier to see what is going on
This commit is contained in:
parent
fb2ea06a4f
commit
5f1bab146d
|
@ -338,6 +338,7 @@ method init*(ws: WakuStore) =
|
|||
waku_store_errors.inc(labelValues = [decodeRpcFailure])
|
||||
return
|
||||
|
||||
# TODO Print more info here
|
||||
info "received query"
|
||||
|
||||
let value = res.value
|
||||
|
@ -354,6 +355,8 @@ method init*(ws: WakuStore) =
|
|||
else:
|
||||
info "handle store swap is nil"
|
||||
|
||||
info "sending response", messages=response.messages.len
|
||||
|
||||
await conn.writeLp(HistoryRPC(requestId: value.requestId,
|
||||
response: response).encode().buffer)
|
||||
|
||||
|
@ -375,6 +378,7 @@ method init*(ws: WakuStore) =
|
|||
|
||||
proc init*(T: type WakuStore, peerManager: PeerManager, rng: ref BrHmacDrbgContext,
|
||||
store: MessageStore = nil, wakuSwap: WakuSwap = nil): T =
|
||||
debug "init"
|
||||
new result
|
||||
result.rng = rng
|
||||
result.peerManager = peerManager
|
||||
|
@ -393,6 +397,7 @@ proc subscription*(proto: WakuStore): MessageNotificationSubscription =
|
|||
## the filter should be used by the component that receives
|
||||
## new messages.
|
||||
proc handle(topic: string, msg: WakuMessage) {.async.} =
|
||||
debug "subscription handle", topic=topic
|
||||
let index = msg.computeIndex()
|
||||
proto.messages.add(IndexedWakuMessage(msg: msg, index: index))
|
||||
waku_store_messages.inc(labelValues = ["stored"])
|
||||
|
|
Loading…
Reference in New Issue