xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
envconfig.h
1
#pragma once
2
3
#include <xrpld/core/Config.h>
4
5
#include <
atomic
>
6
#include <
cstdint
>
7
#include <
map
>
8
#include <
memory
>
9
#include <
string
>
10
11
namespace
xrpl::test
{
12
13
extern
std::atomic<bool>
gEnvUseIPv4
;
14
15
inline
char
const
*
16
getEnvLocalhostAddr
()
17
{
18
return
gEnvUseIPv4
?
"127.0.0.1"
:
"::1"
;
19
}
20
26
extern
void
27
setupConfigForUnitTests
(
Config
& config);
28
29
namespace
jtx {
30
37
inline
std::unique_ptr<Config>
38
envconfig
()
39
{
40
auto
p =
std::make_unique<Config>
();
41
setupConfigForUnitTests
(*p);
42
return
p;
43
}
44
59
template
<
class
F,
class
... Args>
60
std::unique_ptr<Config>
61
envconfig
(F&& modfunc, Args&&... args)
62
{
63
return
modfunc(
envconfig
(),
std::forward<Args>
(args)...);
64
}
65
76
std::unique_ptr<Config>
77
onlineDelete
(
std::unique_ptr<Config>
cfg,
std::uint32_t
deleteInterval = 8);
78
89
std::unique_ptr<Config>
noAdmin
(
std::unique_ptr<Config>
);
90
91
std::unique_ptr<Config>
secureGateway
(
std::unique_ptr<Config>
);
92
93
std::unique_ptr<Config>
adminLocalnet
(
std::unique_ptr<Config>
);
94
95
std::unique_ptr<Config>
secureGatewayLocalnet
(
std::unique_ptr<Config>
);
96
97
std::unique_ptr<Config>
singleThreadIo
(
std::unique_ptr<Config>
);
98
111
std::unique_ptr<Config>
112
validator
(
std::unique_ptr<Config>
,
std::string
const
&);
113
123
std::unique_ptr<Config>
addGrpcConfig
(
std::unique_ptr<Config>
);
124
134
std::unique_ptr<Config>
135
addGrpcConfigWithSecureGateway
(
std::unique_ptr<Config>
,
std::string
const
&
secureGateway
);
136
147
std::unique_ptr<Config>
148
addGrpcConfigWithTLS
(
149
std::unique_ptr<Config>
,
150
std::string
const
& certPath,
151
std::string
const
& keyPath);
152
164
std::unique_ptr<Config>
165
addGrpcConfigWithTLSAndClientCA
(
166
std::unique_ptr<Config>
,
167
std::string
const
& certPath,
168
std::string
const
& keyPath,
169
std::string
const
& clientCAPath);
170
182
std::unique_ptr<Config>
183
addGrpcConfigWithTLSAndCertChain
(
184
std::unique_ptr<Config>
,
185
std::string
const
& certPath,
186
std::string
const
& keyPath,
187
std::string
const
& certChainPath);
188
189
std::unique_ptr<Config>
190
makeConfig
(
191
std::map<std::string, std::string>
extraTxQ = {},
192
std::map<std::string, std::string>
extraVoting = {});
193
194
}
// namespace jtx
195
}
// namespace xrpl::test
atomic
std::string
xrpl::Config
Definition
src/xrpld/core/Config.h:89
cstdint
std::forward
T forward(T... args)
std::uint32_t
std::make_unique
T make_unique(T... args)
map
memory
xrpl::test::jtx::addGrpcConfigWithTLSAndCertChain
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
Definition
envconfig.cpp:175
xrpl::test::jtx::addGrpcConfigWithTLSAndClientCA
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
Definition
envconfig.cpp:160
xrpl::test::jtx::addGrpcConfigWithTLS
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
Definition
envconfig.cpp:147
xrpl::test::jtx::secureGateway
std::unique_ptr< Config > secureGateway(std::unique_ptr< Config >)
Definition
envconfig.cpp:83
xrpl::test::jtx::secureGatewayLocalnet
std::unique_ptr< Config > secureGatewayLocalnet(std::unique_ptr< Config >)
Definition
envconfig.cpp:100
xrpl::test::jtx::makeConfig
std::unique_ptr< Config > makeConfig(std::map< std::string, std::string > extraTxQ={}, std::map< std::string, std::string > extraVoting={})
Definition
envconfig.cpp:190
xrpl::test::jtx::singleThreadIo
std::unique_ptr< Config > singleThreadIo(std::unique_ptr< Config >)
Definition
envconfig.cpp:109
xrpl::test::jtx::addGrpcConfigWithSecureGateway
std::unique_ptr< Config > addGrpcConfigWithSecureGateway(std::unique_ptr< Config >, std::string const &secureGateway)
add a grpc address, port and secureGateway to config
Definition
envconfig.cpp:135
xrpl::test::jtx::envconfig
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition
envconfig.h:38
xrpl::test::jtx::adminLocalnet
std::unique_ptr< Config > adminLocalnet(std::unique_ptr< Config >)
Definition
envconfig.cpp:92
xrpl::test::jtx::noAdmin
std::unique_ptr< Config > noAdmin(std::unique_ptr< Config >)
adjust config so no admin ports are enabled
Definition
envconfig.cpp:75
xrpl::test::jtx::addGrpcConfig
std::unique_ptr< Config > addGrpcConfig(std::unique_ptr< Config >)
add a grpc address and port to config
Definition
envconfig.cpp:127
xrpl::test::jtx::onlineDelete
std::unique_ptr< Config > onlineDelete(std::unique_ptr< Config > cfg, std::uint32_t deleteInterval=8)
adjust config to enable online_delete
Definition
envconfig.cpp:66
xrpl::test::jtx::validator
std::unique_ptr< Config > validator(std::unique_ptr< Config >, std::string const &)
adjust configuration with params needed to be a validator
Definition
envconfig.cpp:118
xrpl::test
Definition
STLedgerEntry.h:21
xrpl::test::setupConfigForUnitTests
void setupConfigForUnitTests(Config &config)
initializes a config object for use with jtx::Env
Definition
envconfig.cpp:21
xrpl::test::getEnvLocalhostAddr
char const * getEnvLocalhostAddr()
Definition
envconfig.h:16
xrpl::test::gEnvUseIPv4
std::atomic< bool > gEnvUseIPv4
Definition
envconfig.cpp:18
string
std::unique_ptr
Generated by
1.17.0