NetworkArgs in reth_node_core::args - Rust

Struct NetworkArgs 

Source

pub struct NetworkArgs {
Show 32 fields pub discovery: DiscoveryArgs, pub trusted_peers: Vec<TrustedPeer>, pub trusted_only: bool, pub bootnodes: Option<Vec<TrustedPeer>>, pub dns_retries: usize, pub peers_file: Option<PathBuf>, pub identity: String, pub p2p_secret_key: Option<PathBuf>, pub p2p_secret_key_hex: Option<B256>, pub no_persist_peers: bool, pub nat: NatResolver, pub addr: IpAddr, pub port: u16, pub max_outbound_peers: Option<usize>, pub max_inbound_peers: Option<usize>, pub max_peers: Option<usize>, pub max_concurrent_tx_requests: u32, pub max_concurrent_tx_requests_per_peer: u8, pub max_seen_tx_history: u32, pub max_pending_pool_imports: usize, pub soft_limit_byte_size_pooled_transactions_response: usize, pub soft_limit_byte_size_pooled_transactions_response_on_pack_request: usize, pub max_capacity_cache_txns_pending_fetch: u32, pub net_if: Option<String>, pub tx_propagation_policy: TransactionPropagationKind, pub tx_ingress_policy: TransactionIngressPolicy, pub disable_tx_gossip: bool, pub propagation_mode: TransactionPropagationMode, pub required_block_hashes: Vec<BlockNumHash>, pub network_id: Option<u64>, pub netrestrict: Option<String>, pub enforce_enr_fork_id: bool,
}
Expand description

Parameters for configuring the network more granularity via CLI

Arguments to setup discovery service.

Comma separated enode URLs of trusted peers for P2P connections.

–trusted-peers enode://abcd@192.168.0.1:30303

Connect to or accept from trusted peers only

Comma separated enode URLs for P2P discovery bootstrap.

Will fall back to a network-specific default if not specified.

Amount of DNS resolution requests retries to perform when peering.

The path to the known peers file. Connected peers are dumped to this file on nodes shutdown, and read on startup. Cannot be used with --no-persist-peers.

Custom node identity

Secret key to use for this node.

This will also deterministically set the peer ID. If not specified, it will be set in the data dir for the chain being used.

Hex encoded secret key to use for this node.

This will also deterministically set the peer ID. Cannot be used together with --p2p-secret-key.

Do not persist peers.

NAT resolution method (any|none|upnp|publicip|extip:<IP>)

Network listening address

Network listening port

Maximum number of outbound peers. default: 100

Maximum number of inbound peers. default: 30

Maximum number of total peers (inbound + outbound).

Splits peers using approximately 2:1 inbound:outbound ratio. Cannot be used together with --max-outbound-peers or --max-inbound-peers.

Max concurrent GetPooledTransactions requests.

Max concurrent GetPooledTransactions requests per peer.

Max number of seen transactions to remember per peer.

Default is 320 transaction hashes.

Max number of transactions to import concurrently.

Experimental, for usage in research. Sets the max accumulated byte size of transactions to pack in one response. Spec’d at 2MiB.

Experimental, for usage in research. Sets the max accumulated byte size of transactions to request in one request.

Since RLPx protocol version 68, the byte size of a transaction is shared as metadata in a transaction announcement (see RLPx specs). This allows a node to request a specific size response.

By default, nodes request only 128 KiB worth of transactions, but should a peer request more, up to 2 MiB, a node will answer with more than 128 KiB.

Default is 128 KiB.

Max capacity of cache of hashes for transactions pending fetch.

Name of network interface used to communicate with peers.

If flag is set, but no value is passed, the default interface for docker eth0 is tried.

Transaction Propagation Policy

The policy determines which peers transactions are gossiped to.

Transaction ingress policy

Determines which peers’ transactions are accepted over P2P.

Disable transaction pool gossip

Disables gossiping of transactions in the mempool to peers. This can be omitted for personal nodes, though providers should always opt to enable this flag.

Sets the transaction propagation mode by determining how new pending transactions are propagated to other peers in full.

