state.recordcache.recordcache.proto Maven / Gradle / Ivy
/**
* # Record Cache
* The Record Cache holds transaction records for a short time, and is the
* source for responses to `transactionGetRecord` and `transactionGetReceipt`
* queries.
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119)
* and clarified in [RFC8174](https://www.ietf.org/rfc/rfc8174).
*/
syntax = "proto3";
package proto;
/*
* Copyright (C) 2023-2024 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.
*/
import "basic_types.proto";
import "transaction_record.proto";
import "response_code.proto";
option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
/**
* As transactions are handled and records and receipts are created, they are
* stored in state for a configured time period (for example, 3 minutes).
* During this time, any client can query the node and get the record or receipt
* for the transaction. The `TransactionRecordEntry` is the object stored in
* state with this information.
*/
message TransactionRecordEntry {
/**
* A node identifier.
* This identifier is the node, as known to the address book, that
* submitted the transaction for consensus.
*
* This SHALL be a whole number.
*/
int64 node_id = 1;
/**
* An Account identifier for the payer for the transaction.
*
* This MAY be the same as the account ID within the Transaction ID of the
* record, or it MAY be the account ID of the node that submitted the
* transaction to consensus if the account ID in the Transaction ID was
* not able to pay.
*/
AccountID payer_account_id = 2;
/**
* A transaction record for the transaction.
*/
TransactionRecord transaction_record = 3;
}
/**
* An entry in the record cache with the receipt for a transaction.
* This is the entry stored in state that enables returning the receipt
* information when queried by clients.
*
* When a transaction is handled a receipt SHALL be created.
* This receipt MUST be stored in state for a configured time limit
* (e.g. 3 minutes).
* While a receipt is stored, a client MAY query the node and retrieve
* the receipt.
*/
message TransactionReceiptEntry {
/**
* A node identifier.
* This identifies the node that submitted the transaction to consensus.
* The value is the identifier as known to the current address book.
*
* Valid node identifiers SHALL be between 0 and 263-1,
* inclusive.
*/
uint64 node_id = 1;
/**
* A transaction identifier.
* This identifies the submitted transaction for this receipt.
*/
TransactionID transaction_id = 2;
/**
* A status result.
* This is the final status after handling the transaction.
*/
ResponseCodeEnum status = 3;
}
/**
* A cache of transaction receipts.
* As transactions are handled and receipts are created, they are stored in
* state for a configured time limit (perhaps, for example, 3 minutes).
* During this time window, any client can query the node and get the receipt
* for the transaction. The `TransactionReceiptEntries` is the object stored in
* state with this information.
*
* This message SHALL contain a list of `TransactionReceiptEntry` objects.
*/
message TransactionReceiptEntries {
repeated TransactionReceiptEntry entries = 1;
}