Skip to main content

ConsensusCreateTopicTransactionBody

Struct ConsensusCreateTopicTransactionBody 

Source
pub struct ConsensusCreateTopicTransactionBody {
    pub memo: String,
    pub admin_key: Option<Key>,
    pub submit_key: Option<Key>,
    pub auto_renew_period: Option<Duration>,
    pub auto_renew_account: Option<AccountId>,
    pub fee_schedule_key: Option<Key>,
    pub fee_exempt_key_list: Vec<Key>,
    pub custom_fees: Vec<FixedCustomFee>,
}
Expand description

Create a topic to accept and group consensus messages.

If autoRenewAccount is specified, that account Key MUST also sign this transaction.
If adminKey is set, that Key MUST sign the transaction.
On success, the resulting TransactionReceipt SHALL contain the newly created TopicId.

The autoRenewPeriod on a topic MUST be set to a value between autoRenewPeriod.minDuration and autoRenewPeriod.maxDuration. These values are configurable, typically 30 and 92 days.
This also sets the initial expirationTime of the topic.

If no adminKey is set on a topic -autoRenewAccount SHALL NOT be set on the topic.

  • A deleteTopic transaction SHALL fail.
  • An updateTopic transaction that only extends the expirationTime MAY succeed.
  • Any other updateTopic transaction SHALL fail.

If the topic expires and is not automatically renewed, the topic SHALL enter the EXPIRED state.

  • All transactions on the topic SHALL fail with TOPIC_EXPIRED
    • Except an updateTopic() call that only extends the expirationTime.
  • getTopicInfo() SHALL succeed, and show the topic is expired. The topic SHALL remain in the EXPIRED state for a time determined by the autorenew.gracePeriod (configurable, originally 7 days).
    After the grace period, if the topic’s expirationTime is not extended, the topic SHALL be automatically deleted from state entirely, and cannot be recovered or recreated.

§Block Stream Effects

None

Fields§

§memo: String

A short memo for this topic.

This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` (default 100) bytes when encoded as UTF-8.

§admin_key: Option<Key>

Access control for modification of the topic after it is created.

If this field is set, that key MUST sign this transaction.
If this field is set, that key MUST sign each future transaction to update or delete the topic.
An updateTopic transaction that _only_ extends the topic expirationTime (a "manual renewal" transaction) SHALL NOT require admin key signature.
A topic without an admin key SHALL be immutable, except for expiration and renewal.
If adminKey is not set, then `autoRenewAccount` SHALL NOT be set.

§submit_key: Option<Key>

Access control for message submission to the topic.

If this field is set, that key MUST sign each consensus submit message for this topic.
If this field is not set then any account may submit a message on the topic, without restriction.

§auto_renew_period: Option<Duration>

The initial lifetime, in seconds, for the topic.
This is also the number of seconds for which the topic SHALL be automatically renewed upon expiring, if it has a valid auto-renew account.

This value MUST be set.
This value MUST be greater than the configured MIN_AUTORENEW_PERIOD.
This value MUST be less than the configured MAX_AUTORENEW_PERIOD.

§auto_renew_account: Option<AccountId>

The ID of the account to be charged renewal fees at the topic’s expirationTime to extend the lifetime of the topic.

The topic lifetime SHALL be extended by the smallest of the following:

  • The current `autoRenewPeriod` duration.
  • The maximum duration that this account has funds to purchase.
  • The configured MAX_AUTORENEW_PERIOD at the time of automatic renewal.
If this value is set, the referenced account MUST sign this transaction.
If this value is set, the `adminKey` field MUST also be set (though that key MAY not have any correlation to this account).
§fee_schedule_key: Option<Key>

Access control for update or delete of custom fees.

If set, subsequent `consensus_update_topic` transactions signed with this key MAY update or delete the custom fees for this topic.
If not set, the custom fees for this topic SHALL BE immutable.
If not set when the topic is created, this field CANNOT be set via update.
If set when the topic is created, this field MAY be changed via update.

§fee_exempt_key_list: Vec<Key>

A set of keys.
Keys in this list are permitted to submit messages to this topic without paying custom fees associated with this topic.

If a submit transaction is signed by _any_ key included in this set, custom fees SHALL NOT be charged for that transaction.
This field MUST NOT contain more than 10 keys.
fee_exempt_key_list SHALL NOT contain any duplicate keys.
fee_exempt_key_list MAY contain keys for accounts that are inactive, deleted, or non-existent.
If fee_exempt_key_list is unset in this transaction, there SHALL NOT be any fee-exempt keys. In particular, the following keys SHALL NOT be implicitly or automatically added to this list: `adminKey`, `submitKey`, `fee_schedule_key`.

§custom_fees: Vec<FixedCustomFee>

A set of custom fee definitions.
These are fees to be assessed for each submit to this topic.

Each fee defined in this set SHALL be evaluated for each message submitted to this topic, and the resultant total assessed fees SHALL be charged.
Custom fees defined here SHALL be assessed in addition to the base network and node fees.
custom_fees list SHALL NOT contain more than `MAX_CUSTOM_FEE_ENTRIES_FOR_TOPICS` entries.

Trait Implementations§

Source§

impl Clone for ConsensusCreateTopicTransactionBody

Source§

fn clone(&self) -> ConsensusCreateTopicTransactionBody

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConsensusCreateTopicTransactionBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConsensusCreateTopicTransactionBody

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for ConsensusCreateTopicTransactionBody

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for ConsensusCreateTopicTransactionBody

Source§

fn eq(&self, other: &ConsensusCreateTopicTransactionBody) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConsensusCreateTopicTransactionBody

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more