com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-full Show documentation
Show all versions of sdk-full Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
package com.hedera.hashgraph.sdk.proto;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
**
* 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.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.50.2)",
comments = "Source: consensus_service.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ConsensusServiceGrpc {
private ConsensusServiceGrpc() {}
public static final String SERVICE_NAME = "proto.ConsensusService";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getCreateTopicMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "createTopic",
requestType = com.hedera.hashgraph.sdk.proto.Transaction.class,
responseType = com.hedera.hashgraph.sdk.proto.TransactionResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getCreateTopicMethod() {
io.grpc.MethodDescriptor getCreateTopicMethod;
if ((getCreateTopicMethod = ConsensusServiceGrpc.getCreateTopicMethod) == null) {
synchronized (ConsensusServiceGrpc.class) {
if ((getCreateTopicMethod = ConsensusServiceGrpc.getCreateTopicMethod) == null) {
ConsensusServiceGrpc.getCreateTopicMethod = getCreateTopicMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "createTopic"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.Transaction.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.TransactionResponse.getDefaultInstance()))
.setSchemaDescriptor(new ConsensusServiceMethodDescriptorSupplier("createTopic"))
.build();
}
}
}
return getCreateTopicMethod;
}
private static volatile io.grpc.MethodDescriptor getUpdateTopicMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "updateTopic",
requestType = com.hedera.hashgraph.sdk.proto.Transaction.class,
responseType = com.hedera.hashgraph.sdk.proto.TransactionResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getUpdateTopicMethod() {
io.grpc.MethodDescriptor getUpdateTopicMethod;
if ((getUpdateTopicMethod = ConsensusServiceGrpc.getUpdateTopicMethod) == null) {
synchronized (ConsensusServiceGrpc.class) {
if ((getUpdateTopicMethod = ConsensusServiceGrpc.getUpdateTopicMethod) == null) {
ConsensusServiceGrpc.getUpdateTopicMethod = getUpdateTopicMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "updateTopic"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.Transaction.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.TransactionResponse.getDefaultInstance()))
.setSchemaDescriptor(new ConsensusServiceMethodDescriptorSupplier("updateTopic"))
.build();
}
}
}
return getUpdateTopicMethod;
}
private static volatile io.grpc.MethodDescriptor getDeleteTopicMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "deleteTopic",
requestType = com.hedera.hashgraph.sdk.proto.Transaction.class,
responseType = com.hedera.hashgraph.sdk.proto.TransactionResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getDeleteTopicMethod() {
io.grpc.MethodDescriptor getDeleteTopicMethod;
if ((getDeleteTopicMethod = ConsensusServiceGrpc.getDeleteTopicMethod) == null) {
synchronized (ConsensusServiceGrpc.class) {
if ((getDeleteTopicMethod = ConsensusServiceGrpc.getDeleteTopicMethod) == null) {
ConsensusServiceGrpc.getDeleteTopicMethod = getDeleteTopicMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "deleteTopic"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.Transaction.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.TransactionResponse.getDefaultInstance()))
.setSchemaDescriptor(new ConsensusServiceMethodDescriptorSupplier("deleteTopic"))
.build();
}
}
}
return getDeleteTopicMethod;
}
private static volatile io.grpc.MethodDescriptor getGetTopicInfoMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "getTopicInfo",
requestType = com.hedera.hashgraph.sdk.proto.Query.class,
responseType = com.hedera.hashgraph.sdk.proto.Response.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetTopicInfoMethod() {
io.grpc.MethodDescriptor getGetTopicInfoMethod;
if ((getGetTopicInfoMethod = ConsensusServiceGrpc.getGetTopicInfoMethod) == null) {
synchronized (ConsensusServiceGrpc.class) {
if ((getGetTopicInfoMethod = ConsensusServiceGrpc.getGetTopicInfoMethod) == null) {
ConsensusServiceGrpc.getGetTopicInfoMethod = getGetTopicInfoMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "getTopicInfo"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.Query.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.Response.getDefaultInstance()))
.setSchemaDescriptor(new ConsensusServiceMethodDescriptorSupplier("getTopicInfo"))
.build();
}
}
}
return getGetTopicInfoMethod;
}
private static volatile io.grpc.MethodDescriptor getSubmitMessageMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "submitMessage",
requestType = com.hedera.hashgraph.sdk.proto.Transaction.class,
responseType = com.hedera.hashgraph.sdk.proto.TransactionResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getSubmitMessageMethod() {
io.grpc.MethodDescriptor getSubmitMessageMethod;
if ((getSubmitMessageMethod = ConsensusServiceGrpc.getSubmitMessageMethod) == null) {
synchronized (ConsensusServiceGrpc.class) {
if ((getSubmitMessageMethod = ConsensusServiceGrpc.getSubmitMessageMethod) == null) {
ConsensusServiceGrpc.getSubmitMessageMethod = getSubmitMessageMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "submitMessage"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.Transaction.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.TransactionResponse.getDefaultInstance()))
.setSchemaDescriptor(new ConsensusServiceMethodDescriptorSupplier("submitMessage"))
.build();
}
}
}
return getSubmitMessageMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static ConsensusServiceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ConsensusServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ConsensusServiceStub(channel, callOptions);
}
};
return ConsensusServiceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static ConsensusServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ConsensusServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ConsensusServiceBlockingStub(channel, callOptions);
}
};
return ConsensusServiceBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static ConsensusServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ConsensusServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ConsensusServiceFutureStub(channel, callOptions);
}
};
return ConsensusServiceFutureStub.newStub(factory, channel);
}
/**
*
**
* 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.
*
*/
public static abstract class ConsensusServiceImplBase implements io.grpc.BindableService {
/**
*
**
* 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)
*
*/
public void createTopic(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateTopicMethod(), responseObserver);
}
/**
*
**
* 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)
*
*/
public void updateTopic(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateTopicMethod(), responseObserver);
}
/**
*
**
* 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)
*
*/
public void deleteTopic(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTopicMethod(), responseObserver);
}
/**
*
**
* 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)
*
*/
public void getTopicInfo(com.hedera.hashgraph.sdk.proto.Query request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTopicInfoMethod(), responseObserver);
}
/**
*
**
* 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)
*
*/
public void submitMessage(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubmitMessageMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getCreateTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.hedera.hashgraph.sdk.proto.Transaction,
com.hedera.hashgraph.sdk.proto.TransactionResponse>(
this, METHODID_CREATE_TOPIC)))
.addMethod(
getUpdateTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.hedera.hashgraph.sdk.proto.Transaction,
com.hedera.hashgraph.sdk.proto.TransactionResponse>(
this, METHODID_UPDATE_TOPIC)))
.addMethod(
getDeleteTopicMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.hedera.hashgraph.sdk.proto.Transaction,
com.hedera.hashgraph.sdk.proto.TransactionResponse>(
this, METHODID_DELETE_TOPIC)))
.addMethod(
getGetTopicInfoMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.hedera.hashgraph.sdk.proto.Query,
com.hedera.hashgraph.sdk.proto.Response>(
this, METHODID_GET_TOPIC_INFO)))
.addMethod(
getSubmitMessageMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.hedera.hashgraph.sdk.proto.Transaction,
com.hedera.hashgraph.sdk.proto.TransactionResponse>(
this, METHODID_SUBMIT_MESSAGE)))
.build();
}
}
/**
*
**
* 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.
*
*/
public static final class ConsensusServiceStub extends io.grpc.stub.AbstractAsyncStub {
private ConsensusServiceStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ConsensusServiceStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ConsensusServiceStub(channel, callOptions);
}
/**
*
**
* 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)
*
*/
public void createTopic(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateTopicMethod(), getCallOptions()), request, responseObserver);
}
/**
*
**
* 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)
*
*/
public void updateTopic(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), request, responseObserver);
}
/**
*
**
* 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)
*
*/
public void deleteTopic(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), request, responseObserver);
}
/**
*
**
* 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)
*
*/
public void getTopicInfo(com.hedera.hashgraph.sdk.proto.Query request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetTopicInfoMethod(), getCallOptions()), request, responseObserver);
}
/**
*
**
* 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)
*
*/
public void submitMessage(com.hedera.hashgraph.sdk.proto.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSubmitMessageMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*
**
* 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.
*
*/
public static final class ConsensusServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
private ConsensusServiceBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ConsensusServiceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ConsensusServiceBlockingStub(channel, callOptions);
}
/**
*
**
* 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)
*
*/
public com.hedera.hashgraph.sdk.proto.TransactionResponse createTopic(com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateTopicMethod(), getCallOptions(), request);
}
/**
*
**
* 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)
*
*/
public com.hedera.hashgraph.sdk.proto.TransactionResponse updateTopic(com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateTopicMethod(), getCallOptions(), request);
}
/**
*
**
* 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)
*
*/
public com.hedera.hashgraph.sdk.proto.TransactionResponse deleteTopic(com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteTopicMethod(), getCallOptions(), request);
}
/**
*
**
* 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)
*
*/
public com.hedera.hashgraph.sdk.proto.Response getTopicInfo(com.hedera.hashgraph.sdk.proto.Query request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetTopicInfoMethod(), getCallOptions(), request);
}
/**
*
**
* 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)
*
*/
public com.hedera.hashgraph.sdk.proto.TransactionResponse submitMessage(com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSubmitMessageMethod(), getCallOptions(), request);
}
}
/**
*
**
* 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.
*
*/
public static final class ConsensusServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
private ConsensusServiceFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ConsensusServiceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ConsensusServiceFutureStub(channel, callOptions);
}
/**
*
**
* 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)
*
*/
public com.google.common.util.concurrent.ListenableFuture createTopic(
com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateTopicMethod(), getCallOptions()), request);
}
/**
*
**
* 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)
*
*/
public com.google.common.util.concurrent.ListenableFuture updateTopic(
com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), request);
}
/**
*
**
* 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)
*
*/
public com.google.common.util.concurrent.ListenableFuture deleteTopic(
com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), request);
}
/**
*
**
* 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)
*
*/
public com.google.common.util.concurrent.ListenableFuture getTopicInfo(
com.hedera.hashgraph.sdk.proto.Query request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetTopicInfoMethod(), getCallOptions()), request);
}
/**
*
**
* 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)
*
*/
public com.google.common.util.concurrent.ListenableFuture submitMessage(
com.hedera.hashgraph.sdk.proto.Transaction request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSubmitMessageMethod(), getCallOptions()), request);
}
}
private static final int METHODID_CREATE_TOPIC = 0;
private static final int METHODID_UPDATE_TOPIC = 1;
private static final int METHODID_DELETE_TOPIC = 2;
private static final int METHODID_GET_TOPIC_INFO = 3;
private static final int METHODID_SUBMIT_MESSAGE = 4;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final ConsensusServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(ConsensusServiceImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_CREATE_TOPIC:
serviceImpl.createTopic((com.hedera.hashgraph.sdk.proto.Transaction) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_UPDATE_TOPIC:
serviceImpl.updateTopic((com.hedera.hashgraph.sdk.proto.Transaction) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_DELETE_TOPIC:
serviceImpl.deleteTopic((com.hedera.hashgraph.sdk.proto.Transaction) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_TOPIC_INFO:
serviceImpl.getTopicInfo((com.hedera.hashgraph.sdk.proto.Query) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_SUBMIT_MESSAGE:
serviceImpl.submitMessage((com.hedera.hashgraph.sdk.proto.Transaction) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static abstract class ConsensusServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
ConsensusServiceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.hedera.hashgraph.sdk.proto.ConsensusServiceOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("ConsensusService");
}
}
private static final class ConsensusServiceFileDescriptorSupplier
extends ConsensusServiceBaseDescriptorSupplier {
ConsensusServiceFileDescriptorSupplier() {}
}
private static final class ConsensusServiceMethodDescriptorSupplier
extends ConsensusServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
ConsensusServiceMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (ConsensusServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new ConsensusServiceFileDescriptorSupplier())
.addMethod(getCreateTopicMethod())
.addMethod(getUpdateTopicMethod())
.addMethod(getDeleteTopicMethod())
.addMethod(getGetTopicInfoMethod())
.addMethod(getSubmitMessageMethod())
.build();
}
}
}
return result;
}
}