diff --git a/Cargo.lock b/Cargo.lock index cd5fb2ee4a3..3089ed0a0f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1896,6 +1896,7 @@ dependencies = [ "thiserror", "tokio", "trybuild", + "url", "warp", ] @@ -1977,6 +1978,7 @@ dependencies = [ "color-eyre", "derive_more", "iroha_config", + "iroha_data_model", "once_cell", "serde", "serde_json", @@ -2076,6 +2078,7 @@ dependencies = [ "eyre", "futures", "iroha_config", + "iroha_data_model", "iroha_futures", "iroha_logger", "iroha_telemetry_derive", diff --git a/cli/src/config.rs b/cli/src/config.rs index e9aec9c7134..b27a0d38069 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -2,7 +2,7 @@ use std::{fmt::Debug, fs::File, io::BufReader, path::Path}; use eyre::{Result, WrapErr}; -use iroha_config::derive::Configurable; +use iroha_config::derive::{Configurable, View}; use iroha_core::{ block_sync::config::BlockSyncConfiguration, genesis::config::GenesisConfiguration, kura::config::KuraConfiguration, queue::Configuration as QueueConfiguration, @@ -10,22 +10,29 @@ use iroha_core::{ wsv::config::Configuration as WorldStateViewConfiguration, }; use iroha_crypto::prelude::*; -use iroha_data_model::prelude::*; +use iroha_data_model::{ + config::{ + network::Configuration as PublicNetworkConfiguration, Configuration as PublicConfiguration, + }, + prelude::*, +}; use iroha_logger::Configuration as LoggerConfiguration; use serde::{Deserialize, Serialize}; use super::torii::config::ToriiConfiguration; /// Configuration parameters container. -#[derive(Debug, Clone, Deserialize, Serialize, Configurable)] +#[derive(Debug, Clone, Deserialize, Serialize, Configurable, View)] #[serde(default)] #[serde(rename_all = "UPPERCASE")] #[config(env_prefix = "IROHA_")] +#[view(PublicConfiguration)] pub struct Configuration { /// Public key of this peer. #[config(serde_as_str)] pub public_key: PublicKey, /// Private key of this peer. + #[view(ignore)] pub private_key: PrivateKey, /// Disable coloring of the backtrace and error report on panic. pub disable_panic_terminal_colors: bool, @@ -87,10 +94,11 @@ impl Default for Configuration { } /// Network Configuration parameters container. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[serde(default)] #[serde(rename_all = "UPPERCASE")] #[config(env_prefix = "IROHA_NETWORK_")] +#[view(PublicNetworkConfiguration)] pub struct NetworkConfiguration { /// Buffer capacity of actor's MPSC channel pub actor_channel_capacity: u32, diff --git a/cli/src/torii/config.rs b/cli/src/torii/config.rs index 9e719cdf3d8..f4a96e5cf88 100644 --- a/cli/src/torii/config.rs +++ b/cli/src/torii/config.rs @@ -1,6 +1,8 @@ //! Configuration as well as the default values for the URLs used for the main endpoints: `p2p`, `telemetry`, but not `api`. -use iroha_config::derive::Configurable; -use iroha_data_model::uri::DEFAULT_API_URL; +use iroha_config::derive::{Configurable, View}; +use iroha_data_model::{ + config::torii::Configuration as PublicToriiConfiguration, uri::DEFAULT_API_URL, +}; use serde::{Deserialize, Serialize}; /// Default socket for p2p communication @@ -15,10 +17,11 @@ pub const DEFAULT_TORII_MAX_CONTENT_LENGTH: u32 = 2_u32.pow(12) * 4000; /// Structure that defines the configuration parameters of `Torii` which is the routing module. /// For example the `p2p_addr`, which is used for consensus and block-synchronisation purposes, /// as well as `max_transaction_size`. -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Configurable)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[serde(rename_all = "UPPERCASE")] #[serde(default)] #[config(env_prefix = "TORII_")] +#[view(PublicToriiConfiguration)] pub struct ToriiConfiguration { /// Torii URL for p2p communication for consensus and block synchronization purposes. pub p2p_addr: String, diff --git a/config/derive/src/lib.rs b/config/derive/src/lib.rs index 21f2d0b9fcf..234180e4240 100644 --- a/config/derive/src/lib.rs +++ b/config/derive/src/lib.rs @@ -500,3 +500,131 @@ fn impl_configurable(ast: &DeriveInput) -> TokenStream { }; out.into() } + +struct ViewType { + ident: Ident, +} + +impl Parse for ViewType { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + ident: input.parse()?, + }) + } +} + +struct ViewIgnore { + _ident: Ident, +} + +impl ViewIgnore { + const IGNORE: &'static str = "ignore"; +} + +impl Parse for ViewIgnore { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + _ident: parse_const_ident(input, Self::IGNORE)?, + }) + } +} + +/// Derive conversation between type and it's view. Check other doc in `iroha_config` reexport. +#[proc_macro_derive(View, attributes(view))] +pub fn into_view_derive(input: TokenStream) -> TokenStream { + let ast = match syn::parse(input) { + Ok(ast) => ast, + Err(err) => { + abort_call_site!("Failed to parse input Token Stream: {}", err) + } + }; + impl_into_view(&ast) +} + +#[allow(clippy::str_to_string)] +fn impl_into_view(ast: &DeriveInput) -> TokenStream { + let ty = &ast.ident; + #[allow(clippy::expect_used)] + let view = ast + .attrs + .iter() + .find_map(|attr| { + if !attr.path.is_ident("view") { + return None; + } + attr.parse_args::().ok() + }) + .map(|view| view.ident) + .expect("Required to provide view type."); + let fields = if let Data::Struct(DataStruct { + fields: Fields::Named(fields), + .. + }) = &ast.data + { + &fields.named + } else { + abort!(ast, "Only structs are supported"); + }; + // Filter-out fields with `#[view(ignore)]` + let fields = fields + .iter() + .filter(|field| { + field + .attrs + .iter() + .find_map(|attr| { + if !attr.path.is_ident("view") { + return None; + } + attr.parse_args::().ok() + }) + .is_none() + }) + .collect::>(); + let field_idents = fields + .iter() + .map(|field| { + #[allow(clippy::expect_used)] + field + .ident + .as_ref() + .expect("Should always be set for named structures") + }) + .collect::>(); + let out = quote! { + impl From<#view> for #ty { + fn from(config: #view) -> Self { + let #view { + #( + #field_idents, + )* + } = config; + // Important to write macro in uniform way. + #[allow(clippy::needless_update)] + Self { + #( + #field_idents: From::<_>::from(#field_idents), + )* + ..Self::default() + } + } + } + + impl From<#ty> for #view { + fn from(config: #ty) -> Self { + let #ty { + #( + #field_idents, + )* + .. + } = config; + Self { + #( + #field_idents: From::<_>::from(#field_idents), + )* + } + } + } + }; + out.into() +} diff --git a/config/src/lib.rs b/config/src/lib.rs index 4701cc9a8f6..9dfb62f9a86 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -58,6 +58,51 @@ pub mod derive { /// assert_eq!(ip.ip, Ipv4Addr::new(127, 0, 0, 1)); /// ``` pub use iroha_config_derive::Configurable; + /// Derive macro for conversation between type and it's view which contains only subset of type's fields. + /// + /// Works only with structs. + /// + /// Assumptions: + /// - View's fields are subset of type's fields; + /// - Type implements `Default`. + /// + /// ## Container attributes + /// + /// ### `#[view(ViewType)]` + /// Sets container type view type. + /// + /// ## Field attributes + /// ### `#[view(ignore)]` + /// Mark field to ignore it when converting to view type. + /// + /// ## Examples + /// + /// ```rust + /// use iroha_config::derive::View; + /// + /// struct View { + /// a: u32, + /// } + /// + /// #[derive(Default, View)] + /// #[view(View)] + /// struct Structure { + /// a: u32, + /// // `View` doesn't have field `b` so we must exclude it. + /// #[view(ignore)] + /// b: u32, + /// } + /// + /// let view = View { a: 32 }; + /// let structure: Structure = view.into(); + /// assert_eq!(structure.a, 32); + /// assert_eq!(structure.b, u32::default()); + /// + /// let structure = Structure { a: 13, b: 37 }; + /// let view: View = structure.into(); + /// assert_eq!(view.a, 13); + /// ``` + pub use iroha_config_derive::View; /// Error related to deserializing specific field #[derive(Debug, Display)] diff --git a/core/Cargo.toml b/core/Cargo.toml index a061e3c4d74..7f388baa8a5 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -17,14 +17,14 @@ default = ["bridge", "cli", "telemetry"] # Interoperability with popular blockchain networks (Substrate, Ether, etc.) bridge = [] # Support lightweight telemetry, including diagnostics -telemetry = [] +telemetry = ["iroha_data_model/telemetry"] # Support the included CLI cli = [] # Support Decentralised Exchange, including functionality for atomic exchange instruction dex = [] # Support developer-specific telemetry. # Should not be enabled on production builds. -dev-telemetry = ["telemetry", "iroha_telemetry/dev-telemetry"] +dev-telemetry = ["telemetry", "iroha_telemetry/dev-telemetry", "iroha_data_model/dev-telemetry"] # Support Prometheus metrics. See https://prometheus.io/. expensive-telemetry = ["iroha_telemetry/metric-instrumentation"] diff --git a/core/src/block_sync.rs b/core/src/block_sync.rs index cfc0d9682e4..9313734770a 100644 --- a/core/src/block_sync.rs +++ b/core/src/block_sync.rs @@ -336,7 +336,8 @@ pub mod message { /// This module contains all configuration related logic. pub mod config { - use iroha_config::derive::Configurable; + use iroha_config::derive::{Configurable, View}; + use iroha_data_model::config::block_sync::Configuration as PublicBlockSyncConfiguration; use serde::{Deserialize, Serialize}; const DEFAULT_BLOCK_BATCH_SIZE: u32 = 4; @@ -344,10 +345,11 @@ pub mod config { const DEFAULT_ACTOR_CHANNEL_CAPACITY: u32 = 100; /// Configuration for `BlockSynchronizer`. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[serde(rename_all = "UPPERCASE")] #[serde(default)] #[config(env_prefix = "BLOCK_SYNC_")] + #[view(PublicBlockSyncConfiguration)] pub struct BlockSyncConfiguration { /// The time between sending requests for latest block. pub gossip_period_ms: u64, diff --git a/core/src/genesis.rs b/core/src/genesis.rs index f58a01fc11e..b0e91379f1a 100644 --- a/core/src/genesis.rs +++ b/core/src/genesis.rs @@ -325,24 +325,27 @@ impl GenesisTransaction { /// Module with genesis configuration logic. pub mod config { - use iroha_config::derive::Configurable; + use iroha_config::derive::{Configurable, View}; use iroha_crypto::{KeyPair, PrivateKey, PublicKey}; + use iroha_data_model::config::genesis::Configuration as PublicGenesisConfiguration; use serde::{Deserialize, Serialize}; const DEFAULT_WAIT_FOR_PEERS_RETRY_COUNT_LIMIT: u64 = 100; const DEFAULT_WAIT_FOR_PEERS_RETRY_PERIOD_MS: u64 = 500; const DEFAULT_GENESIS_SUBMISSION_DELAY_MS: u64 = 1000; - #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Configurable)] + #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[serde(default)] #[serde(rename_all = "UPPERCASE")] #[config(env_prefix = "IROHA_GENESIS_")] + #[view(PublicGenesisConfiguration)] /// Configuration of the genesis block and the process of its submission. pub struct GenesisConfiguration { /// The genesis account public key, should be supplied to all peers. #[config(serde_as_str)] pub account_public_key: PublicKey, /// Genesis account private key, only needed on the peer that submits the genesis block. + #[view(ignore)] pub account_private_key: Option, /// Number of attempts to connect to peers, while waiting for them to submit genesis. #[serde(default = "default_wait_for_peers_retry_count_limit")] diff --git a/core/src/kura.rs b/core/src/kura.rs index f1b112aef31..c2a97f09032 100644 --- a/core/src/kura.rs +++ b/core/src/kura.rs @@ -530,7 +530,10 @@ pub mod config { use std::{num::NonZeroU64, path::Path}; use eyre::{eyre, Result}; - use iroha_config::derive::Configurable; + use iroha_config::derive::{Configurable, View}; + use iroha_data_model::config::kura::{ + Configuration as PublicKuraConfiguration, Mode as PublicMode, + }; use serde::{Deserialize, Serialize}; use super::Mode; @@ -540,9 +543,10 @@ pub mod config { const DEFAULT_ACTOR_CHANNEL_CAPACITY: u32 = 100; /// Configuration of kura - #[derive(Clone, Deserialize, Serialize, Debug, Configurable, PartialEq, Eq)] + #[derive(Clone, Deserialize, Serialize, Debug, Configurable, PartialEq, Eq, View)] #[serde(rename_all = "UPPERCASE")] #[config(env_prefix = "KURA_")] + #[view(PublicKuraConfiguration)] pub struct KuraConfiguration { /// Possible modes: `strict`, `fast`. #[serde(default)] @@ -597,6 +601,24 @@ pub mod config { const fn default_actor_channel_capacity() -> u32 { DEFAULT_ACTOR_CHANNEL_CAPACITY } + + impl From for PublicMode { + fn from(mode: Mode) -> Self { + match mode { + Mode::Fast => PublicMode::Fast, + Mode::Strict => PublicMode::Strict, + } + } + } + + impl From for Mode { + fn from(mode: PublicMode) -> Self { + match mode { + PublicMode::Fast => Mode::Fast, + PublicMode::Strict => Mode::Strict, + } + } + } } /// A trait, describing filesystem IO for Kura diff --git a/core/src/queue.rs b/core/src/queue.rs index fcd90d48f5b..e87e3d55acb 100644 --- a/core/src/queue.rs +++ b/core/src/queue.rs @@ -217,7 +217,8 @@ impl Queue { /// This module contains all configuration related logic. pub mod config { - use iroha_config::derive::Configurable; + use iroha_config::derive::{Configurable, View}; + use iroha_data_model::config::queue::Configuration as PublicConfiguration; use serde::{Deserialize, Serialize}; const DEFAULT_MAXIMUM_TRANSACTIONS_IN_BLOCK: u32 = 2_u32.pow(13); @@ -227,10 +228,11 @@ pub mod config { const DEFAULT_FUTURE_THRESHOLD_MS: u64 = 1000; /// Configuration for `Queue`. - #[derive(Copy, Clone, Deserialize, Serialize, Debug, Configurable, PartialEq, Eq)] + #[derive(Copy, Clone, Deserialize, Serialize, Debug, Configurable, PartialEq, Eq, View)] #[serde(rename_all = "UPPERCASE")] #[serde(default)] #[config(env_prefix = "QUEUE_")] + #[view(PublicConfiguration)] pub struct Configuration { /// The upper limit of the number of transactions per block. pub maximum_transactions_in_block: u32, diff --git a/core/src/smartcontracts/wasm.rs b/core/src/smartcontracts/wasm.rs index 94cda7b3587..be724aa1449 100644 --- a/core/src/smartcontracts/wasm.rs +++ b/core/src/smartcontracts/wasm.rs @@ -522,16 +522,18 @@ impl<'wrld> Runtime<'wrld> { /// This module contains all configuration related logic. pub mod config { - use iroha_config::derive::Configurable; + use iroha_config::derive::{Configurable, View}; + use iroha_data_model::config::wasm::Configuration as PublicConfiguration; use serde::{Deserialize, Serialize}; const DEFAULT_FUEL_LIMIT: u64 = 1_000_000; const DEFAULT_MAX_MEMORY: u32 = 500 * 2_u32.pow(20); // 500 MiB /// [`WebAssembly Runtime`](super::Runtime) configuration. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[config(env_prefix = "WASM_")] #[serde(rename_all = "UPPERCASE", default)] + #[view(PublicConfiguration)] pub struct Configuration { /// Every WASM instruction costs approximately 1 unit of fuel. See /// [`wasmtime` reference](https://docs.rs/wasmtime/0.29.0/wasmtime/struct.Store.html#method.add_fuel) diff --git a/core/src/sumeragi/config.rs b/core/src/sumeragi/config.rs index ca757007ade..bbb774f9b86 100644 --- a/core/src/sumeragi/config.rs +++ b/core/src/sumeragi/config.rs @@ -2,9 +2,15 @@ use std::{collections::HashSet, fmt::Debug, fs::File, io::BufReader, path::Path}; use eyre::{Result, WrapErr}; -use iroha_config::derive::Configurable; +use iroha_config::derive::{Configurable, View}; use iroha_crypto::prelude::*; -use iroha_data_model::{prelude::*, transaction}; +use iroha_data_model::{ + config::sumeragi::{ + Configuration as PublicSumeragiConfiguration, TrustedPeers as PublicTrustedPeers, + }, + prelude::*, + transaction, +}; use serde::{Deserialize, Serialize}; /// Default Amount of time peer waits for the `CreatedBlock` message @@ -20,13 +26,15 @@ const DEFAULT_GOSSIP_BATCH_SIZE: u32 = 500; /// `SumeragiConfiguration` provides an ability to define parameters such as `BLOCK_TIME_MS` /// and list of `TRUSTED_PEERS`. -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Configurable)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[serde(default)] #[serde(rename_all = "UPPERCASE")] #[config(env_prefix = "SUMERAGI_")] +#[view(PublicSumeragiConfiguration)] pub struct SumeragiConfiguration { /// Key pair of private and public keys. #[serde(skip)] + #[view(ignore)] pub key_pair: KeyPair, /// Current Peer Identification. pub peer_id: PeerId, @@ -188,3 +196,17 @@ impl TrustedPeers { }) } } + +impl From for PublicTrustedPeers { + fn from(trusted_peers: TrustedPeers) -> Self { + let TrustedPeers { peers } = trusted_peers; + Self { peers } + } +} + +impl From for TrustedPeers { + fn from(trusted_peers: PublicTrustedPeers) -> Self { + let PublicTrustedPeers { peers } = trusted_peers; + Self { peers } + } +} diff --git a/core/src/wsv.rs b/core/src/wsv.rs index 4687a96ac27..ccdc788622e 100644 --- a/core/src/wsv.rs +++ b/core/src/wsv.rs @@ -797,8 +797,11 @@ impl WorldStateView { /// This module contains all configuration related logic. pub mod config { - use iroha_config::derive::Configurable; - use iroha_data_model::{metadata::Limits as MetadataLimits, LengthLimits}; + use iroha_config::derive::{Configurable, View}; + use iroha_data_model::{ + config::wsv::Configuration as PublicConfiguration, metadata::Limits as MetadataLimits, + LengthLimits, + }; use serde::{Deserialize, Serialize}; use crate::smartcontracts::wasm; @@ -808,9 +811,10 @@ pub mod config { const DEFAULT_IDENT_LENGTH_LIMITS: LengthLimits = LengthLimits::new(1, 2_u32.pow(7)); /// [`WorldStateView`](super::WorldStateView) configuration. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Configurable, View)] #[config(env_prefix = "WSV_")] #[serde(rename_all = "UPPERCASE", default)] + #[view(PublicConfiguration)] pub struct Configuration { /// [`MetadataLimits`] for every asset with store. pub asset_metadata_limits: MetadataLimits, diff --git a/data_model/Cargo.toml b/data_model/Cargo.toml index c4bc821a3d0..c0ddb0c9800 100644 --- a/data_model/Cargo.toml +++ b/data_model/Cargo.toml @@ -21,9 +21,14 @@ default = ["std"] # Enable static linkage of the rust standard library. # Disabled for WASM interoperability, to reduce the binary size. # Please refer to https://docs.rust-embedded.org/book/intro/no-std.html -std = ["iroha_macro/std", "iroha_version/std", "iroha_version/warp", "iroha_crypto/std", "iroha_data_primitives/std", "thiserror", "strum/std", "dashmap", "tokio"] +std = ["iroha_macro/std", "iroha_version/std", "iroha_version/warp", "iroha_crypto/std", "iroha_data_primitives/std", "thiserror", "strum/std", "dashmap", "tokio", "url"] # Expose FFI API to facilitate dynamic linking ffi_api = ["iroha_ffi", "iroha_crypto/ffi_api"] +# Support lightweight telemetry, including diagnostics +telemetry = [] +# Support developer-specific telemetry. +# Should not be enabled on production builds. +dev-telemetry = ["telemetry"] # Expose API for mutating structures (Internal use only) mutable_api = [] @@ -46,6 +51,7 @@ warp = { version = "0.3", default-features = false, optional = true } thiserror = { version = "1.0.28", optional = true } getset = "0.1.2" strum = { version = "0.24.0", default-features = false, features = ["derive"] } +url = { version = "2.2.2", features = ["serde"], optional = true } [dev-dependencies] iroha_core = { path = "../core", version = "=2.0.0-pre-rc.5" } diff --git a/data_model/src/config.rs b/data_model/src/config.rs new file mode 100644 index 00000000000..da54cb7c596 --- /dev/null +++ b/data_model/src/config.rs @@ -0,0 +1,296 @@ +//! Structures related to sharable through network configuration +#![cfg(feature = "std")] + +use iroha_crypto::prelude::*; +use serde::{Deserialize, Serialize}; + +/// Configuration parameters container. +#[derive(Debug, Clone, Deserialize, Serialize)] +#[serde(rename_all = "UPPERCASE")] +pub struct Configuration { + /// Public key of this peer. + pub public_key: PublicKey, + /// Disable coloring of the backtrace and error report on panic. + pub disable_panic_terminal_colors: bool, + /// `Kura` related configuration. + pub kura: kura::Configuration, + /// `Sumeragi` related configuration. + pub sumeragi: sumeragi::Configuration, + /// `Torii` related configuration. + pub torii: torii::Configuration, + /// `BlockSynchronizer` configuration. + pub block_sync: block_sync::Configuration, + /// `Queue` configuration. + pub queue: queue::Configuration, + /// `Logger` configuration. + pub logger: logger::Configuration, + /// Configuration for `GenesisBlock`. + pub genesis: genesis::Configuration, + /// Configuration for `WorldStateView`. + pub wsv: wsv::Configuration, + /// Network configuration + pub network: network::Configuration, + /// Configuration for telemetry + #[cfg(feature = "telemetry")] + pub telemetry: telemetry::Configuration, +} + +/// Module for network-related configuration and structs. +pub mod network { + use super::*; + /// Network Configuration parameters container. + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// Buffer capacity of actor's MPSC channel + pub actor_channel_capacity: u32, + } +} + +/// Module for kura-related configuration and structs. +pub mod kura { + use super::*; + + /// Configuration of kura + #[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// Possible modes: `strict`, `fast`. + pub init_mode: Mode, + /// Path to the existing block store folder or path to create new folder. + pub block_store_path: String, + /// Maximum number of blocks to write into single storage file + pub blocks_per_storage_file: core::num::NonZeroU64, + /// Default buffer capacity of actor's MPSC channel + pub actor_channel_capacity: u32, + } + + /// Kura work mode. + #[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)] + #[serde(rename_all = "snake_case")] + pub enum Mode { + /// Strict validation of all blocks. + Strict, + /// Fast initialization with basic checks. + Fast, + } +} + +/// Module for sumeragi-related configuration and structs. +pub mod sumeragi { + use super::*; + /// `SumeragiConfiguration` provides an ability to define parameters such as `BLOCK_TIME_MS` + /// and list of `TRUSTED_PEERS`. + #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// Current Peer Identification. + pub peer_id: crate::peer::Id, + /// Amount of time peer waits for the `CreatedBlock` message after getting a `TransactionReceipt` + pub block_time_ms: u64, + /// Optional list of predefined trusted peers. + pub trusted_peers: TrustedPeers, + /// Amount of time Peer waits for CommitMessage from the proxy tail. + pub commit_time_limit_ms: u64, + /// Amount of time Peer waits for TxReceipt from the leader. + pub tx_receipt_time_limit_ms: u64, + /// Limits to which transactions must adhere + pub transaction_limits: crate::transaction::TransactionLimits, + /// Buffer capacity of actor's MPSC channel + pub actor_channel_capacity: u32, + /// Maximum number of transactions in tx gossip batch message. While configuring this, attention should be payed to `p2p` max message size. + pub gossip_batch_size: u32, + /// Period in milliseconds for pending transaction gossiping between peers. + pub gossip_period_ms: u64, + } + + /// `SumeragiConfiguration` provides an ability to define parameters + /// such as `BLOCK_TIME_MS` and list of `TRUSTED_PEERS`. + #[derive(Debug, Clone, Default, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + #[serde(transparent)] + pub struct TrustedPeers { + /// Optional list of predefined trusted peers. Must contain unique + /// entries. Custom deserializer raises error if duplicates found. + pub peers: std::collections::HashSet, + } +} + +/// Module for torii-related configuration and structs. +pub mod torii { + use super::*; + /// Structure that defines the configuration parameters of `Torii` which is the routing module. + /// For example the `p2p_addr`, which is used for consensus and block-synchronisation purposes, + /// as well as `max_transaction_size`. + #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// Torii URL for p2p communication for consensus and block synchronization purposes. + pub p2p_addr: String, + /// Torii URL for client API. + pub api_url: String, + /// Torii URL for reporting internal status and metrics for administration. + pub telemetry_url: String, + /// Maximum number of bytes in raw transaction. Used to prevent from DOS attacks. + pub max_transaction_size: u32, + /// Maximum number of bytes in raw message. Used to prevent from DOS attacks. + pub max_content_len: u32, + } +} + +/// Module for block_sync-related configuration and structs. +pub mod block_sync { + use super::*; + + /// Configuration for `BlockSynchronizer`. + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// The time between sending requests for latest block. + pub gossip_period_ms: u64, + /// The number of blocks that can be sent in one message. + /// Underlying network (`iroha_network`) should support transferring messages this large. + pub block_batch_size: u32, + /// Buffer capacity of actor's MPSC channel + pub actor_channel_capacity: u32, + } +} + +/// Module for queue-related configuration and structs. +pub mod queue { + use super::*; + + /// Configuration for `Queue`. + #[derive(Copy, Clone, Deserialize, Serialize, Debug, PartialEq, Eq)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// The upper limit of the number of transactions per block. + pub maximum_transactions_in_block: u32, + /// The upper limit of the number of transactions waiting in this queue. + pub maximum_transactions_in_queue: u32, + /// The transaction will be dropped after this time if it is still in a `Queue`. + pub transaction_time_to_live_ms: u64, + /// The threshold to determine if a transaction has been tampered to have a future timestamp. + pub future_threshold_ms: u64, + } +} + +/// Module for logger-related configuration and structs. +pub mod logger { + use super::*; + + /// Configuration for `Logger`. + #[derive(Clone, Deserialize, Serialize, Debug)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// Maximum log level + pub max_log_level: Level, + /// Capacity (or batch size) for telemetry channel + pub telemetry_capacity: u32, + /// Compact mode (no spans from telemetry) + pub compact_mode: bool, + /// If provided, logs will be copied to said file in the + /// format readable by [bunyan](https://lib.rs/crates/bunyan) + pub log_file_path: Option, + /// Enable ANSI terminal colors for formatted output. + pub terminal_colors: bool, + } + + /// Log level for reading from environment and (de)serializing + #[allow(clippy::upper_case_acronyms)] + #[derive(Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] + pub enum Level { + /// Error + ERROR, + /// Warn + WARN, + /// Info (Default) + INFO, + /// Debug + DEBUG, + /// Trace + TRACE, + } +} + +/// Module for genesis-related configuration and structs. +pub mod genesis { + use super::*; + + #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + /// Configuration of the genesis block and the process of its submission. + pub struct Configuration { + /// The genesis account public key, should be supplied to all peers. + pub account_public_key: PublicKey, + /// Number of attempts to connect to peers, while waiting for them to submit genesis. + pub wait_for_peers_retry_count_limit: u64, + /// Period in milliseconds in which to retry connecting to peers, while waiting for them to submit genesis. + pub wait_for_peers_retry_period_ms: u64, + /// Delay before genesis block submission after minimum number of peers were discovered to be online. + /// Used to ensure that other peers had time to connect to each other. + pub genesis_submission_delay_ms: u64, + } +} + +/// Module for wsv-related configuration and structs. +pub mod wsv { + use super::*; + use crate::metadata::Limits as MetadataLimits; + + /// `WorldStateView` configuration. + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// [`MetadataLimits`] for every asset with store. + pub asset_metadata_limits: MetadataLimits, + /// [`MetadataLimits`] of any asset definition's metadata. + pub asset_definition_metadata_limits: MetadataLimits, + /// [`MetadataLimits`] of any account's metadata. + pub account_metadata_limits: MetadataLimits, + /// [`MetadataLimits`] of any domain's metadata. + pub domain_metadata_limits: MetadataLimits, + /// [`LengthLimits`] for the number of chars in identifiers that can be stored in the WSV. + pub ident_length_limits: crate::LengthLimits, + /// [`WASM Runtime`](wasm::Runtime) configuration + pub wasm_runtime_config: wasm::Configuration, + } +} + +/// Module for wasm-related configuration and structs. +pub mod wasm { + use super::*; + /// `WebAssembly Runtime` configuration. + #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// Every WASM instruction costs approximately 1 unit of fuel. See + /// [`wasmtime` reference](https://docs.rs/wasmtime/0.29.0/wasmtime/struct.Store.html#method.add_fuel) + pub fuel_limit: u64, + + /// Maximum amount of linear memory a given smartcontract can allocate + pub max_memory: u32, + } +} + +/// Module for telemetry-related configuration and structs. +pub mod telemetry { + use super::*; + + /// Configuration parameters container + #[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq)] + #[serde(rename_all = "UPPERCASE")] + pub struct Configuration { + /// The node's name to be seen on the telemetry + pub name: Option, + /// The url of the telemetry, e.g., ws://127.0.0.1:8001/submit + pub url: Option, + /// The minimum period of time in seconds to wait before reconnecting + pub min_retry_period: u64, + /// The maximum exponent of 2 that is used for increasing delay between reconnections + pub max_retry_delay_exponent: u8, + /// The filepath that to write dev-telemetry to + #[cfg(feature = "dev-telemetry")] + pub file: Option, + } +} diff --git a/data_model/src/lib.rs b/data_model/src/lib.rs index e9fbaef0351..6b44660e466 100644 --- a/data_model/src/lib.rs +++ b/data_model/src/lib.rs @@ -36,6 +36,7 @@ use crate::{ pub mod account; pub mod asset; pub mod block_value; +pub mod config; pub mod domain; pub mod events; pub mod expression; diff --git a/docs/source/references/config.md b/docs/source/references/config.md index 768a4efc0fa..f331f3012c0 100644 --- a/docs/source/references/config.md +++ b/docs/source/references/config.md @@ -337,7 +337,7 @@ null Maximum log level -Has type `handle::SyncValue>`. Can be configured via environment variable `MAX_LOG_LEVEL` +Has type `SyncLevel`. Can be configured via environment variable `MAX_LOG_LEVEL` ```json "INFO" diff --git a/logger/Cargo.toml b/logger/Cargo.toml index ce4a7893bd0..2cd71b5f420 100644 --- a/logger/Cargo.toml +++ b/logger/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] iroha_config = { version = "=2.0.0-pre-rc.5", path = "../config" } +iroha_data_model = { version = "=2.0.0-pre-rc.5", path = "../data_model" } color-eyre = "0.5.11" serde = { version = "1.0", features = ["derive"] } diff --git a/logger/src/config.rs b/logger/src/config.rs index 9e46e779e49..6d2eb893147 100644 --- a/logger/src/config.rs +++ b/logger/src/config.rs @@ -2,11 +2,15 @@ //! configuration, as well as run-time reloading of the log-level. use std::fmt::Debug; +use derive_more::{Deref, DerefMut}; use iroha_config::{ - derive::Configurable, + derive::{Configurable, View}, logger as config, runtime_upgrades::{handle, ReloadError, ReloadMut}, }; +use iroha_data_model::config::logger::{ + Configuration as PublicConfiguration, Level as PublicLevel, +}; use serde::{Deserialize, Serialize}; use tracing::Subscriber; use tracing_subscriber::{filter::LevelFilter, reload::Handle}; @@ -51,14 +55,27 @@ impl ReloadMut for Handle { } } +/// Wrapper around [`Level`] for runtime upgrades. +#[derive(Clone, Debug, Serialize, Deserialize, Deref, DerefMut, Default)] +#[repr(transparent)] +#[serde(transparent)] +pub struct SyncLevel(handle::SyncValue>); + +impl From for SyncLevel { + fn from(level: Level) -> Self { + Self(level.into()) + } +} + /// Configuration for [`crate`]. -#[derive(Clone, Deserialize, Serialize, Debug, Configurable)] +#[derive(Clone, Deserialize, Serialize, Debug, Configurable, View)] #[serde(rename_all = "UPPERCASE")] #[serde(default)] +#[view(PublicConfiguration)] pub struct Configuration { /// Maximum log level #[config(serde_as_str)] - pub max_log_level: handle::SyncValue>, + pub max_log_level: SyncLevel, /// Capacity (or batch size) for telemetry channel pub telemetry_capacity: u32, /// Compact mode (no spans from telemetry) @@ -73,7 +90,7 @@ pub struct Configuration { impl Default for Configuration { fn default() -> Self { Self { - max_log_level: handle::SyncValue::default(), + max_log_level: SyncLevel::default(), telemetry_capacity: TELEMETRY_CAPACITY, compact_mode: DEFAULT_COMPACT_MODE, log_file_path: None, @@ -81,3 +98,29 @@ impl Default for Configuration { } } } + +impl From for SyncLevel { + fn from(level: PublicLevel) -> Self { + let inner = match level { + PublicLevel::ERROR => config::Level::ERROR, + PublicLevel::WARN => config::Level::WARN, + PublicLevel::INFO => config::Level::INFO, + PublicLevel::DEBUG => config::Level::DEBUG, + PublicLevel::TRACE => config::Level::TRACE, + }; + Self(Level(inner).into()) + } +} + +impl From for PublicLevel { + fn from(level: SyncLevel) -> Self { + let inner: Level = level.value(); + match inner.0 { + config::Level::ERROR => PublicLevel::ERROR, + config::Level::WARN => PublicLevel::WARN, + config::Level::INFO => PublicLevel::INFO, + config::Level::DEBUG => PublicLevel::DEBUG, + config::Level::TRACE => PublicLevel::TRACE, + } + } +} diff --git a/out.txt b/out.txt new file mode 100644 index 00000000000..2f6efe5e767 --- /dev/null +++ b/out.txt @@ -0,0 +1,1223 @@ + Finished dev [unoptimized + debuginfo] target(s) in 0.12s + Running `target/debug/kagami docs` + Finished dev [unoptimized + debuginfo] target(s) in 0.13s + Running `target/debug/kagami genesis` +warning: enum variant is more than three times larger (271 bytes) than the next largest + --> data_model/src/lib.rs:342:5 + | +342 | Block(BlockValue), + | ^^^^^^^^^^^^^^^^^ + | + = note: requested on the command line with `-W variant-size-differences` + +warning: `iroha_data_model` (lib) generated 1 warning +warning: `iroha_data_model` (lib) generated 1 warning (1 duplicate) +warning: `iroha_data_model` (lib test) generated 1 warning (1 duplicate) + Finished dev [unoptimized + debuginfo] target(s) in 0.28s + Compiling socket2 v0.4.4 + Compiling int_traits v0.1.1 + Compiling scoped-tls v1.0.0 + Compiling amcl v0.2.0 + Compiling arrayref v0.3.6 + Compiling regex-syntax v0.6.26 + Compiling owo-colors v1.3.0 + Compiling indenter v0.3.3 +error[E0583]: file not found for module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:124:1 + | +124 | mod sys; + | ^^^^^^^^ + | + = help: to create the module `sys`, create file "/Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sys.rs" or "/Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sys/mod.rs" + +error: Socket2 doesn't support the compile target + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:127:1 + | +127 | compile_error!("Socket2 doesn't support the compile target"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0432]: unresolved imports `crate::sys::sa_family_t`, `crate::sys::sockaddr`, `crate::sys::sockaddr_in`, `crate::sys::sockaddr_in6`, `crate::sys::sockaddr_storage`, `crate::sys::socklen_t`, `crate::sys::AF_INET`, `crate::sys::AF_INET6` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:6:5 + | +6 | sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, socklen_t, AF_INET, + | ^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^ no `AF_INET` in `sys` + | | | | | | | + | | | | | | no `socklen_t` in `sys` + | | | | | no `sockaddr_storage` in `sys` + | | | | no `sockaddr_in6` in `sys` + | | | no `sockaddr_in` in `sys` + | | no `sockaddr` in `sys` + | no `sa_family_t` in `sys` +7 | AF_INET6, + | ^^^^^^^^ no `AF_INET6` in `sys` + +error[E0432]: unresolved imports `crate::sys::c_int`, `crate::sys::getsockopt`, `crate::sys::setsockopt`, `crate::sys::Bool` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:21:24 + | +21 | use crate::sys::{self, c_int, getsockopt, setsockopt, Bool}; + | ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ ^^^^ no `Bool` in `sys` + | | | | + | | | no `setsockopt` in `sys` + | | no `getsockopt` in `sys` + | no `c_int` in `sys` + +error[E0432]: unresolved import `sys::c_int` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:129:5 + | +129 | use sys::c_int; + | ^^^^^^^^^^ no `c_int` in `sys` + + Compiling rustc-hash v1.1.0 +error[E0433]: failed to resolve: could not find `MaybeUninitSlice` in `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:307:31 + | +307 | MaybeUninitSlice(sys::MaybeUninitSlice::new(buf)) + | ^^^^^^^^^^^^^^^^ could not find `MaybeUninitSlice` in `sys` + +error[E0425]: cannot find function `from_in_addr` in module `crate::sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:169:34 + | +169 | let ip = crate::sys::from_in_addr(addr.sin_addr); + | ^^^^^^^^^^^^ not found in `crate::sys` + +error[E0425]: cannot find function `from_in6_addr` in module `crate::sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:176:34 + | +176 | let ip = crate::sys::from_in6_addr(addr.sin6_addr); + | ^^^^^^^^^^^^^ not found in `crate::sys` + +error[E0425]: cannot find function `to_in_addr` in module `crate::sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:227:35 + | +227 | sin_addr: crate::sys::to_in_addr(addr.ip()), + | ^^^^^^^^^^ not found in `crate::sys` + +error[E0425]: cannot find function `to_in6_addr` in module `crate::sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:262:36 + | +262 | sin6_addr: crate::sys::to_in6_addr(addr.ip()), + | ^^^^^^^^^^^ not found in `crate::sys` + +error[E0412]: cannot find type `Socket` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:86:38 + | +86 | pub(crate) fn from_raw(raw: sys::Socket) -> Socket { + | ^^^^^^ not found in `sys` + | +help: consider importing this struct + | +9 | use crate::Socket; + | + +error[E0425]: cannot find function `socket_from_raw` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:104:22 + | +104 | sys::socket_from_raw(raw) + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0412]: cannot find type `Socket` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:109:41 + | +109 | pub(crate) fn as_raw(&self) -> sys::Socket { + | ^^^^^^ not found in `sys` + | +help: consider importing this struct + | +9 | use crate::Socket; + | + +error[E0425]: cannot find function `socket_as_raw` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:110:14 + | +110 | sys::socket_as_raw(&self.inner) + | ^^^^^^^^^^^^^ not found in `sys` + +error[E0412]: cannot find type `Socket` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:113:42 + | +113 | pub(crate) fn into_raw(self) -> sys::Socket { + | ^^^^^^ not found in `sys` + | +help: consider importing this struct + | +9 | use crate::Socket; + | + +error[E0425]: cannot find function `socket_into_raw` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:114:14 + | +114 | sys::socket_into_raw(self.inner) + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `socket` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:138:14 + | +138 | sys::socket(domain.0, ty.0, protocol).map(Socket::from_raw) + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find function `bind` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:181:14 + | +181 | sys::bind(self.as_raw(), address) + | ^^^^ not found in `sys` + +error[E0425]: cannot find function `connect` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:199:14 + | +199 | sys::connect(self.as_raw(), address) + | ^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `poll_connect` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:234:14 + | +234 | sys::poll_connect(self, timeout) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `listen` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:246:14 + | +246 | sys::listen(self.as_raw(), backlog) + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find function `accept` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:297:14 + | +297 | sys::accept(self.as_raw()).map(|(inner, addr)| (Socket::from_raw(inner), addr)) + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find function `getsockname` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:309:14 + | +309 | sys::getsockname(self.as_raw()) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `getpeername` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:320:14 + | +320 | sys::getpeername(self.as_raw()) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:326:58 + | +326 | unsafe { getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_TYPE).map(Type) } + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_TYPE` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:326:75 + | +326 | unsafe { getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_TYPE).map(Type) } + | ^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `try_clone` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:343:14 + | +343 | sys::try_clone(self.as_raw()).map(Socket::from_raw) + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `set_nonblocking` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:355:14 + | +355 | sys::set_nonblocking(self.as_raw(), nonblocking) + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `shutdown` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:363:14 + | +363 | sys::shutdown(self.as_raw(), how) + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `MSG_OOB` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:398:40 + | +398 | self.recv_with_flags(buf, sys::MSG_OOB) + | ^^^^^^^ not found in `sys` + +error[E0412]: cannot find type `c_int` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:408:21 + | +408 | flags: sys::c_int, + | ^^^^^ not found in `sys` + | +help: consider importing this type alias + | +9 | use std::os::raw::c_int; + | + +error[E0425]: cannot find function `recv` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:410:14 + | +410 | sys::recv(self.as_raw(), buf, flags) + | ^^^^ not found in `sys` + +error[E0425]: cannot find function `recv_vectored` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:465:14 + | +465 | sys::recv_vectored(self.as_raw(), bufs, flags) + | ^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `MSG_PEEK` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:482:40 + | +482 | self.recv_with_flags(buf, sys::MSG_PEEK) + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `recv_from` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:507:14 + | +507 | sys::recv_from(self.as_raw(), buf, flags) + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `recv_from_vectored` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:549:14 + | +549 | sys::recv_from_vectored(self.as_raw(), bufs, flags) + | ^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `MSG_PEEK` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:567:45 + | +567 | self.recv_from_with_flags(buf, sys::MSG_PEEK) + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `send` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:585:14 + | +585 | sys::send(self.as_raw(), buf, flags) + | ^^^^ not found in `sys` + +error[E0425]: cannot find function `send_vectored` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:606:14 + | +606 | sys::send_vectored(self.as_raw(), bufs, flags) + | ^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `MSG_OOB` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:617:40 + | +617 | self.send_with_flags(buf, sys::MSG_OOB) + | ^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `send_to` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:638:14 + | +638 | sys::send_to(self.as_raw(), buf, addr, flags) + | ^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `send_to_vectored` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:661:14 + | +661 | sys::send_to_vectored(self.as_raw(), bufs, addr, flags) + | ^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:748:53 + | +748 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_BROADCAST) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_BROADCAST` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:748:70 + | +748 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_BROADCAST) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:761:22 + | +761 | sys::SOL_SOCKET, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_BROADCAST` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:762:22 + | +762 | sys::SO_BROADCAST, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:774:64 + | +774 | match unsafe { getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_ERROR) } { + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_ERROR` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:774:81 + | +774 | match unsafe { getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_ERROR) } { + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:788:52 + | +788 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_KEEPALIVE) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_KEEPALIVE` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:788:69 + | +788 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_KEEPALIVE) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:800:22 + | +800 | sys::SOL_SOCKET, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_KEEPALIVE` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:801:22 + | +801 | sys::SO_KEEPALIVE, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0412]: cannot find type `linger` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:814:31 + | +814 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER) + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:814:59 + | +814 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_LINGER` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:814:76 + | +814 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER) + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:835:49 + | +835 | unsafe { setsockopt(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER, linger) } + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_LINGER` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:835:66 + | +835 | unsafe { setsockopt(self.as_raw(), sys::SOL_SOCKET, sys::SO_LINGER, linger) } + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:847:53 + | +847 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_OOBINLINE) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_OOBINLINE` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:847:70 + | +847 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_OOBINLINE) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:864:22 + | +864 | sys::SOL_SOCKET, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_OOBINLINE` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:865:22 + | +865 | sys::SO_OOBINLINE, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:878:53 + | +878 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVBUF) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_RCVBUF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:878:70 + | +878 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVBUF) + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:891:22 + | +891 | sys::SOL_SOCKET, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_RCVBUF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:892:22 + | +892 | sys::SO_RCVBUF, + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `timeout_opt` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:903:14 + | +903 | sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:903:46 + | +903 | sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_RCVTIMEO` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:903:63 + | +903 | sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `set_timeout_opt` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:911:14 + | +911 | sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO, duration) + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:911:50 + | +911 | sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO, duration) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_RCVTIMEO` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:911:67 + | +911 | sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_RCVTIMEO, duration) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:921:53 + | +921 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_REUSEADDR) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_REUSEADDR` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:921:70 + | +921 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_REUSEADDR) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:935:22 + | +935 | sys::SOL_SOCKET, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_REUSEADDR` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:936:22 + | +936 | sys::SO_REUSEADDR, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:949:53 + | +949 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDBUF) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_SNDBUF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:949:70 + | +949 | getsockopt::(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDBUF) + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:962:22 + | +962 | sys::SOL_SOCKET, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_SNDBUF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:963:22 + | +963 | sys::SO_SNDBUF, + | ^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `timeout_opt` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:974:14 + | +974 | sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:974:46 + | +974 | sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_SNDTIMEO` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:974:63 + | +974 | sys::timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `set_timeout_opt` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:982:14 + | +982 | sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO, duration) + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOL_SOCKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:982:50 + | +982 | sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO, duration) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SO_SNDTIMEO` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:982:67 + | +982 | sys::set_timeout_opt(self.as_raw(), sys::SOL_SOCKET, sys::SO_SNDTIMEO, duration) + | ^^^^^^^^^^^ not found in `sys` + +error[E0412]: cannot find type `linger` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:986:29 + | +986 | fn from_linger(linger: sys::linger) -> Option { + | ^^^^^^ not found in `sys` + +error[E0412]: cannot find type `linger` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:994:52 + | +994 | fn into_linger(duration: Option) -> sys::linger { + | ^^^^^^ not found in `sys` + +error[E0422]: cannot find struct, variant or union type `linger` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:996:32 + | +996 | Some(duration) => sys::linger { + | ^^^^^^ not found in `sys` + +error[E0422]: cannot find struct, variant or union type `linger` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1000:22 + | +1000 | None => sys::linger { + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1022:53 + | +1022 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_HDRINCL) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_HDRINCL` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1022:70 + | +1022 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_HDRINCL) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1044:22 + | +1044 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_HDRINCL` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1045:22 + | +1045 | sys::IP_HDRINCL, + | ^^^^^^^^^^ not found in `sys` + +error[E0422]: cannot find struct, variant or union type `IpMreq` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1101:25 + | +1101 | let mreq = sys::IpMreq { + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1102:33 + | +1102 | imr_multiaddr: sys::to_in_addr(multiaddr), + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1103:33 + | +1103 | imr_interface: sys::to_in_addr(interface), + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1105:49 + | +1105 | unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_ADD_MEMBERSHIP, mreq) } + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_ADD_MEMBERSHIP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1105:66 + | +1105 | unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_ADD_MEMBERSHIP, mreq) } + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0422]: cannot find struct, variant or union type `IpMreq` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1114:25 + | +1114 | let mreq = sys::IpMreq { + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1115:33 + | +1115 | imr_multiaddr: sys::to_in_addr(multiaddr), + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1116:33 + | +1116 | imr_interface: sys::to_in_addr(interface), + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1121:22 + | +1121 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_DROP_MEMBERSHIP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1122:22 + | +1122 | sys::IP_DROP_MEMBERSHIP, + | ^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_mreqn` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1146:26 + | +1146 | let mreqn = sys::to_mreqn(multiaddr, interface); + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1150:22 + | +1150 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_ADD_MEMBERSHIP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1151:22 + | +1151 | sys::IP_ADD_MEMBERSHIP, + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_mreqn` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1174:26 + | +1174 | let mreqn = sys::to_mreqn(multiaddr, interface); + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1178:22 + | +1178 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_DROP_MEMBERSHIP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1179:22 + | +1179 | sys::IP_DROP_MEMBERSHIP, + | ^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1192:44 + | +1192 | getsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_IF).map(sys::from_in_addr) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_MULTICAST_IF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1192:61 + | +1192 | getsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_IF).map(sys::from_in_addr) + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `from_in_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1192:87 + | +1192 | getsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_IF).map(sys::from_in_addr) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1200:30 + | +1200 | let interface = sys::to_in_addr(interface); + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1204:22 + | +1204 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_MULTICAST_IF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1205:22 + | +1205 | sys::IP_MULTICAST_IF, + | ^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1218:53 + | +1218 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_LOOP) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_MULTICAST_LOOP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1218:70 + | +1218 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_LOOP) + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1231:22 + | +1231 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_MULTICAST_LOOP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1232:22 + | +1232 | sys::IP_MULTICAST_LOOP, + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1245:53 + | +1245 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_TTL) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_MULTICAST_TTL` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1245:70 + | +1245 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_MULTICAST_TTL) + | ^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1261:22 + | +1261 | sys::IPPROTO_IP, + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_MULTICAST_TTL` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1262:22 + | +1262 | sys::IP_MULTICAST_TTL, + | ^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1275:53 + | +1275 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_TTL).map(|ttl| ttl as u32) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_TTL` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1275:70 + | +1275 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_TTL).map(|ttl| ttl as u32) + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1284:49 + | +1284 | unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TTL, ttl as c_int) } + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_TTL` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1284:66 + | +1284 | unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TTL, ttl as c_int) } + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1301:49 + | +1301 | unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) } + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_TOS` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1301:66 + | +1301 | unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) } + | ^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1320:53 + | +1320 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32) + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IP_TOS` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1320:70 + | +1320 | getsockopt::(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32) + | ^^^^^^ not found in `sys` + +error[E0422]: cannot find struct, variant or union type `Ipv6Mreq` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1339:25 + | +1339 | let mreq = sys::Ipv6Mreq { + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in6_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1340:36 + | +1340 | ipv6mr_multiaddr: sys::to_in6_addr(multiaddr), + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1347:22 + | +1347 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_ADD_MEMBERSHIP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1348:22 + | +1348 | sys::IPV6_ADD_MEMBERSHIP, + | ^^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0422]: cannot find struct, variant or union type `Ipv6Mreq` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1362:25 + | +1362 | let mreq = sys::Ipv6Mreq { + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `to_in6_addr` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1363:36 + | +1363 | ipv6mr_multiaddr: sys::to_in6_addr(multiaddr), + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1370:22 + | +1370 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_DROP_MEMBERSHIP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1371:22 + | +1371 | sys::IPV6_DROP_MEMBERSHIP, + | ^^^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1384:53 + | +1384 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_HOPS) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_MULTICAST_HOPS` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1384:72 + | +1384 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_HOPS) + | ^^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1398:22 + | +1398 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_MULTICAST_HOPS` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1399:22 + | +1399 | sys::IPV6_MULTICAST_HOPS, + | ^^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1412:53 + | +1412 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_IF) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_MULTICAST_IF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1412:72 + | +1412 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_IF) + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1426:22 + | +1426 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_MULTICAST_IF` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1427:22 + | +1427 | sys::IPV6_MULTICAST_IF, + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1440:53 + | +1440 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_LOOP) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_MULTICAST_LOOP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1440:72 + | +1440 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_MULTICAST_LOOP) + | ^^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1453:22 + | +1453 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_MULTICAST_LOOP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1454:22 + | +1454 | sys::IPV6_MULTICAST_LOOP, + | ^^^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1465:53 + | +1465 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_UNICAST_HOPS) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_UNICAST_HOPS` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1465:72 + | +1465 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_UNICAST_HOPS) + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1477:22 + | +1477 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_UNICAST_HOPS` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1478:22 + | +1478 | sys::IPV6_UNICAST_HOPS, + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1491:53 + | +1491 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_V6ONLY) + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_V6ONLY` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1491:72 + | +1491 | getsockopt::(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_V6ONLY) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_IPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1508:22 + | +1508 | sys::IPPROTO_IPV6, + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPV6_V6ONLY` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1509:22 + | +1509 | sys::IPV6_V6ONLY, + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `keepalive_time` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1541:14 + | +1541 | sys::keepalive_time(self.as_raw()) + | ^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find function `set_tcp_keepalive` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1668:14 + | +1668 | sys::set_tcp_keepalive(self.as_raw(), params) + | ^^^^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_TCP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1678:52 + | +1678 | getsockopt::(self.as_raw(), sys::IPPROTO_TCP, sys::TCP_NODELAY) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `TCP_NODELAY` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1678:70 + | +1678 | getsockopt::(self.as_raw(), sys::IPPROTO_TCP, sys::TCP_NODELAY) + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_TCP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1694:22 + | +1694 | sys::IPPROTO_TCP, + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `TCP_NODELAY` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1695:22 + | +1695 | sys::TCP_NODELAY, + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `AF_INET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:158:42 + | +158 | pub const IPV4: Domain = Domain(sys::AF_INET); + | ^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `AF_INET6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:161:42 + | +161 | pub const IPV6: Domain = Domain(sys::AF_INET6); + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOCK_STREAM` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:200:40 + | +200 | pub const STREAM: Type = Type(sys::SOCK_STREAM); + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOCK_DGRAM` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:205:39 + | +205 | pub const DGRAM: Type = Type(sys::SOCK_DGRAM); + | ^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOCK_SEQPACKET` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:210:43 + | +210 | pub const SEQPACKET: Type = Type(sys::SOCK_SEQPACKET); + | ^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `SOCK_RAW` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:215:37 + | +215 | pub const RAW: Type = Type(sys::SOCK_RAW); + | ^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_ICMP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:242:48 + | +242 | pub const ICMPV4: Protocol = Protocol(sys::IPPROTO_ICMP); + | ^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_ICMPV6` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:245:48 + | +245 | pub const ICMPV6: Protocol = Protocol(sys::IPPROTO_ICMPV6); + | ^^^^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_TCP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:248:45 + | +248 | pub const TCP: Protocol = Protocol(sys::IPPROTO_TCP); + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `IPPROTO_UDP` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:251:45 + | +251 | pub const UDP: Protocol = Protocol(sys::IPPROTO_UDP); + | ^^^^^^^^^^^ not found in `sys` + +error[E0425]: cannot find value `MSG_TRUNC` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:284:23 + | +284 | self.0 & sys::MSG_TRUNC != 0 + | ^^^^^^^^^ not found in `sys` + +error[E0412]: cannot find type `MaybeUninitSlice` in module `sys` + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:292:38 + | +292 | pub struct MaybeUninitSlice<'a>(sys::MaybeUninitSlice<'a>); + | ^^^^^^^^^^^^^^^^ not found in `sys` + + Compiling ansi_term v0.12.1 + Compiling wasmparser v0.83.0 +error[E0599]: no method named `map` found for enum `Result` in the current scope + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:129:46 + | +129 | init(storage.as_mut_ptr(), &mut len).map(|res| { + | ^^^ method not found in `Result` + | + = note: the method was found for + - `Result` + +error[E0061]: this function takes 4 arguments but 3 arguments were supplied + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/sockaddr.rs:178:33 + | +178 | Some(SocketAddr::V6(SocketAddrV6::new( + | ^^^^^^^^^^^^^^^^^ expected 4 arguments +179 | ip, + | -- +180 | port, + | ---- +181 | addr.sin6_flowinfo, + | ------------------ supplied 3 arguments + | +note: associated function defined here + --> /Users/erigara/.rustup/toolchains/1.60-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/net/addr.rs:380:12 + | +380 | pub fn new(ip: Ipv6Addr, port: u16, flowinfo: u32, scope_id: u32) -> SocketAddrV6 { + | ^^^ + + Compiling cranelift-codegen-shared v0.83.0 +error[E0308]: mismatched types + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1776:23 + | +1776 | from!(net::TcpStream, Socket); + | ^^^^^^ expected struct `Socket`, found `()` + | + ::: /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:104:16 + | +104 | fn from(socket: $from) -> $for { + | ---- implicitly returns `()` as its body has no tail or `return` expression + +error[E0308]: mismatched types + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1777:25 + | +1777 | from!(net::TcpListener, Socket); + | ^^^^^^ expected struct `Socket`, found `()` + | + ::: /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:104:16 + | +104 | fn from(socket: $from) -> $for { + | ---- implicitly returns `()` as its body has no tail or `return` expression + +error[E0308]: mismatched types + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1778:23 + | +1778 | from!(net::UdpSocket, Socket); + | ^^^^^^ expected struct `Socket`, found `()` + | + ::: /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:104:16 + | +104 | fn from(socket: $from) -> $for { + | ---- implicitly returns `()` as its body has no tail or `return` expression + +error[E0308]: mismatched types + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1779:15 + | +1779 | from!(Socket, net::TcpStream); + | ^^^^^^^^^^^^^^ expected struct `TcpStream`, found `()` + | + ::: /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:104:16 + | +104 | fn from(socket: $from) -> $for { + | ---- implicitly returns `()` as its body has no tail or `return` expression + +error[E0308]: mismatched types + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1780:15 + | +1780 | from!(Socket, net::TcpListener); + | ^^^^^^^^^^^^^^^^ expected struct `TcpListener`, found `()` + | + ::: /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:104:16 + | +104 | fn from(socket: $from) -> $for { + | ---- implicitly returns `()` as its body has no tail or `return` expression + +error[E0308]: mismatched types + --> /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/socket.rs:1781:15 + | +1781 | from!(Socket, net::UdpSocket); + | ^^^^^^^^^^^^^^ expected struct `UdpSocket`, found `()` + | + ::: /Users/erigara/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.4/src/lib.rs:104:16 + | +104 | fn from(socket: $from) -> $for { + | ---- implicitly returns `()` as its body has no tail or `return` expression + +Some errors have detailed explanations: E0061, E0308, E0412, E0422, E0425, E0432, E0433, E0583, E0599. +For more information about an error, try `rustc --explain E0061`. +error: could not compile `socket2` due to 185 previous errors +warning: build failed, waiting for other jobs to finish... +error: build failed diff --git a/telemetry/Cargo.toml b/telemetry/Cargo.toml index 981e18c6dfe..bd55b9b558f 100644 --- a/telemetry/Cargo.toml +++ b/telemetry/Cargo.toml @@ -8,12 +8,13 @@ build = "build.rs" [features] # Support developer-specific telemetry. # Should not be enabled on production builds. -dev-telemetry = [] +dev-telemetry = ["iroha_data_model/dev-telemetry"] # Export Prometheus metrics. See https://prometheus.io/. metric-instrumentation = [] [dependencies] iroha_config = { version = "=2.0.0-pre-rc.5", path = "../config" } +iroha_data_model = { version = "=2.0.0-pre-rc.5", path = "../data_model" } iroha_logger = { version = "=2.0.0-pre-rc.5", path = "../logger" } iroha_futures = { version = "=2.0.0-pre-rc.5", path = "../futures", features = ["telemetry"] } iroha_telemetry_derive = { version = "=2.0.0-pre-rc.5", path = "derive" } diff --git a/telemetry/src/config.rs b/telemetry/src/config.rs index 253f8d4fafc..40f0d629393 100644 --- a/telemetry/src/config.rs +++ b/telemetry/src/config.rs @@ -1,17 +1,19 @@ #[cfg(feature = "dev-telemetry")] use std::path::PathBuf; -use iroha_config::derive::Configurable; +use iroha_config::derive::{Configurable, View}; +use iroha_data_model::config::telemetry::Configuration as PublicConfiguration; use serde::{Deserialize, Serialize}; use url::Url; use crate::retry_period::RetryPeriod; /// Configuration parameters container -#[derive(Clone, Deserialize, Serialize, Debug, Configurable, PartialEq, Eq)] +#[derive(Clone, Deserialize, Serialize, Debug, Configurable, PartialEq, Eq, View)] #[serde(rename_all = "UPPERCASE")] #[serde(default)] #[config(env_prefix = "TELEMETRY_")] +#[view(PublicConfiguration)] pub struct Configuration { /// The node's name to be seen on the telemetry #[config(serde_as_str)]