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

Support version over jsonrpc #852

Merged
merged 1 commit into from Oct 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions llarp/rpc/rpc.cpp
@@ -1,5 +1,6 @@
#include <rpc/rpc.hpp>

#include <constants/version.hpp>
#include <router/abstractrouter.hpp>
#include <service/context.hpp>
#include <util/logging/logger.hpp>
Expand Down Expand Up @@ -259,6 +260,13 @@ namespace llarp
return resp;
}

Response
DumpVersion() const
{
const Response resp{{"version", LLARP_VERSION}};
return resp;
}

absl::optional< Response >
HandleJSONRPC(Method_t method,
ABSL_ATTRIBUTE_UNUSED const Params& params) override
Expand All @@ -279,6 +287,10 @@ namespace llarp
{
return DumpStatus();
}
if(method == "llarp.version")
{
return DumpVersion();
}
return false;
}
};
Expand Down