#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChaincodeEvent {
#[prost(string, tag = "1")]
pub chaincode_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub tx_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub event_name: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "4")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChaincodeId {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub version: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeInput {
#[prost(bytes = "vec", repeated, tag = "1")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(map = "string, bytes", tag = "2")]
pub decorations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
#[prost(bool, tag = "3")]
pub is_init: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeSpec {
#[prost(enumeration = "chaincode_spec::Type", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub chaincode_id: ::core::option::Option<ChaincodeId>,
#[prost(message, optional, tag = "3")]
pub input: ::core::option::Option<ChaincodeInput>,
#[prost(int32, tag = "4")]
pub timeout: i32,
}
pub mod chaincode_spec {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Undefined = 0,
Golang = 1,
Node = 2,
Car = 3,
Java = 4,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Undefined => "UNDEFINED",
Self::Golang => "GOLANG",
Self::Node => "NODE",
Self::Car => "CAR",
Self::Java => "JAVA",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNDEFINED" => Some(Self::Undefined),
"GOLANG" => Some(Self::Golang),
"NODE" => Some(Self::Node),
"CAR" => Some(Self::Car),
"JAVA" => Some(Self::Java),
_ => None,
}
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeDeploymentSpec {
#[prost(message, optional, tag = "1")]
pub chaincode_spec: ::core::option::Option<ChaincodeSpec>,
#[prost(bytes = "vec", tag = "3")]
pub code_package: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeInvocationSpec {
#[prost(message, optional, tag = "1")]
pub chaincode_spec: ::core::option::Option<ChaincodeSpec>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LifecycleEvent {
#[prost(string, tag = "1")]
pub chaincode_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CdsData {
#[prost(bytes = "vec", tag = "1")]
pub hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub metadatahash: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeData {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub escc: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub vscc: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub policy: ::core::option::Option<super::common::SignaturePolicyEnvelope>,
#[prost(bytes = "vec", tag = "6")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "7")]
pub id: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "8")]
pub instantiation_policy: ::core::option::Option<
super::common::SignaturePolicyEnvelope,
>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChaincodeAdditionalParams {
#[prost(bool, tag = "1")]
pub use_write_batch: bool,
#[prost(uint32, tag = "2")]
pub max_size_write_batch: u32,
#[prost(bool, tag = "3")]
pub use_get_multiple_keys: bool,
#[prost(uint32, tag = "4")]
pub max_size_get_multiple_keys: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProposalResponse {
#[prost(int32, tag = "1")]
pub version: i32,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<crate::fabric::google_protobuf::Timestamp>,
#[prost(message, optional, tag = "4")]
pub response: ::core::option::Option<Response>,
#[prost(bytes = "vec", tag = "5")]
pub payload: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "6")]
pub endorsement: ::core::option::Option<Endorsement>,
#[prost(message, optional, tag = "7")]
pub interest: ::core::option::Option<ChaincodeInterest>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Response {
#[prost(int32, tag = "1")]
pub status: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ProposalResponsePayload {
#[prost(bytes = "vec", tag = "1")]
pub proposal_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub extension: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Endorsement {
#[prost(bytes = "vec", tag = "1")]
pub endorser: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeInterest {
#[prost(message, repeated, tag = "1")]
pub chaincodes: ::prost::alloc::vec::Vec<ChaincodeCall>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeCall {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub collection_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "3")]
pub no_private_reads: bool,
#[prost(bool, tag = "4")]
pub no_public_writes: bool,
#[prost(message, repeated, tag = "5")]
pub key_policies: ::prost::alloc::vec::Vec<super::common::SignaturePolicyEnvelope>,
#[prost(bool, tag = "6")]
pub disregard_namespace_policy: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SignedProposal {
#[prost(bytes = "vec", tag = "1")]
pub proposal_bytes: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Proposal {
#[prost(bytes = "vec", tag = "1")]
pub header: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub extension: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChaincodeHeaderExtension {
#[prost(message, optional, tag = "2")]
pub chaincode_id: ::core::option::Option<ChaincodeId>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeProposalPayload {
#[prost(bytes = "vec", tag = "1")]
pub input: ::prost::alloc::vec::Vec<u8>,
#[prost(map = "string, bytes", tag = "2")]
pub transient_map: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChaincodeAction {
#[prost(bytes = "vec", tag = "1")]
pub results: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub events: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub response: ::core::option::Option<Response>,
#[prost(message, optional, tag = "4")]
pub chaincode_id: ::core::option::Option<ChaincodeId>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ProcessedTransaction {
#[prost(message, optional, tag = "1")]
pub transaction_envelope: ::core::option::Option<super::common::Envelope>,
#[prost(int32, tag = "2")]
pub validation_code: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transaction {
#[prost(message, repeated, tag = "1")]
pub actions: ::prost::alloc::vec::Vec<TransactionAction>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransactionAction {
#[prost(bytes = "vec", tag = "1")]
pub header: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeActionPayload {
#[prost(bytes = "vec", tag = "1")]
pub chaincode_proposal_payload: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub action: ::core::option::Option<ChaincodeEndorsedAction>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChaincodeEndorsedAction {
#[prost(bytes = "vec", tag = "1")]
pub proposal_response_payload: ::prost::alloc::vec::Vec<u8>,
#[prost(message, repeated, tag = "2")]
pub endorsements: ::prost::alloc::vec::Vec<Endorsement>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TxValidationCode {
Valid = 0,
NilEnvelope = 1,
BadPayload = 2,
BadCommonHeader = 3,
BadCreatorSignature = 4,
InvalidEndorserTransaction = 5,
InvalidConfigTransaction = 6,
UnsupportedTxPayload = 7,
BadProposalTxid = 8,
DuplicateTxid = 9,
EndorsementPolicyFailure = 10,
MvccReadConflict = 11,
PhantomReadConflict = 12,
UnknownTxType = 13,
TargetChainNotFound = 14,
MarshalTxError = 15,
NilTxaction = 16,
ExpiredChaincode = 17,
ChaincodeVersionConflict = 18,
BadHeaderExtension = 19,
BadChannelHeader = 20,
BadResponsePayload = 21,
BadRwset = 22,
IllegalWriteset = 23,
InvalidWriteset = 24,
InvalidChaincode = 25,
NotValidated = 254,
InvalidOtherReason = 255,
}
impl TxValidationCode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Valid => "VALID",
Self::NilEnvelope => "NIL_ENVELOPE",
Self::BadPayload => "BAD_PAYLOAD",
Self::BadCommonHeader => "BAD_COMMON_HEADER",
Self::BadCreatorSignature => "BAD_CREATOR_SIGNATURE",
Self::InvalidEndorserTransaction => "INVALID_ENDORSER_TRANSACTION",
Self::InvalidConfigTransaction => "INVALID_CONFIG_TRANSACTION",
Self::UnsupportedTxPayload => "UNSUPPORTED_TX_PAYLOAD",
Self::BadProposalTxid => "BAD_PROPOSAL_TXID",
Self::DuplicateTxid => "DUPLICATE_TXID",
Self::EndorsementPolicyFailure => "ENDORSEMENT_POLICY_FAILURE",
Self::MvccReadConflict => "MVCC_READ_CONFLICT",
Self::PhantomReadConflict => "PHANTOM_READ_CONFLICT",
Self::UnknownTxType => "UNKNOWN_TX_TYPE",
Self::TargetChainNotFound => "TARGET_CHAIN_NOT_FOUND",
Self::MarshalTxError => "MARSHAL_TX_ERROR",
Self::NilTxaction => "NIL_TXACTION",
Self::ExpiredChaincode => "EXPIRED_CHAINCODE",
Self::ChaincodeVersionConflict => "CHAINCODE_VERSION_CONFLICT",
Self::BadHeaderExtension => "BAD_HEADER_EXTENSION",
Self::BadChannelHeader => "BAD_CHANNEL_HEADER",
Self::BadResponsePayload => "BAD_RESPONSE_PAYLOAD",
Self::BadRwset => "BAD_RWSET",
Self::IllegalWriteset => "ILLEGAL_WRITESET",
Self::InvalidWriteset => "INVALID_WRITESET",
Self::InvalidChaincode => "INVALID_CHAINCODE",
Self::NotValidated => "NOT_VALIDATED",
Self::InvalidOtherReason => "INVALID_OTHER_REASON",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VALID" => Some(Self::Valid),
"NIL_ENVELOPE" => Some(Self::NilEnvelope),
"BAD_PAYLOAD" => Some(Self::BadPayload),
"BAD_COMMON_HEADER" => Some(Self::BadCommonHeader),
"BAD_CREATOR_SIGNATURE" => Some(Self::BadCreatorSignature),
"INVALID_ENDORSER_TRANSACTION" => Some(Self::InvalidEndorserTransaction),
"INVALID_CONFIG_TRANSACTION" => Some(Self::InvalidConfigTransaction),
"UNSUPPORTED_TX_PAYLOAD" => Some(Self::UnsupportedTxPayload),
"BAD_PROPOSAL_TXID" => Some(Self::BadProposalTxid),
"DUPLICATE_TXID" => Some(Self::DuplicateTxid),
"ENDORSEMENT_POLICY_FAILURE" => Some(Self::EndorsementPolicyFailure),
"MVCC_READ_CONFLICT" => Some(Self::MvccReadConflict),
"PHANTOM_READ_CONFLICT" => Some(Self::PhantomReadConflict),
"UNKNOWN_TX_TYPE" => Some(Self::UnknownTxType),
"TARGET_CHAIN_NOT_FOUND" => Some(Self::TargetChainNotFound),
"MARSHAL_TX_ERROR" => Some(Self::MarshalTxError),
"NIL_TXACTION" => Some(Self::NilTxaction),
"EXPIRED_CHAINCODE" => Some(Self::ExpiredChaincode),
"CHAINCODE_VERSION_CONFLICT" => Some(Self::ChaincodeVersionConflict),
"BAD_HEADER_EXTENSION" => Some(Self::BadHeaderExtension),
"BAD_CHANNEL_HEADER" => Some(Self::BadChannelHeader),
"BAD_RESPONSE_PAYLOAD" => Some(Self::BadResponsePayload),
"BAD_RWSET" => Some(Self::BadRwset),
"ILLEGAL_WRITESET" => Some(Self::IllegalWriteset),
"INVALID_WRITESET" => Some(Self::InvalidWriteset),
"INVALID_CHAINCODE" => Some(Self::InvalidChaincode),
"NOT_VALIDATED" => Some(Self::NotValidated),
"INVALID_OTHER_REASON" => Some(Self::InvalidOtherReason),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetaDataKeys {
ValidationParameter = 0,
ValidationParameterV2 = 1,
}
impl MetaDataKeys {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::ValidationParameter => "VALIDATION_PARAMETER",
Self::ValidationParameterV2 => "VALIDATION_PARAMETER_V2",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VALIDATION_PARAMETER" => Some(Self::ValidationParameter),
"VALIDATION_PARAMETER_V2" => Some(Self::ValidationParameterV2),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChaincodeMessage {
#[prost(enumeration = "chaincode_message::Type", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<crate::fabric::google_protobuf::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub payload: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "4")]
pub txid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub proposal: ::core::option::Option<SignedProposal>,
#[prost(message, optional, tag = "6")]
pub chaincode_event: ::core::option::Option<ChaincodeEvent>,
#[prost(string, tag = "7")]
pub channel_id: ::prost::alloc::string::String,
}
pub mod chaincode_message {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Undefined = 0,
Register = 1,
Registered = 2,
Init = 3,
Ready = 4,
Transaction = 5,
Completed = 6,
Error = 7,
GetState = 8,
PutState = 9,
DelState = 10,
InvokeChaincode = 11,
Response = 13,
GetStateByRange = 14,
GetQueryResult = 15,
QueryStateNext = 16,
QueryStateClose = 17,
Keepalive = 18,
GetHistoryForKey = 19,
GetStateMetadata = 20,
PutStateMetadata = 21,
GetPrivateDataHash = 22,
PurgePrivateData = 23,
WriteBatchState = 24,
GetStateMultiple = 25,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Undefined => "UNDEFINED",
Self::Register => "REGISTER",
Self::Registered => "REGISTERED",
Self::Init => "INIT",
Self::Ready => "READY",
Self::Transaction => "TRANSACTION",
Self::Completed => "COMPLETED",
Self::Error => "ERROR",
Self::GetState => "GET_STATE",
Self::PutState => "PUT_STATE",
Self::DelState => "DEL_STATE",
Self::InvokeChaincode => "INVOKE_CHAINCODE",
Self::Response => "RESPONSE",
Self::GetStateByRange => "GET_STATE_BY_RANGE",
Self::GetQueryResult => "GET_QUERY_RESULT",
Self::QueryStateNext => "QUERY_STATE_NEXT",
Self::QueryStateClose => "QUERY_STATE_CLOSE",
Self::Keepalive => "KEEPALIVE",
Self::GetHistoryForKey => "GET_HISTORY_FOR_KEY",
Self::GetStateMetadata => "GET_STATE_METADATA",
Self::PutStateMetadata => "PUT_STATE_METADATA",
Self::GetPrivateDataHash => "GET_PRIVATE_DATA_HASH",
Self::PurgePrivateData => "PURGE_PRIVATE_DATA",
Self::WriteBatchState => "WRITE_BATCH_STATE",
Self::GetStateMultiple => "GET_STATE_MULTIPLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNDEFINED" => Some(Self::Undefined),
"REGISTER" => Some(Self::Register),
"REGISTERED" => Some(Self::Registered),
"INIT" => Some(Self::Init),
"READY" => Some(Self::Ready),
"TRANSACTION" => Some(Self::Transaction),
"COMPLETED" => Some(Self::Completed),
"ERROR" => Some(Self::Error),
"GET_STATE" => Some(Self::GetState),
"PUT_STATE" => Some(Self::PutState),
"DEL_STATE" => Some(Self::DelState),
"INVOKE_CHAINCODE" => Some(Self::InvokeChaincode),
"RESPONSE" => Some(Self::Response),
"GET_STATE_BY_RANGE" => Some(Self::GetStateByRange),
"GET_QUERY_RESULT" => Some(Self::GetQueryResult),
"QUERY_STATE_NEXT" => Some(Self::QueryStateNext),
"QUERY_STATE_CLOSE" => Some(Self::QueryStateClose),
"KEEPALIVE" => Some(Self::Keepalive),
"GET_HISTORY_FOR_KEY" => Some(Self::GetHistoryForKey),
"GET_STATE_METADATA" => Some(Self::GetStateMetadata),
"PUT_STATE_METADATA" => Some(Self::PutStateMetadata),
"GET_PRIVATE_DATA_HASH" => Some(Self::GetPrivateDataHash),
"PURGE_PRIVATE_DATA" => Some(Self::PurgePrivateData),
"WRITE_BATCH_STATE" => Some(Self::WriteBatchState),
"GET_STATE_MULTIPLE" => Some(Self::GetStateMultiple),
_ => None,
}
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetState {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStateMetadata {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStateMultiple {
#[prost(string, repeated, tag = "1")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub collection: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStateMultipleResult {
#[prost(bytes = "vec", repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PutState {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "3")]
pub collection: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PutStateMetadata {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub collection: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub metadata: ::core::option::Option<StateMetadata>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteBatchState {
#[prost(message, repeated, tag = "1")]
pub rec: ::prost::alloc::vec::Vec<WriteRecord>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WriteRecord {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "3")]
pub collection: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub metadata: ::core::option::Option<StateMetadata>,
#[prost(enumeration = "write_record::Type", tag = "5")]
pub r#type: i32,
}
pub mod write_record {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Undefined = 0,
PutState = 9,
DelState = 10,
PutStateMetadata = 21,
PurgePrivateData = 23,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Undefined => "UNDEFINED",
Self::PutState => "PUT_STATE",
Self::DelState => "DEL_STATE",
Self::PutStateMetadata => "PUT_STATE_METADATA",
Self::PurgePrivateData => "PURGE_PRIVATE_DATA",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNDEFINED" => Some(Self::Undefined),
"PUT_STATE" => Some(Self::PutState),
"DEL_STATE" => Some(Self::DelState),
"PUT_STATE_METADATA" => Some(Self::PutStateMetadata),
"PURGE_PRIVATE_DATA" => Some(Self::PurgePrivateData),
_ => None,
}
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DelState {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PurgePrivateState {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStateByRange {
#[prost(string, tag = "1")]
pub start_key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub end_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub collection: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "4")]
pub metadata: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetQueryResult {
#[prost(string, tag = "1")]
pub query: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub metadata: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryMetadata {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(string, tag = "2")]
pub bookmark: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetHistoryForKey {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryStateNext {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryStateClose {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryResultBytes {
#[prost(bytes = "vec", tag = "1")]
pub result_bytes: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<QueryResultBytes>,
#[prost(bool, tag = "2")]
pub has_more: bool,
#[prost(string, tag = "3")]
pub id: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "4")]
pub metadata: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryResponseMetadata {
#[prost(int32, tag = "1")]
pub fetched_records_count: i32,
#[prost(string, tag = "2")]
pub bookmark: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StateMetadata {
#[prost(string, tag = "1")]
pub metakey: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StateMetadataResult {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<StateMetadata>,
}
pub mod chaincode_support_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ChaincodeSupportClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ChaincodeSupportClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ChaincodeSupportClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ChaincodeSupportClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn register(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::ChaincodeMessage>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ChaincodeMessage>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/protos.ChaincodeSupport/Register",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("protos.ChaincodeSupport", "Register"));
self.inner.streaming(req, path, codec).await
}
}
}
pub mod chaincode_support_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait ChaincodeSupport: std::marker::Send + std::marker::Sync + 'static {
type RegisterStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ChaincodeMessage, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn register(
&self,
request: tonic::Request<tonic::Streaming<super::ChaincodeMessage>>,
) -> std::result::Result<tonic::Response<Self::RegisterStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct ChaincodeSupportServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ChaincodeSupportServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ChaincodeSupportServer<T>
where
T: ChaincodeSupport,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/protos.ChaincodeSupport/Register" => {
#[allow(non_camel_case_types)]
struct RegisterSvc<T: ChaincodeSupport>(pub Arc<T>);
impl<
T: ChaincodeSupport,
> tonic::server::StreamingService<super::ChaincodeMessage>
for RegisterSvc<T> {
type Response = super::ChaincodeMessage;
type ResponseStream = T::RegisterStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::ChaincodeMessage>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ChaincodeSupport>::register(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RegisterSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for ChaincodeSupportServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "protos.ChaincodeSupport";
impl<T> tonic::server::NamedService for ChaincodeSupportServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod chaincode_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ChaincodeClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ChaincodeClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ChaincodeClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ChaincodeClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn connect(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::ChaincodeMessage>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ChaincodeMessage>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/protos.Chaincode/Connect");
let mut req = request.into_streaming_request();
req.extensions_mut().insert(GrpcMethod::new("protos.Chaincode", "Connect"));
self.inner.streaming(req, path, codec).await
}
}
}
pub mod chaincode_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Chaincode: std::marker::Send + std::marker::Sync + 'static {
type ConnectStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ChaincodeMessage, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn connect(
&self,
request: tonic::Request<tonic::Streaming<super::ChaincodeMessage>>,
) -> std::result::Result<tonic::Response<Self::ConnectStream>, tonic::Status>;
}
#[derive(Debug)]
pub struct ChaincodeServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ChaincodeServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ChaincodeServer<T>
where
T: Chaincode,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/protos.Chaincode/Connect" => {
#[allow(non_camel_case_types)]
struct ConnectSvc<T: Chaincode>(pub Arc<T>);
impl<
T: Chaincode,
> tonic::server::StreamingService<super::ChaincodeMessage>
for ConnectSvc<T> {
type Response = super::ChaincodeMessage;
type ResponseStream = T::ConnectStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::ChaincodeMessage>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Chaincode>::connect(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ConnectSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for ChaincodeServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "protos.Chaincode";
impl<T> tonic::server::NamedService for ChaincodeServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SnapshotRequest {
#[prost(message, optional, tag = "1")]
pub signature_header: ::core::option::Option<super::common::SignatureHeader>,
#[prost(string, tag = "2")]
pub channel_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub block_number: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SnapshotQuery {
#[prost(message, optional, tag = "1")]
pub signature_header: ::core::option::Option<super::common::SignatureHeader>,
#[prost(string, tag = "2")]
pub channel_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SignedSnapshotRequest {
#[prost(bytes = "vec", tag = "1")]
pub request: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryPendingSnapshotsResponse {
#[prost(uint64, repeated, tag = "1")]
pub block_numbers: ::prost::alloc::vec::Vec<u64>,
}
pub mod snapshot_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SnapshotClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> SnapshotClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SnapshotClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SnapshotClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn generate(
&mut self,
request: impl tonic::IntoRequest<super::SignedSnapshotRequest>,
) -> std::result::Result<
tonic::Response<crate::fabric::google_protobuf::Empty>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/protos.Snapshot/Generate");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("protos.Snapshot", "Generate"));
self.inner.unary(req, path, codec).await
}
pub async fn cancel(
&mut self,
request: impl tonic::IntoRequest<super::SignedSnapshotRequest>,
) -> std::result::Result<
tonic::Response<crate::fabric::google_protobuf::Empty>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/protos.Snapshot/Cancel");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("protos.Snapshot", "Cancel"));
self.inner.unary(req, path, codec).await
}
pub async fn query_pendings(
&mut self,
request: impl tonic::IntoRequest<super::SignedSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::QueryPendingSnapshotsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/protos.Snapshot/QueryPendings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("protos.Snapshot", "QueryPendings"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod snapshot_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Snapshot: std::marker::Send + std::marker::Sync + 'static {
async fn generate(
&self,
request: tonic::Request<super::SignedSnapshotRequest>,
) -> std::result::Result<
tonic::Response<crate::fabric::google_protobuf::Empty>,
tonic::Status,
>;
async fn cancel(
&self,
request: tonic::Request<super::SignedSnapshotRequest>,
) -> std::result::Result<
tonic::Response<crate::fabric::google_protobuf::Empty>,
tonic::Status,
>;
async fn query_pendings(
&self,
request: tonic::Request<super::SignedSnapshotRequest>,
) -> std::result::Result<
tonic::Response<super::QueryPendingSnapshotsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SnapshotServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> SnapshotServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for SnapshotServer<T>
where
T: Snapshot,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/protos.Snapshot/Generate" => {
#[allow(non_camel_case_types)]
struct GenerateSvc<T: Snapshot>(pub Arc<T>);
impl<
T: Snapshot,
> tonic::server::UnaryService<super::SignedSnapshotRequest>
for GenerateSvc<T> {
type Response = crate::fabric::google_protobuf::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SignedSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshot>::generate(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GenerateSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/protos.Snapshot/Cancel" => {
#[allow(non_camel_case_types)]
struct CancelSvc<T: Snapshot>(pub Arc<T>);
impl<
T: Snapshot,
> tonic::server::UnaryService<super::SignedSnapshotRequest>
for CancelSvc<T> {
type Response = crate::fabric::google_protobuf::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SignedSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshot>::cancel(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CancelSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/protos.Snapshot/QueryPendings" => {
#[allow(non_camel_case_types)]
struct QueryPendingsSvc<T: Snapshot>(pub Arc<T>);
impl<
T: Snapshot,
> tonic::server::UnaryService<super::SignedSnapshotRequest>
for QueryPendingsSvc<T> {
type Response = super::QueryPendingSnapshotsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SignedSnapshotRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Snapshot>::query_pendings(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryPendingsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for SnapshotServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "protos.Snapshot";
impl<T> tonic::server::NamedService for SnapshotServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplicationPolicy {
#[prost(oneof = "application_policy::Type", tags = "1, 2")]
pub r#type: ::core::option::Option<application_policy::Type>,
}
pub mod application_policy {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
SignaturePolicy(super::super::common::SignaturePolicyEnvelope),
#[prost(string, tag = "2")]
ChannelConfigPolicyReference(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionConfigPackage {
#[prost(message, repeated, tag = "1")]
pub config: ::prost::alloc::vec::Vec<CollectionConfig>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionConfig {
#[prost(oneof = "collection_config::Payload", tags = "1")]
pub payload: ::core::option::Option<collection_config::Payload>,
}
pub mod collection_config {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
StaticCollectionConfig(super::StaticCollectionConfig),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StaticCollectionConfig {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub member_orgs_policy: ::core::option::Option<CollectionPolicyConfig>,
#[prost(int32, tag = "3")]
pub required_peer_count: i32,
#[prost(int32, tag = "4")]
pub maximum_peer_count: i32,
#[prost(uint64, tag = "5")]
pub block_to_live: u64,
#[prost(bool, tag = "6")]
pub member_only_read: bool,
#[prost(bool, tag = "7")]
pub member_only_write: bool,
#[prost(message, optional, tag = "8")]
pub endorsement_policy: ::core::option::Option<ApplicationPolicy>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionPolicyConfig {
#[prost(oneof = "collection_policy_config::Payload", tags = "1")]
pub payload: ::core::option::Option<collection_policy_config::Payload>,
}
pub mod collection_policy_config {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
SignaturePolicy(super::super::common::SignaturePolicyEnvelope),
}
}
pub mod endorser_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct EndorserClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> EndorserClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> EndorserClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
EndorserClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn process_proposal(
&mut self,
request: impl tonic::IntoRequest<super::SignedProposal>,
) -> std::result::Result<
tonic::Response<super::ProposalResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/protos.Endorser/ProcessProposal",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("protos.Endorser", "ProcessProposal"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod endorser_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Endorser: std::marker::Send + std::marker::Sync + 'static {
async fn process_proposal(
&self,
request: tonic::Request<super::SignedProposal>,
) -> std::result::Result<
tonic::Response<super::ProposalResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct EndorserServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> EndorserServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for EndorserServer<T>
where
T: Endorser,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/protos.Endorser/ProcessProposal" => {
#[allow(non_camel_case_types)]
struct ProcessProposalSvc<T: Endorser>(pub Arc<T>);
impl<T: Endorser> tonic::server::UnaryService<super::SignedProposal>
for ProcessProposalSvc<T> {
type Response = super::ProposalResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SignedProposal>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Endorser>::process_proposal(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ProcessProposalSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for EndorserServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "protos.Endorser";
impl<T> tonic::server::NamedService for EndorserServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}