pub type NodeServiceData = NodeServiceDataV2;Expand description
Type alias for the latest version of the node service data structure.
Aliased Type§
pub struct NodeServiceData {Show 31 fields
pub alpha: bool,
pub schema_version: u32,
pub antnode_path: PathBuf,
pub auto_restart: bool,
pub connected_peers: Option<Vec<PeerId>>,
pub data_dir_path: PathBuf,
pub evm_network: Network,
pub initial_peers_config: InitialPeersConfig,
pub listen_addr: Option<Vec<Multiaddr>>,
pub log_dir_path: PathBuf,
pub log_format: Option<LogFormat>,
pub max_archived_log_files: Option<usize>,
pub max_log_files: Option<usize>,
pub metrics_port: Option<u16>,
pub network_id: Option<u8>,
pub node_ip: Option<Ipv4Addr>,
pub node_port: Option<u16>,
pub no_upnp: bool,
pub number: u16,
pub peer_id: Option<PeerId>,
pub pid: Option<u32>,
pub relay: bool,
pub rewards_address: Address,
pub reward_balance: Option<AttoTokens>,
pub rpc_socket_addr: SocketAddr,
pub service_name: String,
pub status: ServiceStatus,
pub user: Option<String>,
pub user_mode: bool,
pub version: String,
pub write_older_cache_files: bool,
}Fields§
§alpha: boolNew field in V2: indicates if the node is running in alpha mode
schema_version: u32§antnode_path: PathBuf§auto_restart: bool§connected_peers: Option<Vec<PeerId>>§data_dir_path: PathBuf§evm_network: Network§initial_peers_config: InitialPeersConfig§listen_addr: Option<Vec<Multiaddr>>§log_dir_path: PathBuf§log_format: Option<LogFormat>§max_archived_log_files: Option<usize>§max_log_files: Option<usize>§metrics_port: Option<u16>§network_id: Option<u8>§node_ip: Option<Ipv4Addr>§node_port: Option<u16>§no_upnp: bool§number: u16§peer_id: Option<PeerId>§pid: Option<u32>§relay: bool§rewards_address: Address§reward_balance: Option<AttoTokens>§rpc_socket_addr: SocketAddr§service_name: String§status: ServiceStatus§user: Option<String>§user_mode: bool§version: String§write_older_cache_files: boolNew field in V2: indicates if older cache files should be written Serde::default is used here for backward compatibility
Implementations§
Source§impl NodeServiceData
impl NodeServiceData
Sourcepub fn get_antnode_port(&self) -> Option<u16>
pub fn get_antnode_port(&self) -> Option<u16>
Returns the UDP port from our node’s listen address.
Sourcepub fn get_critical_failure(&self) -> Option<(DateTime<Utc>, String)>
pub fn get_critical_failure(&self) -> Option<(DateTime<Utc>, String)>
Returns an optional critical failure of the node.
pub fn serialize_peer_id<S>(
value: &Option<PeerId>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn deserialize_peer_id<'de, D>(
deserializer: D,
) -> Result<Option<PeerId>, D::Error>where
D: Deserializer<'de>,
pub fn serialize_connected_peers<S>(
connected_peers: &Option<Vec<PeerId>>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn deserialize_connected_peers<'de, D>(
deserializer: D,
) -> Result<Option<Vec<PeerId>>, D::Error>where
D: Deserializer<'de>,
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeServiceData
Custom deserialization for NodeServiceData.
This will perform conversion from V0 or V1 to V2 if needed.
impl<'de> Deserialize<'de> for NodeServiceData
Custom deserialization for NodeServiceData. This will perform conversion from V0 or V1 to V2 if needed.
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more