rippled
Loading...
Searching...
No Matches
envconfig.h
1#pragma once
2
3#include <xrpld/core/Config.h>
4
5namespace xrpl {
6namespace test {
7
8// frequently used macros defined here for convenience.
9#define PORT_WS "port_ws"
10#define PORT_RPC "port_rpc"
11#define PORT_PEER "port_peer"
12
14
15inline char const*
17{
18 return envUseIPv4 ? "127.0.0.1" : "::1";
19}
20
24extern void
26
27namespace jtx {
28
35{
36 auto p = std::make_unique<Config>();
38 return p;
39}
40
53template <class F, class... Args>
55envconfig(F&& modfunc, Args&&... args)
56{
57 return modfunc(envconfig(), std::forward<Args>(args)...);
58}
59
69
71
73
75
88
97
107
110
111} // namespace jtx
112} // namespace test
113} // namespace xrpl
T is_same_v
std::unique_ptr< Config > secure_gateway(std::unique_ptr< Config >)
Definition envconfig.cpp:65
std::unique_ptr< Config > makeConfig(std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
std::unique_ptr< Config > admin_localnet(std::unique_ptr< Config >)
Definition envconfig.cpp:74
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 > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:34
std::unique_ptr< Config > addGrpcConfig(std::unique_ptr< Config >)
add a grpc address and port to config
std::unique_ptr< Config > secure_gateway_localnet(std::unique_ptr< Config >)
Definition envconfig.cpp:82
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 > no_admin(std::unique_ptr< Config >)
adjust config so no admin ports are enabled
Definition envconfig.cpp:57
std::atomic< bool > envUseIPv4
Definition envconfig.cpp:9
void setupConfigForUnitTests(Config &config)
initializes a config object for use with jtx::Env
Definition envconfig.cpp:12
char const * getEnvLocalhostAddr()
Definition envconfig.h:16
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5