xrpld
Loading...
Searching...
No Matches
envconfig.h
1#pragma once
2
3#include <xrpld/core/Config.h>
4
5#include <atomic>
6#include <map>
7#include <memory>
8#include <string>
9
10namespace xrpl::test {
11
12extern std::atomic<bool> gEnvUseIPv4;
13
14inline char const*
16{
17 return gEnvUseIPv4 ? "127.0.0.1" : "::1";
18}
19
25extern void
27
28namespace jtx {
29
38{
39 auto p = std::make_unique<Config>();
41 return p;
42}
43
58template <class F, class... Args>
60envconfig(F&& modfunc, Args&&... args)
61{
62 return modfunc(envconfig(), std::forward<Args>(args)...);
63}
64
76
78
80
82
84
99
110
122
136 std::string const& certPath,
137 std::string const& keyPath);
138
153 std::string const& certPath,
154 std::string const& keyPath,
155 std::string const& clientCAPath);
156
171 std::string const& certPath,
172 std::string const& keyPath,
173 std::string const& certChainPath);
174
178 std::map<std::string, std::string> extraVoting = {});
179
180} // namespace jtx
181} // 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:37
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:15
std::atomic< bool > gEnvUseIPv4
Definition envconfig.cpp:16