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
112 NetworkInfo() = default;
113
115 bool public_only,
120 std::optional<ccf::crypto::Pem> endorsed_certificate,
121 std::optional<ccf::COSESignaturesConfig> cose_signatures_config_) :
128 cose_signatures_config(std::move(cose_signatures_config_))
129 {}
130
131 bool operator==(const NetworkInfo& other) const
132 {
133 return public_only == other.public_only &&
136 identity == other.identity &&
140 }
141
142 bool operator!=(const NetworkInfo& other) const
143 {
144 return !(*this == other);
145 }
146 };
147
148 // Only set if the caller node is trusted
149 std::optional<NetworkInfo> network_info = std::nullopt;
150 };
151 };
152
171}
Definition pem.h:18
uint64_t Version
Definition version.h:8
Definition app_interface.h:14
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: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:131
ccf::kv::Version last_recovered_signed_idx
Definition node_call_types.h:103
LedgerSecretsMap ledger_secrets
Definition node_call_types.h:104
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:114
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:142
bool public_only
Definition node_call_types.h:102
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:149
NodeStatus node_status
Definition node_call_types.h:95
Definition node_call_types.h:81
Definition node_call_types.h:158
size_t current_allocated_heap_size
Definition node_call_types.h:167
Out(const pal::MallocInfo &info)
Definition node_call_types.h:159
size_t max_total_heap_size
Definition node_call_types.h:166
size_t peak_allocated_heap_size
Definition node_call_types.h:168
Definition node_call_types.h:154
void In
Definition node_call_types.h:155
Definition identity.h:18
Definition node_info_network.h:184
Describes a quote (attestation) from trusted hardware.
Definition quote_info.h:26
Definition tx_id.h:44
Definition mem.h:16
Definition measurement.h:123