rippled
Loading...
Searching...
No Matches
envconfig.h
1#ifndef XRPL_TEST_JTX_ENVCONFIG_H_INCLUDED
2#define XRPL_TEST_JTX_ENVCONFIG_H_INCLUDED
3
4#include <xrpld/core/Config.h>
5
6namespace ripple {
7namespace test {
8
9// frequently used macros defined here for convinience.
10#define PORT_WS "port_ws"
11#define PORT_RPC "port_rpc"
12#define PORT_PEER "port_peer"
13
15
16inline char const*
18{
19 return envUseIPv4 ? "127.0.0.1" : "::1";
20}
21
25extern void
27
28namespace jtx {
29
36{
37 auto p = std::make_unique<Config>();
39 return p;
40}
41
54template <class F, class... Args>
56envconfig(F&& modfunc, Args&&... args)
57{
58 return modfunc(envconfig(), std::forward<Args>(args)...);
59}
60
70
72
74
76
89
98
109 std::string const& secureGateway);
110
114 std::map<std::string, std::string> extraVoting = {});
115
116} // namespace jtx
117} // namespace test
118} // namespace ripple
119
120#endif
T is_same_v
std::unique_ptr< Config > validator(std::unique_ptr< Config >, std::string const &)
adjust configuration with params needed to be a validator
Definition envconfig.cpp:94
std::unique_ptr< Config > admin_localnet(std::unique_ptr< Config >)
Definition envconfig.cpp:74
std::unique_ptr< Config > makeConfig(std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
std::unique_ptr< Config > secure_gateway(std::unique_ptr< Config >)
Definition envconfig.cpp:65
std::unique_ptr< Config > no_admin(std::unique_ptr< Config >)
adjust config so no admin ports are enabled
Definition envconfig.cpp:57
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:35
std::unique_ptr< Config > addGrpcConfig(std::unique_ptr< Config >)
add a grpc address and port to config
std::unique_ptr< Config > addGrpcConfigWithSecureGateway(std::unique_ptr< Config >, std::string const &secureGateway)
add a grpc address, port and secure_gateway to config
std::unique_ptr< Config > secure_gateway_localnet(std::unique_ptr< Config >)
Definition envconfig.cpp:82
void setupConfigForUnitTests(Config &config)
initializes a config object for use with jtx::Env
Definition envconfig.cpp:12
std::atomic< bool > envUseIPv4
Definition envconfig.cpp:9
char const * getEnvLocalhostAddr()
Definition envconfig.h:17
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6