xrpld
Loading...
Searching...
No Matches
envconfig.h
1#pragma once
2
3#include <xrpld/core/Config.h>
4
5namespace xrpl::test {
6
7extern std::atomic<bool> gEnvUseIPv4;
8
9inline char const*
11{
12 return gEnvUseIPv4 ? "127.0.0.1" : "::1";
13}
14
18extern void
20
21namespace jtx {
22
29{
30 auto p = std::make_unique<Config>();
32 return p;
33}
34
47template <class F, class... Args>
49envconfig(F&& modfunc, Args&&... args)
50{
51 return modfunc(envconfig(), std::forward<Args>(args)...);
52}
53
63
65
67
69
71
84
93
103
115 std::string const& certPath,
116 std::string const& keyPath);
117
130 std::string const& certPath,
131 std::string const& keyPath,
132 std::string const& clientCAPath);
133
146 std::string const& certPath,
147 std::string const& keyPath,
148 std::string const& certChainPath);
149
153 std::map<std::string, std::string> extraVoting = {});
154
155} // namespace jtx
156} // namespace xrpl::test
T forward(T... args)
T make_unique(T... args)
std::unique_ptr< Config > addGrpcConfigWithTLSAndCertChain(std::unique_ptr< Config >, std::string const &certPath, std::string const &keyPath, std::string const &certChainPath)
add a grpc address, port and TLS with server cert chain to config
std::unique_ptr< Config > addGrpcConfigWithTLSAndClientCA(std::unique_ptr< Config >, std::string const &certPath, std::string const &keyPath, std::string const &clientCAPath)
add a grpc address, port and TLS certificate/key/client CA paths to config
std::unique_ptr< Config > addGrpcConfigWithTLS(std::unique_ptr< Config >, std::string const &certPath, std::string const &keyPath)
add a grpc address, port and TLS certificate/key paths to config
std::unique_ptr< Config > secureGateway(std::unique_ptr< Config >)
Definition envconfig.cpp:72
std::unique_ptr< Config > secureGatewayLocalnet(std::unique_ptr< Config >)
Definition envconfig.cpp:89
std::unique_ptr< Config > makeConfig(std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
std::unique_ptr< Config > singleThreadIo(std::unique_ptr< Config >)
Definition envconfig.cpp:98
std::unique_ptr< Config > addGrpcConfigWithSecureGateway(std::unique_ptr< Config >, std::string const &secureGateway)
add a grpc address, port and secureGateway to config
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:28
std::unique_ptr< Config > adminLocalnet(std::unique_ptr< Config >)
Definition envconfig.cpp:81
std::unique_ptr< Config > noAdmin(std::unique_ptr< Config >)
adjust config so no admin ports are enabled
Definition envconfig.cpp:64
std::unique_ptr< Config > addGrpcConfig(std::unique_ptr< Config >)
add a grpc address and port to config
std::unique_ptr< Config > validator(std::unique_ptr< Config >, std::string const &)
adjust configuration with params needed to be a validator
void setupConfigForUnitTests(Config &config)
initializes a config object for use with jtx::Env
Definition envconfig.cpp:19
char const * getEnvLocalhostAddr()
Definition envconfig.h:10
std::atomic< bool > gEnvUseIPv4
Definition envconfig.cpp:16