forked from hashgraph/hedera-protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consensus_service.proto
123 lines (114 loc) · 6.06 KB
/
consensus_service.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
syntax = "proto3";
package proto;
/*-
*
* Hedera Network Services Protobuf
*
* Copyright (C) 2018 - 2021 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.hederahashgraph.service.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.consensus">>> This comment is special code for setting PBJ Compiler java package
import "query.proto";
import "response.proto";
import "transaction_response.proto";
import "transaction.proto";
/**
* The Consensus Service provides the ability for Hedera Hashgraph to provide aBFT consensus as to
* the order and validity of messages submitted to a *topic*, as well as a *consensus timestamp* for
* those messages.
*
* Automatic renewal can be configured via an autoRenewAccount.
* Any time an autoRenewAccount is added to a topic, that createTopic/updateTopic transaction must
* be signed by the autoRenewAccount.
*
* The autoRenewPeriod on an account must currently be set a value in createTopic between
* MIN_AUTORENEW_PERIOD (6999999 seconds) and MAX_AUTORENEW_PERIOD (8000001 seconds). During
* creation this sets the initial expirationTime of the topic (see more below).
*
* If no adminKey is on a topic, there may not be an autoRenewAccount on the topic, deleteTopic is
* not allowed, and the only change allowed via an updateTopic is to extend the expirationTime.
*
* If an adminKey is on a topic, every updateTopic and deleteTopic transaction must be signed by the
* adminKey, except for updateTopics which only extend the topic's expirationTime (no adminKey
* authorization required).
*
* If an updateTopic modifies the adminKey of a topic, the transaction signatures on the updateTopic
* must fulfill both the pre-update and post-update adminKey signature requirements.
*
* Mirrornet ConsensusService may be used to subscribe to changes on the topic, including changes to
* the topic definition and the consensus ordering and timestamp of submitted messages.
*
* Until autoRenew functionality is supported by HAPI, the topic will not expire, the
* autoRenewAccount will not be charged, and the topic will not automatically be deleted.
*
* Once autoRenew functionality is supported by HAPI:
*
* 1. Once the expirationTime is encountered, if an autoRenewAccount is configured on the topic, the
* account will be charged automatically at the expirationTime, to extend the expirationTime of the
* topic up to the topic's autoRenewPeriod (or as much extension as the account's balance will
* supply).
*
* 2. If the topic expires and is not automatically renewed, the topic will enter the EXPIRED state.
* All transactions on the topic will fail with TOPIC_EXPIRED, except an updateTopic() call that
* modifies only the expirationTime. getTopicInfo() will succeed. This state will be available for
* a AUTORENEW_GRACE_PERIOD grace period (7 days).
*
* 3. After the grace period, if the topic's expirationTime is not extended, the topic will be
* automatically deleted and no transactions or queries on the topic will succeed after that point.
*/
service ConsensusService {
/**
* Create a topic to be used for consensus.
* If an autoRenewAccount is specified, that account must also sign this transaction.
* If an adminKey is specified, the adminKey must sign the transaction.
* On success, the resulting TransactionReceipt contains the newly created TopicId.
* Request is [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody)
*/
rpc createTopic (Transaction) returns (TransactionResponse);
/**
* Update a topic.
* If there is no adminKey, the only authorized update (available to anyone) is to extend the expirationTime.
* Otherwise transaction must be signed by the adminKey.
* If an adminKey is updated, the transaction must be signed by the pre-update adminKey and post-update adminKey.
* If a new autoRenewAccount is specified (not just being removed), that account must also sign the transaction.
* Request is [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody)
*/
rpc updateTopic (Transaction) returns (TransactionResponse);
/**
* Delete a topic. No more transactions or queries on the topic (via HAPI) will succeed.
* If an adminKey is set, this transaction must be signed by that key.
* If there is no adminKey, this transaction will fail UNAUTHORIZED.
* Request is [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody)
*/
rpc deleteTopic (Transaction) returns (TransactionResponse);
/**
* Retrieve the latest state of a topic. This method is unrestricted and allowed on any topic by any payer account.
* Deleted accounts will not be returned.
* Request is [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
* Response is [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse)
*/
rpc getTopicInfo (Query) returns (Response);
/**
* Submit a message for consensus.
* Valid and authorized messages on valid topics will be ordered by the consensus service, gossipped to the
* mirror net, and published (in order) to all subscribers (from the mirror net) on this topic.
* The submitKey (if any) must sign this transaction.
* On success, the resulting TransactionReceipt contains the topic's updated topicSequenceNumber and
* topicRunningHash.
* Request is [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody)
*/
rpc submitMessage (Transaction) returns (TransactionResponse);
}