Examples: sqrt, all, max:10

Comma separated list of required block hashes or block number=hash pairs. Peers that don’t have these blocks will be filtered out. Format: hash or block_number=hash (e.g., 23115201=0x1234…)

Optional network ID to override the chain specification’s network ID for P2P connections

Restrict network communication to the given IP networks (CIDR masks).

Comma separated list of CIDR network specifications. Only peers with IP addresses within these ranges will be allowed to connect.

Example: –netrestrict “192.168.0.0/16,10.0.0.0/8”

Enforce EIP-868 ENR fork ID validation for discovered peers.

When enabled, peers discovered without a confirmed fork ID are not added to the peer set until their fork ID is verified via EIP-868 ENR request. This filters out peers from other networks that pollute the discovery table.

Source§
Source

Returns the resolved IP address.

Source

Returns the resolved bootnodes if any are provided.

Source

Returns the max inbound peers (2:1 ratio).

Source

Returns the max outbound peers (1:2 ratio).

Source

Configures and returns a TransactionsManagerConfig based on the current settings.

Source

Build a NetworkConfigBuilder from a Config and a EthChainSpec, in addition to the values in this option struct.

The default_peers_file will be used as the default location to store the persistent peers file if no_persist_peers is false, and there is no provided peers_file.

Configured Bootnodes are prioritized, if unset, the chain spec bootnodes are used Priority order for bootnodes configuration:

  1. –bootnodes flag
  2. Network preset flags (e.g. –holesky)
  3. default to mainnet nodes
Source

If no_persist_peers is false then this returns the path to the persistent peers file path.

Source
Source

Sets the p2p port to zero, to allow the OS to assign a random unused port when the network components bind to a socket.

Source

Sets the p2p and discovery ports to zero, allowing the OD to assign a random unused port when network components bind to sockets.

Source
Source

Change networking port numbers based on the instance number, if provided. Ports are updated to previous_value + instance - 1

§Panics

Warning: if instance is zero in debug mode, this will panic.

Source

Resolve all trusted peers at once

Source

Load the p2p secret key from the provided options.

If p2p_secret_key_hex is provided, it will be used directly. If p2p_secret_key is provided, it will be loaded from the file. If neither is provided, the default_secret_key_path will be used.

Source

Creates an IP filter from the netrestrict argument.

Returns an error if the CIDR format is invalid.

Source§
Source§

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments

Source§

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more

Source§

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more

Source§
Source§
Source§
Source§
Source§

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more

Source§

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more

Source§

Assign values from ArgMatches to self.

Source§

Assign values from ArgMatches to self.

Source§
Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

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

Source§
Source§

§
§
§
§
§
§
§

Source§
Source§
Source§
Source§
Source§

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)

Performs copy-assignment from self to dest. Read more

§
Source§

Source§

§
§

Compare self to key and return true if they are equal.

§
§

Checks if this value is equivalent to the given key. Read more

§
§

Checks if this value is equivalent to the given key. Read more

§
§

Checks if this value is equivalent to the given key. Read more

§
§

Causes self to use its Binary implementation when Debug-formatted.

§

Causes self to use its Display implementation when Debug-formatted.

§

Causes self to use its LowerExp implementation when Debug-formatted.

§

Causes self to use its LowerHex implementation when Debug-formatted.

§

Causes self to use its Octal implementation when Debug-formatted.

§

Causes self to use its Pointer implementation when Debug-formatted.

§

Causes self to use its UpperExp implementation when Debug-formatted.

§

Causes self to use its UpperHex implementation when Debug-formatted.

§

Formats each item in a sequence. Read more

Source§
Source§

Returns the argument unchanged.

§
§

Builds a [TxEnv] from a transaction and a sender address.

§
§

Builds a [TxEnv] from a transaction, its sender, and encoded transaction bytes.

§
§

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

§

Attaches the current Context to this type, returning a WithContext wrapper. Read more

§
§

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more

§

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

Source§
Source§

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

Source§

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

Source§
Source§

Calls U::from(self).

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

Source§
§
§

Wrap the input message T in a tonic::Request

§
§

