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])
|
waku_store_errors.inc(labelValues = [decodeRpcFailure])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# TODO Print more info here
|
||||||
info "received query"
|
info "received query"
|
||||||
|
|
||||||
let value = res.value
|
let value = res.value
|
||||||
|
@ -354,6 +355,8 @@ method init*(ws: WakuStore) =
|
||||||
else:
|
else:
|
||||||
info "handle store swap is nil"
|
info "handle store swap is nil"
|
||||||
|
|
||||||
|
info "sending response", messages=response.messages.len
|
||||||
|
|
||||||
await conn.writeLp(HistoryRPC(requestId: value.requestId,
|
await conn.writeLp(HistoryRPC(requestId: value.requestId,
|
||||||
response: response).encode().buffer)
|
response: response).encode().buffer)
|
||||||
|
|
||||||
|
@ -375,6 +378,7 @@ method init*(ws: WakuStore) =
|
||||||
|
|
||||||
proc init*(T: type WakuStore, peerManager: PeerManager, rng: ref BrHmacDrbgContext,
|
proc init*(T: type WakuStore, peerManager: PeerManager, rng: ref BrHmacDrbgContext,
|
||||||
store: MessageStore = nil, wakuSwap: WakuSwap = nil): T =
|
store: MessageStore = nil, wakuSwap: WakuSwap = nil): T =
|
||||||
|
debug "init"
|
||||||
new result
|
new result
|
||||||
result.rng = rng
|
result.rng = rng
|
||||||
result.peerManager = peerManager
|
result.peerManager = peerManager
|
||||||
|
@ -393,6 +397,7 @@ proc subscription*(proto: WakuStore): MessageNotificationSubscription =
|
||||||
## the filter should be used by the component that receives
|
## the filter should be used by the component that receives
|
||||||
## new messages.
|
## new messages.
|
||||||
proc handle(topic: string, msg: WakuMessage) {.async.} =
|
proc handle(topic: string, msg: WakuMessage) {.async.} =
|
||||||
|
debug "subscription handle", topic=topic
|
||||||
let index = msg.computeIndex()
|
let index = msg.computeIndex()
|
||||||
proto.messages.add(IndexedWakuMessage(msg: msg, index: index))
|
proto.messages.add(IndexedWakuMessage(msg: msg, index: index))
|
||||||
waku_store_messages.inc(labelValues = ["stored"])
|
waku_store_messages.inc(labelValues = ["stored"])
|
||||||
|
|
Loading…
Reference in New Issue