-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathrecord_stream_file.proto
109 lines (94 loc) · 2.75 KB
/
record_stream_file.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
syntax = "proto3";
package proto;
/*-
*
* Hedera Network Services Protobuf
*
* Copyright (C) 2018 - 2022 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
option java_package = "com.hedera.services.stream.proto";
// <<<pbj.java_package = "com.hedera.hapi.streams">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
import "basic_types.proto";
import "transaction.proto";
import "transaction_record.proto";
import "hash_object.proto";
/**
* RecordStreamFile is used to serialize all RecordStreamItems that are part of the
* same period into record stream files.
* This structure represents a block in Hedera (HIP-415).
*/
message RecordStreamFile {
/**
* Version of HAPI that was used to serialize the file.
*/
SemanticVersion hapi_proto_version = 1;
/**
* Running Hash of all RecordStreamItems before writing this file.
*/
HashObject start_object_running_hash = 2;
/**
* List of all the record stream items from that period.
*/
repeated RecordStreamItem record_stream_items = 3;
/**
* Running Hash of all RecordStreamItems before closing this file.
*/
HashObject end_object_running_hash = 4;
/**
* The block number associated with this period.
*/
int64 block_number = 5;
/**
* List of the hashes of all the sidecar record files created for the same period.
* Allows multiple sidecar files to be linked to this RecordStreamFile.
*/
repeated SidecarMetadata sidecars = 6;
}
/**
* A RecordStreamItem consists of a Transaction and a TransactionRecord,
* which are already defined protobuf messages.
*/
message RecordStreamItem {
Transaction transaction = 1;
TransactionRecord record = 2;
}
/**
* Information about a single sidecar file.
*/
message SidecarMetadata {
/**
* The hash of the entire file.
*/
HashObject hash = 1;
/**
* The id of the sidecar record file
*/
int32 id = 2;
/**
* The types of sidecar records that will be included in the file.
*/
repeated SidecarType types = 3;
}
/**
* The type of sidecar records contained in the sidecar record file
*/
enum SidecarType {
SIDECAR_TYPE_UNKNOWN = 0;
CONTRACT_STATE_CHANGE = 1;
CONTRACT_ACTION = 2;
CONTRACT_BYTECODE = 3;
}