Compare commits

..

3 Commits

5 changed files with 49 additions and 15 deletions

View File

@@ -375,3 +375,14 @@ jobs:
echo "Error: rippled executable not found in ${{ env.build_dir }}"
exit 1
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@v4
with:
name: server-definitions
path: server_definitions.json

View File

@@ -2730,23 +2730,26 @@ DEFINE_HOOK_FUNCTION(
return serialize_keylet(kl, memory, write_ptr, write_len);
}
// These keylet types are not yet implemented. Their
// corresponding amendments are not yet supported on the
// network. Each case needs a full implementation (see
// above cases for reference) before its amendment can be
// enabled.
// featureXChainBridge
case keylet_code::BRIDGE:
case keylet_code::XCHAIN_OWNED_CLAIM_ID:
case keylet_code::XCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID:
// featureMPTokensV1
case keylet_code::XCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID: {
if (!applyCtx.view().rules().enabled(featureXChainBridge))
return INVALID_ARGUMENT;
}
case keylet_code::MPTOKEN_ISSUANCE:
case keylet_code::MPTOKEN:
// featureCredentials
case keylet_code::CREDENTIAL:
// featurePermissionedDomains
case keylet_code::PERMISSIONED_DOMAIN:
return INVALID_ARGUMENT;
case keylet_code::MPTOKEN: {
if (!applyCtx.view().rules().enabled(featureMPTokensV1))
return INVALID_ARGUMENT;
}
case keylet_code::CREDENTIAL: {
if (!applyCtx.view().rules().enabled(featureCredentials))
return INVALID_ARGUMENT;
}
case keylet_code::PERMISSIONED_DOMAIN: {
if (!applyCtx.view().rules().enabled(
featurePermissionedDomains))
return INVALID_ARGUMENT;
}
}
}
catch (std::exception& e)

View File

@@ -24,6 +24,7 @@
#include <xrpld/core/TimeKeeper.h>
#include <xrpld/net/RPCCall.h>
#include <xrpld/rpc/RPCHandler.h>
#include <xrpld/rpc/handlers/Handlers.h>
#include <xrpl/basics/Log.h>
#include <xrpl/basics/StringUtilities.h>
#include <xrpl/basics/contract.h>
@@ -387,7 +388,8 @@ run(int argc, char** argv)
po::value<std::string>(),
"Specify the range of present ledgers for testing purposes. Min and "
"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");
data.add_options()("import", importText.c_str())(
@@ -529,6 +531,13 @@ run(int argc, char** argv)
return 0;
}
if (vm.count("definitions"))
{
auto defs = getStaticServerDefinitions();
std::cout << Json::FastWriter().write(defs);
return 0;
}
#ifndef ENABLE_TESTS
if (vm.count("unittest") || vm.count("unittest-child"))
{

View File

@@ -129,6 +129,8 @@ doRipplePathFind(RPC::JsonContext&);
Json::Value
doServerDefinitions(RPC::JsonContext&);
Json::Value
getStaticServerDefinitions();
Json::Value
doServerInfo(RPC::JsonContext&); // for humans
Json::Value
doServerState(RPC::JsonContext&); // for machines

View File

@@ -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
doServerDefinitions(RPC::JsonContext& context)
{