CCF
Loading...
Searching...
No Matches
node_call_types.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
17#include "enclave/interface.h"
18#include "node/identity.h"
19#include "node/ledger_secrets.h"
21
22#include <nlohmann/json.hpp>
23
24namespace ccf
25{
26 struct GetState
27 {
28 using In = void;
29
30 struct Out
31 {
36
37 // Only on recovery
38 std::optional<ccf::kv::Version> recovery_target_seqno;
39 std::optional<ccf::kv::Version> last_recovered_seqno;
40
42 };
43 };
44
46 {
47 using In = void;
48
49 struct Out
50 {
51 std::string ccf_version;
52 std::string quickjs_version;
53 bool unsafe{};
54 };
55 };
56
58 {
59 struct In
60 {
69 std::optional<HostDataMetadata> snp_security_policy =
70 std::nullopt; // base64-encoded
71 std::optional<pal::UVMEndorsements> snp_uvm_endorsements = std::nullopt;
73 nlohmann::json node_data;
74 nlohmann::json service_data;
76 std::optional<std::pair<SealedRecoveryKey, sealing_recovery::Name>>
77 sealing_recovery_data = std::nullopt;
78
79 // Only set on genesis transaction, but not on recovery
80 std::optional<ccf::StartupConfig::Start> genesis_info = std::nullopt;
81 };
82 };
83
85 {
86 struct In
87 {
91 std::optional<ccf::kv::Version> startup_seqno = std::nullopt;
92 std::optional<ccf::crypto::Pem> certificate_signing_request =
93 std::nullopt;
94 nlohmann::json node_data = nullptr;
95 std::optional<std::pair<SealedRecoveryKey, sealing_recovery::Name>>
96 sealing_recovery_data = std::nullopt;
97 std::optional<std::vector<uint8_t>> code_transparent_statement =
98 std::nullopt;
99 std::optional<ccf::LedgerSignMode> ledger_sign_mode = std::nullopt;
100 // Incremented by the joiner each time it retries a join request after
101 // receiving a StartupSeqnoIsOld response.
102 std::optional<uint32_t> join_fetch_count = std::nullopt;
103 };
104
105 struct Out
106 {
108
109 // Deprecated in 2.x
110 std::optional<NodeId> node_id = std::nullopt;
111
113 {
114 bool public_only = false;
118 std::optional<ServiceStatus> service_status = std::nullopt;
119
120 std::optional<ccf::crypto::Pem> endorsed_certificate = std::nullopt;
121 std::optional<ccf::COSESignaturesConfig> cose_signatures_config =
122 std::nullopt;
123
124 NetworkInfo() = default;
125
127 bool public_only,
132 std::optional<ccf::crypto::Pem> endorsed_certificate,
133 std::optional<ccf::COSESignaturesConfig> cose_signatures_config_) :
140 cose_signatures_config(std::move(cose_signatures_config_))
141 {}
142
143 bool operator==(const NetworkInfo& other) const
144 {
145 return public_only == other.public_only &&
148 identity == other.identity &&
152 }
153
154 bool operator!=(const NetworkInfo& other) const
155 {
156 return !(*this == other);
157 }
158 };
159
160 // Only set if the caller node is trusted
161 std::optional<NetworkInfo> network_info = std::nullopt;
162 };
163 };
164
165}
Definition pem.h:18
uint64_t Version
Definition version.h:10
Definition app_interface.h:13
NodeStatus
Definition node_info.h:18
std::map< ccf::kv::Version, LedgerSecretPtr > LedgerSecretsMap
Definition ledger_secrets.h:21
ServiceStatus
Definition service.h:13
NodeStartupState
Definition node_startup_state.h:10
STL namespace.
Definition node_call_types.h:60
std::optional< pal::UVMEndorsements > snp_uvm_endorsements
Definition node_call_types.h:71
QuoteInfo quote_info
Definition node_call_types.h:66
nlohmann::json node_data
Definition node_call_types.h:73
std::optional< HostDataMetadata > snp_security_policy
Definition node_call_types.h:69
std::optional< ccf::StartupConfig::Start > genesis_info
Definition node_call_types.h:80
ccf::crypto::Pem service_cert
Definition node_call_types.h:65
NodeId node_id
Definition node_call_types.h:61
std::optional< std::pair< SealedRecoveryKey, sealing_recovery::Name > > sealing_recovery_data
Definition node_call_types.h:77
ccf::TxID create_txid
Definition node_call_types.h:75
ccf::crypto::Pem certificate_signing_request
Definition node_call_types.h:62
NodeInfoNetwork node_info_network
Definition node_call_types.h:72
ccf::crypto::Pem public_key
Definition node_call_types.h:64
ccf::crypto::Pem node_endorsed_certificate
Definition node_call_types.h:63
pal::PlatformAttestationMeasurement measurement
Definition node_call_types.h:68
ccf::crypto::Pem public_encryption_key
Definition node_call_types.h:67
nlohmann::json service_data
Definition node_call_types.h:74
Definition node_call_types.h:58
Definition node_call_types.h:31
std::optional< ccf::kv::Version > last_recovered_seqno
Definition node_call_types.h:39
std::optional< ccf::kv::Version > recovery_target_seqno
Definition node_call_types.h:38
bool stop_notice
Definition node_call_types.h:41
ccf::NodeId node_id
Definition node_call_types.h:32
ccf::kv::Version startup_seqno
Definition node_call_types.h:35
ccf::NodeStartupState state
Definition node_call_types.h:33
ccf::kv::Version last_signed_seqno
Definition node_call_types.h:34
Definition node_call_types.h:27
void In
Definition node_call_types.h:28
Definition node_call_types.h:50
bool unsafe
Definition node_call_types.h:53
std::string quickjs_version
Definition node_call_types.h:52
std::string ccf_version
Definition node_call_types.h:51
Definition node_call_types.h:46
void In
Definition node_call_types.h:47
Definition node_call_types.h:87
std::optional< std::vector< uint8_t > > code_transparent_statement
Definition node_call_types.h:97
QuoteInfo quote_info
Definition node_call_types.h:89
std::optional< ccf::crypto::Pem > certificate_signing_request
Definition node_call_types.h:92
std::optional< ccf::kv::Version > startup_seqno
Definition node_call_types.h:91
std::optional< ccf::LedgerSignMode > ledger_sign_mode
Definition node_call_types.h:99
NodeInfoNetwork node_info_network
Definition node_call_types.h:88
nlohmann::json node_data
Definition node_call_types.h:94
std::optional< uint32_t > join_fetch_count
Definition node_call_types.h:102
ccf::crypto::Pem public_encryption_key
Definition node_call_types.h:90
std::optional< std::pair< SealedRecoveryKey, sealing_recovery::Name > > sealing_recovery_data
Definition node_call_types.h:96
Definition node_call_types.h:113
std::optional< ccf::crypto::Pem > endorsed_certificate
Definition node_call_types.h:120
bool operator==(const NetworkInfo &other) const
Definition node_call_types.h:143
ccf::kv::Version last_recovered_signed_idx
Definition node_call_types.h:115
LedgerSecretsMap ledger_secrets
Definition node_call_types.h:116
NetworkInfo(bool public_only, ccf::kv::Version last_recovered_signed_idx, LedgerSecretsMap ledger_secrets, const NetworkIdentity &identity, ServiceStatus service_status, std::optional< ccf::crypto::Pem > endorsed_certificate, std::optional< ccf::COSESignaturesConfig > cose_signatures_config_)
Definition node_call_types.h:126
NetworkIdentity identity
Definition node_call_types.h:117
std::optional< ServiceStatus > service_status
Definition node_call_types.h:118
std::optional< ccf::COSESignaturesConfig > cose_signatures_config
Definition node_call_types.h:121
bool operator!=(const NetworkInfo &other) const
Definition node_call_types.h:154
bool public_only
Definition node_call_types.h:114
Definition node_call_types.h:106
std::optional< NodeId > node_id
Definition node_call_types.h:110
std::optional< NetworkInfo > network_info
Definition node_call_types.h:161
NodeStatus node_status
Definition node_call_types.h:107
Definition node_call_types.h:85
Definition identity.h:18
Definition node_info_network.h:179
Describes a quote (attestation) from trusted hardware.
Definition quote_info.h:26
Definition tx_id.h:44
Definition measurement.h:123