Support version over jsonrcp

pull/852/head
Michael 5 years ago
parent b8239a3c23
commit d467e2618b
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C

@ -1,5 +1,6 @@
#include <rpc/rpc.hpp> #include <rpc/rpc.hpp>
#include <constants/version.hpp>
#include <router/abstractrouter.hpp> #include <router/abstractrouter.hpp>
#include <service/context.hpp> #include <service/context.hpp>
#include <util/logging/logger.hpp> #include <util/logging/logger.hpp>
@ -259,6 +260,13 @@ namespace llarp
return resp; return resp;
} }
Response
DumpVersion() const
{
const Response resp{{"version", LLARP_VERSION}};
return resp;
}
absl::optional< Response > absl::optional< Response >
HandleJSONRPC(Method_t method, HandleJSONRPC(Method_t method,
ABSL_ATTRIBUTE_UNUSED const Params& params) override ABSL_ATTRIBUTE_UNUSED const Params& params) override
@ -279,6 +287,10 @@ namespace llarp
{ {
return DumpStatus(); return DumpStatus();
} }
if(method == "llarp.version")
{
return DumpVersion();
}
return false; return false;
} }
}; };

Loading…
Cancel
Save