mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-26 22:17:43 +00:00
Compare commits
5 Commits
dev
...
cli-defini
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea835da1f4 | ||
|
|
4bfd1966da | ||
|
|
0e0a46b2af | ||
|
|
47a12fe33b | ||
|
|
4403c4f427 |
12
.github/workflows/xahau-ga-nix.yml
vendored
12
.github/workflows/xahau-ga-nix.yml
vendored
@@ -375,3 +375,15 @@ jobs:
|
|||||||
echo "Error: rippled executable not found in ${{ env.build_dir }}"
|
echo "Error: rippled executable not found in ${{ env.build_dir }}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Export server definitions
|
||||||
|
run: |
|
||||||
|
${{ env.build_dir }}/rippled --definitions | python3 -m json.tool > server_definitions.json
|
||||||
|
|
||||||
|
- name: Upload server definitions
|
||||||
|
if: matrix.compiler_id == 'gcc-13-libstdcxx'
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: server-definitions
|
||||||
|
path: server_definitions.json
|
||||||
|
archive: false
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <xrpld/core/TimeKeeper.h>
|
#include <xrpld/core/TimeKeeper.h>
|
||||||
#include <xrpld/net/RPCCall.h>
|
#include <xrpld/net/RPCCall.h>
|
||||||
#include <xrpld/rpc/RPCHandler.h>
|
#include <xrpld/rpc/RPCHandler.h>
|
||||||
|
#include <xrpld/rpc/handlers/Handlers.h>
|
||||||
#include <xrpl/basics/Log.h>
|
#include <xrpl/basics/Log.h>
|
||||||
#include <xrpl/basics/StringUtilities.h>
|
#include <xrpl/basics/StringUtilities.h>
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
@@ -387,7 +388,8 @@ run(int argc, char** argv)
|
|||||||
po::value<std::string>(),
|
po::value<std::string>(),
|
||||||
"Specify the range of present ledgers for testing purposes. Min and "
|
"Specify the range of present ledgers for testing purposes. Min and "
|
||||||
"max values are comma separated.")(
|
"max values are comma separated.")(
|
||||||
"version", "Display the build version.");
|
"version", "Display the build version.")(
|
||||||
|
"definitions", "Output server definitions as JSON and exit.");
|
||||||
|
|
||||||
po::options_description data("Ledger/Data Options");
|
po::options_description data("Ledger/Data Options");
|
||||||
data.add_options()("import", importText.c_str())(
|
data.add_options()("import", importText.c_str())(
|
||||||
@@ -529,6 +531,13 @@ run(int argc, char** argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vm.count("definitions"))
|
||||||
|
{
|
||||||
|
auto defs = getStaticServerDefinitions();
|
||||||
|
std::cout << Json::FastWriter().write(defs);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef ENABLE_TESTS
|
#ifndef ENABLE_TESTS
|
||||||
if (vm.count("unittest") || vm.count("unittest-child"))
|
if (vm.count("unittest") || vm.count("unittest-child"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -129,6 +129,8 @@ doRipplePathFind(RPC::JsonContext&);
|
|||||||
Json::Value
|
Json::Value
|
||||||
doServerDefinitions(RPC::JsonContext&);
|
doServerDefinitions(RPC::JsonContext&);
|
||||||
Json::Value
|
Json::Value
|
||||||
|
getStaticServerDefinitions();
|
||||||
|
Json::Value
|
||||||
doServerInfo(RPC::JsonContext&); // for humans
|
doServerInfo(RPC::JsonContext&); // for humans
|
||||||
Json::Value
|
Json::Value
|
||||||
doServerState(RPC::JsonContext&); // for machines
|
doServerState(RPC::JsonContext&); // for machines
|
||||||
|
|||||||
@@ -523,6 +523,15 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Json::Value
|
||||||
|
getStaticServerDefinitions()
|
||||||
|
{
|
||||||
|
static const Definitions defs{};
|
||||||
|
Json::Value ret = defs();
|
||||||
|
ret[jss::hash] = to_string(defs.getHash());
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
Json::Value
|
Json::Value
|
||||||
doServerDefinitions(RPC::JsonContext& context)
|
doServerDefinitions(RPC::JsonContext& context)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user