NodeCreateTransactionBody

Struct NodeCreateTransactionBody 

Source
pub struct NodeCreateTransactionBody {
    pub account_id: Option<AccountId>,
    pub description: String,
    pub gossip_endpoint: Vec<ServiceEndpoint>,
    pub service_endpoint: Vec<ServiceEndpoint>,
    pub gossip_ca_certificate: Vec<u8>,
    pub grpc_certificate_hash: Vec<u8>,
    pub admin_key: Option<Key>,
    pub decline_reward: bool,
    pub grpc_proxy_endpoint: Option<ServiceEndpoint>,
}
Expand description

A transaction body to add a new consensus node to the network address book.

This transaction body SHALL be considered a “privileged transaction”.

This message supports a transaction to create a new node in the network address book. The transaction, once complete, enables a new consensus node to join the network, and requires governing council authorization.

  • A NodeCreateTransactionBody MUST be signed by the Key assigned to the admin_key field and one of those keys: treasure account (2) key, systemAdmin(50) key, or addressBookAdmin(55) key.
  • The newly created node information SHALL be added to the network address book information in the network state.
  • The new entry SHALL be created in “state” but SHALL NOT participate in network consensus and SHALL NOT be present in network “configuration” until the next “upgrade” transaction (as noted below).
  • All new address book entries SHALL be added to the active network configuration during the next freeze transaction with the field freeze_type set to PREPARE_UPGRADE.

§Block Stream Effects

Upon completion the newly assigned node_id SHALL be recorded in the transaction receipt.
This value SHALL be the next available node identifier.
Node identifiers SHALL NOT be reused.

Fields§

§account_id: Option<AccountId>

A Node account identifier.

This account identifier MUST be in the "account number" form.
This account identifier MUST NOT use the alias field.
If the identified account does not exist, this transaction SHALL fail.
Multiple nodes MAY share the same node account.
This field is REQUIRED.

§description: String

A short description of the node.

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

§gossip_endpoint: Vec<ServiceEndpoint>

A list of service endpoints for gossip.

These endpoints SHALL represent the published endpoints to which other consensus nodes may _gossip_ transactions.
These endpoints MUST specify a port.
This list MUST NOT be empty.
This list MUST NOT contain more than `10` entries.
The first two entries in this list SHALL be the endpoints published to all consensus nodes.
All other entries SHALL be reserved for future use.

Each network may have additional requirements for these endpoints. A client MUST check network-specific documentation for those details.
If the network configuration value `gossipFqdnRestricted` is set, then all endpoints in this list MUST supply only IP address.
If the network configuration value `gossipFqdnRestricted` is _not_ set, then endpoints in this list MAY supply either IP address or FQDN, but MUST NOT supply both values for the same endpoint.

§service_endpoint: Vec<ServiceEndpoint>

A list of service endpoints for gRPC calls.

These endpoints SHALL represent the published gRPC endpoints to which clients may submit transactions.
These endpoints MUST specify a port.
Endpoints in this list MAY supply either IP address or FQDN, but MUST NOT supply both values for the same endpoint.
This list MUST NOT be empty.
This list MUST NOT contain more than `8` entries.

§gossip_ca_certificate: Vec<u8>

A certificate used to sign gossip events.

This value MUST be a certificate of a type permitted for gossip signatures.
This value MUST be the DER encoding of the certificate presented.
This field is REQUIRED and MUST NOT be empty.

§grpc_certificate_hash: Vec<u8>

A hash of the node gRPC TLS certificate.

This value MAY be used to verify the certificate presented by the node during TLS negotiation for gRPC.
This value MUST be a SHA-384 hash.
The TLS certificate to be hashed MUST first be in PEM format and MUST be encoded with UTF-8 NFKD encoding to a stream of bytes provided to the hash algorithm.
This field is OPTIONAL.

§admin_key: Option<Key>

An administrative key controlled by the node operator.

This key MUST sign this transaction.
This key MUST sign each transaction to update this node.
This field MUST contain a valid `Key` value.
This field is REQUIRED and MUST NOT be set to an empty `KeyList`.

§decline_reward: bool

A boolean flag indicating whether the node operator declines to receive node rewards.

If this flag is set to `true`, the node operator declines to receive node rewards.

§grpc_proxy_endpoint: Option<ServiceEndpoint>

A web proxy for gRPC from non-gRPC clients.

This endpoint SHALL be a Fully Qualified Domain Name (FQDN) using the HTTPS protocol, and SHALL support gRPC-Web for use by browser-based clients.
This endpoint MUST be signed by a trusted certificate authority.
This endpoint MUST use a valid port and SHALL be reachable over TLS.
This field MAY be omitted if the node does not support gRPC-Web access.
This field MUST be updated if the gRPC-Web endpoint changes.
This field SHALL enable frontend clients to avoid hard-coded proxy endpoints.

Trait Implementations§

Source§

impl Clone for NodeCreateTransactionBody

Source§

fn clone(&self) -> NodeCreateTransactionBody

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeCreateTransactionBody

Source§

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

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

impl Default for NodeCreateTransactionBody

Source§

fn default() -> Self

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

impl Message for NodeCreateTransactionBody

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 NodeCreateTransactionBody

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for NodeCreateTransactionBody

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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