Conversation
290044d to
1a92b46
Compare
| data: { count: 3 }, | ||
| }; | ||
|
|
||
| export const parseHeartbeatLog = (logMessage: string) => { |
There was a problem hiding this comment.
@metobom You will need to detect the heartbeat logs and then parse it. This would be the way to do that.
There was a problem hiding this comment.
Btw. one thing not mentioned (but you are probably aware) is that the hash of the config needs to be verified as well. In my implementation I only do that inside the test here.
1a92b46 to
6397183
Compare
| rawConfigHash, | ||
| ]; | ||
| const heartbeatSignature = await signHeartbeat(airnodeWallet, heartbeatPayload); | ||
| const heartbeatLog = [...heartbeatPayload, heartbeatSignature].join(' - '); |
There was a problem hiding this comment.
Doesn't it better to have some words indicates that it is heartbeat log? Like:
[Heartbeat] - 0xdAD65588187bC1a76C482174e25ACcED1413d2a1 - dev - 0.1.0 - 1699020775 - 1699020712 - 0xe872866f40b6a397b5bb5fe86b94809ba72e237633200c05d18ed345631fbd3b - 0x52843fc7b68cf2bacc6084929e6d77dbd71541d9b83838d078aaa2d7522eefec75b85a9f7628db787263d2dec93cb6d4194111411ec747d3b91d133c26bcb8341c
and log doesn't self descriptive so I'd prefer to have:
{
"airnode": "0xdAD65588187bC1a76C482174e25ACcED1413d2a1",
"stage": "dev",
"nodeVersion": "0.1.0",
...
"configHash": "0x52843fc7b68cf2bacc6084929e6d77dbd71541d9b83838d078aaa2d7522eefec75b85a9f7628db787263d2dec93cb6d4194111411ec747d3b91d133c26bcb8341c"
}Because I'm querying logs and searching this log type among all, it's not easy with this schema.
There was a problem hiding this comment.
Yeah, no problem. I think that would be better.
I can make the log message to be "Sending heartbeat" and specify all those fields as log context (which is JSON so it should be queryable). I've created #107
Closes #96