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
8#include "ccf/pal/mem.h"
15#include "enclave/interface.h"
16#include "node/identity.h"
17#include "node/ledger_secrets.h"
19
20#include <nlohmann/json.hpp>
21
22namespace ccf
23{
24 struct GetState
25 {
26 using In = void;
27
28 struct Out
29 {
34
35 // Only on recovery
36 std::optional<ccf::kv::Version> recovery_target_seqno;
37 std::optional<ccf::kv::Version> last_recovered_seqno;
38
40 };
41 };
42
44 {
45 using In = void;
46
47 struct Out
48 {
49 std::string ccf_version;
50 std::string quickjs_version;
51 bool unsafe;
52 };
53 };
54
56 {
57 struct In
58 {
67 std::optional<HostDataMetadata> snp_security_policy =
68 std::nullopt; // base64-encoded
69 std::optional<pal::UVMEndorsements> snp_uvm_endorsements = std::nullopt;
71 nlohmann::json node_data;
72 nlohmann::json service_data;
74
75 // Only set on genesis transaction, but not on recovery
76 std::optional<ccf::StartupConfig::Start> genesis_info = std::nullopt;
77 };
78 };
79
81 {
82 struct In
83 {
87 std::optional<ccf::kv::Version> startup_seqno = std::nullopt;
88 std::optional<ccf::crypto::Pem> certificate_signing_request =
89 std::nullopt;
90 nlohmann::json node_data = nullptr;
91 };
92
93 struct Out
94 {
96
97 // Deprecated in 2.x
98 std::optional<NodeId> node_id = std::nullopt;
99
101 {
102 bool public_only = false;
106 std::optional<ServiceStatus> service_status = std::nullopt;
107
108 std::optional<ccf::crypto::Pem> endorsed_certificate = std::nullopt;
109 std::optional<ccf::COSESignaturesConfig> cose_signatures_config =
110 std::nullopt;
111
113
115 bool public_only,
120 const std::optional<ccf::crypto::Pem>& endorsed_certificate,
121 const std::optional<ccf::COSESignaturesConfig>&
122 cose_signatures_config_) :
129 cose_signatures_config(cose_signatures_config_)
130 {}
131
132 bool operator==(const NetworkInfo& other) const
133 {
134 return public_only == other.public_only &&
137 identity == other.identity &&
141 }
142
143 bool operator!=(const NetworkInfo& other) const
144 {
145 return !(*this == other);
146 }
147 };
148
149 // Only set if the caller node is trusted
150 std::optional<NetworkInfo> network_info = std::nullopt;
151 };
152 };
153
172}
Definition pem.h:18
uint64_t Version
Definition version.h:8
Definition app_interface.h:14
ServiceStatus
Definition service.h:13
std::map< ccf::kv::Version, LedgerSecretPtr > LedgerSecretsMap
Definition ledger_secrets.h:20
NodeStartupState
Definition node_startup_state.h:10
NodeStatus
Definition node_info.h:18
Definition node_call_types.h:58
std::optional< pal::UVMEndorsements > snp_uvm_endorsements
Definition node_call_types.h:69
QuoteInfo quote_info
Definition node_call_types.h:64
nlohmann::json node_data
Definition node_call_types.h:71
std::optional< HostDataMetadata > snp_security_policy
Definition node_call_types.h:67
std::optional< ccf::StartupConfig::Start > genesis_info
Definition node_call_types.h:76
ccf::crypto::Pem service_cert
Definition node_call_types.h:63
NodeId node_id
Definition node_call_types.h:59
ccf::TxID create_txid
Definition node_call_types.h:73
ccf::crypto::Pem certificate_signing_request
Definition node_call_types.h:60
NodeInfoNetwork node_info_network
Definition node_call_types.h:70
ccf::crypto::Pem public_key
Definition node_call_types.h:62
ccf::crypto::Pem node_endorsed_certificate
Definition node_call_types.h:61
pal::PlatformAttestationMeasurement measurement
Definition node_call_types.h:66
ccf::crypto::Pem public_encryption_key
Definition node_call_types.h:65
nlohmann::json service_data
Definition node_call_types.h:72
Definition node_call_types.h:56
Definition node_call_types.h:29
std::optional< ccf::kv::Version > last_recovered_seqno
Definition node_call_types.h:37
std::optional< ccf::kv::Version > recovery_target_seqno
Definition node_call_types.h:36
bool stop_notice
Definition node_call_types.h:39
ccf::NodeId node_id
Definition node_call_types.h:30
ccf::kv::Version startup_seqno
Definition node_call_types.h:33
ccf::NodeStartupState state
Definition node_call_types.h:31
ccf::kv::Version last_signed_seqno
Definition node_call_types.h:32
Definition node_call_types.h:25
void In
Definition node_call_types.h:26
Definition node_call_types.h:48
bool unsafe
Definition node_call_types.h:51
std::string quickjs_version
Definition node_call_types.h:50
std::string ccf_version
Definition node_call_types.h:49
Definition node_call_types.h:44
void In
Definition node_call_types.h:45
Definition node_call_types.h:83
QuoteInfo quote_info
Definition node_call_types.h:85
std::optional< ccf::crypto::Pem > certificate_signing_request
Definition node_call_types.h:88
std::optional< ccf::kv::Version > startup_seqno
Definition node_call_types.h:87
NodeInfoNetwork node_info_network
Definition node_call_types.h:84
nlohmann::json node_data
Definition node_call_types.h:90
ccf::crypto::Pem public_encryption_key
Definition node_call_types.h:86
Definition node_call_types.h:101
std::optional< ccf::crypto::Pem > endorsed_certificate
Definition node_call_types.h:108
bool operator==(const NetworkInfo &other) const
Definition node_call_types.h:132
ccf::kv::Version last_recovered_signed_idx
Definition node_call_types.h:103
LedgerSecretsMap ledger_secrets
Definition node_call_types.h:104
NetworkInfo()
Definition node_call_types.h:112
NetworkIdentity identity
Definition node_call_types.h:105
std::optional< ServiceStatus > service_status
Definition node_call_types.h:106
std::optional< ccf::COSESignaturesConfig > cose_signatures_config
Definition node_call_types.h:109
bool operator!=(const NetworkInfo &other) const
Definition node_call_types.h:143
bool public_only
Definition node_call_types.h:102
NetworkInfo(bool public_only, ccf::kv::Version last_recovered_signed_idx, const LedgerSecretsMap &ledger_secrets, const NetworkIdentity &identity, ServiceStatus service_status, const std::optional< ccf::crypto::Pem > &endorsed_certificate, const std::optional< ccf::COSESignaturesConfig > &cose_signatures_config_)
Definition node_call_types.h:114
Definition node_call_types.h:94
std::optional< NodeId > node_id
Definition node_call_types.h:98
std::optional< NetworkInfo > network_info
Definition node_call_types.h:150
NodeStatus node_status
Definition node_call_types.h:95
Definition node_call_types.h:81
Definition node_call_types.h:159
size_t current_allocated_heap_size
Definition node_call_types.h:168
Out(const pal::MallocInfo &info)
Definition node_call_types.h:160
size_t max_total_heap_size
Definition node_call_types.h:167
size_t peak_allocated_heap_size
Definition node_call_types.h:169
Definition node_call_types.h:155
void In
Definition node_call_types.h:156
Definition identity.h:18
Definition node_info_network.h:196
Describes a quote (attestation) from trusted hardware.
Definition quote_info.h:26
Definition tx_id.h:44
Definition mem.h:16
Definition measurement.h:120