Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving imported-validator-status #1915

Merged
merged 22 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
FIX: return message
gbayasgalan committed Jun 26, 2024
commit 06a6bd453473653d0d4d768d450818a4fea42a69
25 changes: 7 additions & 18 deletions launcher/src/backend/Monitoring.js
Original file line number Diff line number Diff line change
@@ -3248,10 +3248,15 @@ rm -rf diskoutput
const stdoutJson = output.substring(jsonStartIndex, jsonEndIndex + 1);
const parsedJson = JSON.parse(stdoutJson);

let message =
`${parsedJson?.message || ""}${parsedJson?.message && parsedJson?.stacktraces ? "\n" : ""}${
parsedJson?.stacktraces || ""
}`.trim() || output;

return {
pubkey: pubkey,
code: parsedJson.code || null,
msg: parsedJson.message || output,
msg: message,
};
};

@@ -3273,25 +3278,9 @@ rm -rf diskoutput
`-H 'Content-Type: application/json' ` +
`-d '${JSON.stringify(exitMsg)}' -i -s`;

let runExitCommand = await this.nodeConnection.sshService.exec(exitCommand);
const runExitCommand = await this.nodeConnection.sshService.exec(exitCommand);
log.info(runExitCommand);

//-------------------------dummy for testing-------------------------
runExitCommand = {
rc: 0,
stdout:
"HTTP/1.1 200 OK\r\n" +
"Server: nim-presto/0.0.3 (amd64/linux)\r\n" +
"Content-Length: 63\r\n" +
"Content-Type: application/json\r\n" +
"Date: Mon, 24 Jun 2024 13:40:02 GMT\r\n" +
"Connection: close\r\n" +
"\r\n" +
'{"code":200,"message":"Voluntary exit object(s) was broadcast"}',
stderr: "",
};
//--------------------------------------------------------------------

if (SSHService.checkExecError(runExitCommand) && runExitCommand.stderr) {
throw new Error(SSHService.extractExecError(runExitCommand));
}