Settings
This section explains the various options available for configuration when creating the Discv5 protocol.
Please note the customization and settings of mentioned options are optional and only recommended for certain scenarios, as it may affect the performance of the application during runtime.
Connection Options
ConnectionOptions
allows you to adjust settings related to the connection manager:
Port
: Specifies the port for the local node. Default value is9000
millisecondsIpAddress
: Indicates the IP address of the local machine on which the node is runningReceiveTimeoutMs
: Specifies the timeout in milliseconds for receiving a response to a request message. Default value is1000
millisecondsRequestTimeoutMs
: Specifies the timeout in milliseconds to remove pending messages for which a response has not been received. Default value is2000
millisecondsCheckPendingRequestsDelayMs
: Specifies the time interval in milliseconds to check for pending messages. Default value is500
millisecondsRemoveCompletedRequestsDelayMs
: Specifies the time interval in milliseconds for the removal of completed requests. Default value is1000
milliseconds
Example
Session Options
SessionOptions
allows you to adjust settings related to the session manager:
Signer
: The signer for the identity scheme (v4 as per the ENR Specification)Verifier
: The verifier for the identity scheme (v4 as per the ENR Specification)SessionKeys
: The private keys used for securing the sessionSessionCacheSize
: Specifies the size of the cache for storing session objects. Default value is1000
Example
Table Options
TableOptions
allows you to configure the settings related to the node table manager:
PingIntervalMilliseconds
: Specifies the time interval in milliseconds at which ping messages are sent to active peers. Default value is5000
RefreshIntervalMilliseconds
: Specifies the time interval in milliseconds at which the node table is refreshed by performing a lookup to ensure that the knowledge of active peers is up-to-date. Default value is300000
LookupTimeoutMilliseconds
: Specifies the maximum time in milliseconds to perform a lookup operation. Default value is10000
ConcurrencyParameter
: Specifies the concurrency factor (k) when performing lookups. This is the number of nodes that are queried eachFINDNODE
request during the lookup. Default value is3
LookupParallelism
: Specifies the maximum number of lookup operations (path buckets) that can be performed in parallel while maintaining the concurrency parameter (k). Default value is2
.MaxAllowedFailures
: Specifies the maximum number of allowed unsuccessful interaction attempts with a peer before it is considered as non-responsive and added to the blacklisting mechanism. Default value is3
BootstrapEnrs
: Specifies an array of ENRs (Ethereum Node Record) for bootstrap peers.
Last updated