chore(storenode): bump status-go, and log result of each storenode requests

This commit is contained in:
Richard Ramos 2022-11-24 17:12:04 -04:00 committed by RichΛrd
parent 3516e1d341
commit e2f157018c
4 changed files with 19 additions and 22 deletions

View File

@ -14,19 +14,17 @@ type MailserverRequestExpiredSignal* = ref object of Signal
# TODO
type HistoryRequestStartedSignal* = ref object of Signal
requestId*: string
numBatches*: int
type HistoryRequestBatchProcessedSignal* = ref object of Signal
type HistoryRequestSuccessSignal* = ref object of Signal
requestId*: string
batchIndex*: int
numBatches*: int
peerId*: string
type HistoryRequestCompletedSignal* = ref object of Signal
requestId*: string
type HistoryRequestFailedSignal* = ref object of Signal
requestId*: string
peerId*: string
errorMessage*: string
error*: bool
@ -56,25 +54,23 @@ proc fromEvent*(T: type MailserverRequestExpiredSignal, jsonSignal: JsonNode): M
proc fromEvent*(T: type HistoryRequestStartedSignal, jsonSignal: JsonNode): HistoryRequestStartedSignal =
result = HistoryRequestStartedSignal()
result.signalType = SignalType.HistoryRequestStarted
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt()
proc fromEvent*(T: type HistoryRequestBatchProcessedSignal, jsonSignal: JsonNode): HistoryRequestBatchProcessedSignal =
result = HistoryRequestBatchProcessedSignal()
result.signalType = SignalType.HistoryRequestBatchProcessed
proc fromEvent*(T: type HistoryRequestSuccessSignal, jsonSignal: JsonNode): HistoryRequestSuccessSignal =
result = HistoryRequestSuccessSignal()
result.signalType = SignalType.HistoryRequestSuccess
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
result.batchIndex = jsonSIgnal["event"]{"batchIndex"}.getInt()
result.numBatches = jsonSIgnal["event"]{"numBatches"}.getInt()
result.peerId = jsonSignal["event"]{"peerId"}.getStr()
proc fromEvent*(T: type HistoryRequestCompletedSignal, jsonSignal: JsonNode): HistoryRequestCompletedSignal =
result = HistoryRequestCompletedSignal()
result.signalType = SignalType.HistoryRequestCompleted
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
proc fromEvent*(T: type HistoryRequestFailedSignal, jsonSignal: JsonNode): HistoryRequestFailedSignal =
result = HistoryRequestFailedSignal()
result.signalType = SignalType.HistoryRequestStarted
result.signalType = SignalType.HistoryRequestFailed
result.requestId = jsonSignal["event"]{"requestId"}.getStr()
result.peerId = jsonSignal["event"]{"peerId"}.getStr()
if jsonSignal["event"].kind != JNull:
result.errorMessage = jsonSignal["event"]{"errorMessage"}.getStr()
result.error = result.errorMessage != ""

View File

@ -26,7 +26,7 @@ type SignalType* {.pure.} = enum
HistoryRequestStarted = "history.request.started"
HistoryRequestCompleted = "history.request.completed"
HistoryRequestFailed = "history.request.failed"
HistoryRequestBatchProcessed = "history.request.batch.processed"
HistoryRequestSuccess = "history.request.success"
KeycardConnected = "keycard.connected"
MailserverAvailable = "mailserver.available"
MailserverChanged = "mailserver.changed"

View File

@ -79,9 +79,9 @@ QtObject:
of SignalType.Stats: StatsSignal.fromEvent(jsonSignal)
of SignalType.ChroniclesLogs: ChroniclesLogsSignal.fromEvent(jsonSignal)
of SignalType.HistoryRequestCompleted: HistoryRequestCompletedSignal.fromEvent(jsonSignal)
of SignalType.HistoryRequestSuccess: HistoryRequestSuccessSignal.fromEvent(jsonSignal)
of SignalType.HistoryRequestStarted: HistoryRequestStartedSignal.fromEvent(jsonSignal)
of SignalType.HistoryRequestFailed: HistoryRequestFailedSignal.fromEvent(jsonSignal)
of SignalType.HistoryRequestBatchProcessed: HistoryRequestBatchProcessedSignal.fromEvent(jsonSignal)
of SignalType.KeycardConnected: KeycardConnectedSignal.fromEvent(jsonSignal)
of SignalType.MailserverAvailable: MailserverAvailableSignal.fromEvent(jsonSignal)
of SignalType.MailserverChanged: MailserverChangedSignal.fromEvent(jsonSignal)

View File

@ -170,19 +170,20 @@ QtObject:
self.events.on(SignalType.HistoryRequestStarted.event) do(e: Args):
let h = HistoryRequestStartedSignal(e)
info "history request started", requestId=h.requestId, numBatches=h.numBatches
self.events.on(SignalType.HistoryRequestBatchProcessed.event) do(e: Args):
let h = HistoryRequestBatchProcessedSignal(e)
info "history batch processed", requestId=h.requestId, batchIndex=h.batchIndex
info "history request started", numBatches=h.numBatches
self.events.on(SignalType.HistoryRequestCompleted.event) do(e: Args):
let h = HistoryRequestCompletedSignal(e)
info "history request completed", requestId=h.requestId
info "history request completed"
self.events.on(SignalType.HistoryRequestFailed.event) do(e: Args):
let h = HistoryRequestFailedSignal(e)
info "history request failed", requestId=h.requestId, errorMessage=h.errorMessage
info "history request failed", requestId=h.requestId, peerId=h.peerId, errorMessage=h.errorMessage
self.events.on(SignalType.HistoryRequestSuccess.event) do(e: Args):
let h = HistoryRequestSuccessSignal(e)
info "history request success", requestId=h.requestId, peerId=h.peerId
proc initMailservers(self: Service) =
let wakuVersion = self.nodeConfigurationService.getWakuVersion()