Applies the layer to a service and wraps it in [Layered].

§
§

Pipes by value. This is generally the method you want to use. Read more

§

Borrows self and passes that borrow into the pipe function. Read more

§

Mutably borrows self and passes that borrow into the pipe function. Read more

§

Borrows self, then passes self.borrow() into the pipe function. Read more

§

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

§

Borrows self, then passes self.as_ref() into the pipe function.

§

Mutably borrows self, then passes self.as_mut() into the pipe function.

§

Borrows self, then passes self.deref() into the pipe function.

§

Mutably borrows self, then passes self.deref_mut() into the pipe function.

§
§

The alignment of pointer.

§

The type for initializers.

§

Initializes a with the given initializer. Read more

§

Dereferences the given pointer. Read more

§

Mutably dereferences the given pointer. Read more

§

Drops the object pointed to by the given pointer. Read more

§
§

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more

§

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more

Source§
§

Available on crate feature propagate-header only.

Propagate a header from the request to the response. Read more

§

Available on crate feature add-extension only.

§

Available on crate feature map-request-body only.

Apply a transformation to the request body. Read more

§

Available on crate feature map-response-body only.

Apply a transformation to the response body. Read more

§

Available on crate features compression-br or compression-deflate or compression-gzip or compression-zstd only.

Compresses response bodies. Read more

§

Available on crate features decompression-br or decompression-deflate or decompression-gzip or decompression-zstd only.

Decompress response bodies. Read more

§

Available on crate feature trace only.

High level tracing that classifies responses using HTTP status codes. Read more

§

Available on crate feature trace only.

High level tracing that classifies responses using gRPC headers. Read more

§

Available on crate feature follow-redirect only.

Available on crate feature sensitive-headers only.

Available on crate feature sensitive-headers only.

Available on crate feature sensitive-headers only.

Available on crate feature set-header only.

Insert a header into the request. Read more

Available on crate feature set-header only.

Append a header into the request. Read more

Available on crate feature set-header only.

Insert a header into the request, if the header is not already present. Read more

Available on crate feature set-header only.

Insert a header into the response. Read more

Available on crate feature set-header only.

Append a header into the response. Read more

Available on crate feature set-header only.

Insert a header into the response, if the header is not already present. Read more

§

Available on crate feature request-id only.

Add request id header and extension. Read more

§

Available on crate feature request-id only.

Add request id header and extension, using x-request-id as the header name. Read more

§

Available on crate feature request-id only.

Propgate request ids from requests to responses. Read more

§

Available on crate feature request-id only.

Propgate request ids from requests to responses, using x-request-id as the header name. Read more

§

Available on crate feature catch-panic only.

Catch panics and convert them into 500 Internal Server responses. Read more

§

Available on crate feature limit only.

Intercept requests with over-sized payloads and convert them into 413 Payload Too Large responses. Read more

§

Available on crate feature normalize-path only.

Remove trailing slashes from paths. Read more

§

Available on crate feature normalize-path only.

Append trailing slash to paths. Read more

§
§

Immutable access to a value. Read more

§
§

Immutable access to the Borrow<B> of a value. Read more

§

Mutable access to the BorrowMut<B> of a value. Read more

§

Immutable access to the AsRef<R> view of a value. Read more

§

Mutable access to the AsMut<R> view of a value. Read more

§

Immutable access to the Deref::Target of a value. Read more

§

Mutable access to the Deref::Target of a value. Read more

§

Calls .tap() only in debug builds, and is erased in release builds.

§

Calls .tap_mut() only in debug builds, and is erased in release builds.

§

Calls .tap_borrow() only in debug builds, and is erased in release builds.

§

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.

§

Calls .tap_ref() only in debug builds, and is erased in release builds.

§

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.

§

Calls .tap_deref() only in debug builds, and is erased in release builds.

§

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.

Source§
Source§

The resulting type after obtaining ownership.

Source§

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

Source§

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

§
§

Clones self, possibly returning an error.

§
§

Attempts to convert self into T using TryInto<T>. Read more

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

Source§
Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

§

§

§
Source§
§
§
§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 488 bytes