16
16
#include < string>
17
17
#include < vector>
18
18
19
- struct CCFConfig
19
+ namespace ccf
20
20
{
21
- size_t worker_threads = 0 ;
22
-
23
- // 2**24.5 as per RFC8446 Section 5.5
24
- size_t node_to_node_message_limit = 23'726'566 ;
21
+ struct CCFConfig
22
+ {
23
+ size_t worker_threads = 0 ;
25
24
26
- ccf::ds::SizeString historical_cache_soft_limit = {" 512MB" };
25
+ // 2**24.5 as per RFC8446 Section 5.5
26
+ size_t node_to_node_message_limit = 23'726'566 ;
27
27
28
- ccf::consensus::Configuration consensus = {};
29
- ccf::NodeInfoNetwork network = {};
28
+ ccf::ds::SizeString historical_cache_soft_limit = {" 512MB" };
30
29
31
- struct NodeCertificateInfo
32
- {
33
- std::string subject_name = " CN=CCF Node" ;
34
- std::vector<std::string> subject_alt_names = {};
35
- ccf::crypto::CurveID curve_id = ccf::crypto::CurveID::SECP384R1;
36
- size_t initial_validity_days = 1 ;
30
+ ccf::consensus::Configuration consensus = {};
31
+ ccf::NodeInfoNetwork network = {};
37
32
38
- bool operator ==(const NodeCertificateInfo&) const = default ;
39
- };
40
- NodeCertificateInfo node_certificate = {};
33
+ struct NodeCertificateInfo
34
+ {
35
+ std::string subject_name = " CN=CCF Node" ;
36
+ std::vector<std::string> subject_alt_names = {};
37
+ ccf::crypto::CurveID curve_id = ccf::crypto::CurveID::SECP384R1;
38
+ size_t initial_validity_days = 1 ;
41
39
42
- struct LedgerSignatures
43
- {
44
- size_t tx_count = 5000 ;
45
- ccf::ds::TimeString delay = {" 1000ms" };
40
+ bool operator ==(const NodeCertificateInfo&) const = default ;
41
+ };
42
+ NodeCertificateInfo node_certificate = {};
46
43
47
- bool operator ==(const LedgerSignatures&) const = default ;
48
- };
49
- LedgerSignatures ledger_signatures = {};
44
+ struct LedgerSignatures
45
+ {
46
+ size_t tx_count = 5000 ;
47
+ ccf::ds::TimeString delay = {" 1000ms" };
50
48
51
- struct JWT
52
- {
53
- ccf::ds::TimeString key_refresh_interval = {" 30min " };
49
+ bool operator ==( const LedgerSignatures&) const = default ;
50
+ };
51
+ LedgerSignatures ledger_signatures = {};
54
52
55
- bool operator ==( const JWT&) const = default ;
56
- };
57
- JWT jwt = {};
53
+ struct JWT
54
+ {
55
+ ccf::ds::TimeString key_refresh_interval = {" 30min " };
58
56
59
- struct Attestation
60
- {
61
- ccf::pal::snp::EndorsementsServers snp_endorsements_servers = {};
62
- std::optional<std::string> snp_security_policy_file = std::nullopt;
63
- std::optional<std::string> snp_uvm_endorsements_file = std::nullopt;
57
+ bool operator ==(const JWT&) const = default ;
58
+ };
59
+ JWT jwt = {};
64
60
65
- struct Environment
61
+ struct Attestation
66
62
{
67
- std::optional<std::string> security_policy = std::nullopt;
68
- std::optional<std::string> uvm_endorsements = std::nullopt;
63
+ ccf::pal::snp::EndorsementsServers snp_endorsements_servers = {};
64
+ std::optional<std::string> snp_security_policy_file = std::nullopt;
65
+ std::optional<std::string> snp_uvm_endorsements_file = std::nullopt;
69
66
70
- bool operator ==(const Environment&) const = default ;
71
- };
72
- Environment environment = {};
67
+ struct Environment
68
+ {
69
+ std::optional<std::string> security_policy = std::nullopt;
70
+ std::optional<std::string> uvm_endorsements = std::nullopt;
73
71
74
- bool operator ==(const Attestation&) const = default ;
72
+ bool operator ==(const Environment&) const = default ;
73
+ };
74
+ Environment environment = {};
75
+
76
+ bool operator ==(const Attestation&) const = default ;
77
+ };
78
+ Attestation attestation = {};
75
79
};
76
- Attestation attestation = {};
77
- };
78
80
79
- struct StartupConfig : CCFConfig
80
- {
81
- StartupConfig () = default ;
82
- StartupConfig (const CCFConfig& common_base) : CCFConfig(common_base) {}
81
+ struct StartupConfig : CCFConfig
82
+ {
83
+ StartupConfig () = default ;
84
+ StartupConfig (const CCFConfig& common_base) : CCFConfig(common_base) {}
83
85
84
- std::string startup_host_time;
85
- size_t snapshot_tx_interval = 10'000 ;
86
+ std::string startup_host_time;
87
+ size_t snapshot_tx_interval = 10'000 ;
86
88
87
- // Only if starting or recovering
88
- size_t initial_service_certificate_validity_days = 1 ;
89
- std::string service_subject_name = " CN=CCF Service" ;
90
- ccf::COSESignaturesConfig cose_signatures;
89
+ // Only if starting or recovering
90
+ size_t initial_service_certificate_validity_days = 1 ;
91
+ std::string service_subject_name = " CN=CCF Service" ;
92
+ ccf::COSESignaturesConfig cose_signatures;
91
93
92
- nlohmann::json service_data = nullptr ;
94
+ nlohmann::json service_data = nullptr ;
93
95
94
- nlohmann::json node_data = nullptr ;
96
+ nlohmann::json node_data = nullptr ;
95
97
96
- struct Start
97
- {
98
- std::vector<ccf::NewMember> members;
99
- std::string constitution;
100
- ccf::ServiceConfiguration service_configuration;
98
+ struct Start
99
+ {
100
+ std::vector<ccf::NewMember> members;
101
+ std::string constitution;
102
+ ccf::ServiceConfiguration service_configuration;
101
103
102
- bool operator ==(const Start& other) const = default ;
103
- };
104
- Start start = {};
104
+ bool operator ==(const Start& other) const = default ;
105
+ };
106
+ Start start = {};
105
107
106
- struct Join
107
- {
108
- ccf::NodeInfoNetwork::NetAddress target_rpc_address;
109
- ccf::ds::TimeString retry_timeout = {" 1000ms" };
110
- std::vector<uint8_t > service_cert = {};
111
- bool follow_redirect = true ;
112
- };
113
- Join join = {};
108
+ struct Join
109
+ {
110
+ ccf::NodeInfoNetwork::NetAddress target_rpc_address;
111
+ ccf::ds::TimeString retry_timeout = {" 1000ms" };
112
+ std::vector<uint8_t > service_cert = {};
113
+ bool follow_redirect = true ;
114
+ };
115
+ Join join = {};
114
116
115
- struct Recover
116
- {
117
- std::optional<std::vector<uint8_t >> previous_service_identity =
118
- std::nullopt;
117
+ struct Recover
118
+ {
119
+ std::optional<std::vector<uint8_t >> previous_service_identity =
120
+ std::nullopt;
121
+ };
122
+ Recover recover = {};
119
123
};
120
- Recover recover = {};
121
- };
124
+ }
0 commit comments