mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: raise fd limit of the binary (#668)
* raise fd limit of the binary * Remove tracing and return error * Ignore errors
This commit is contained in:
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -1437,6 +1437,15 @@ dependencies = [
|
||||
"instant",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fdlimit"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.12.1"
|
||||
@ -3415,6 +3424,7 @@ dependencies = [
|
||||
"confy",
|
||||
"dirs-next",
|
||||
"eyre",
|
||||
"fdlimit",
|
||||
"futures",
|
||||
"metrics",
|
||||
"metrics-exporter-prometheus",
|
||||
|
||||
@ -28,6 +28,7 @@ tracing-futures = "0.2"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
|
||||
# io
|
||||
fdlimit = "0.2.1"
|
||||
walkdir = "2.3"
|
||||
serde = "1.0"
|
||||
serde_json = "1.0"
|
||||
|
||||
@ -8,6 +8,7 @@ use crate::{
|
||||
util::chainspec::{chain_spec_value_parser, ChainSpecification, Genesis},
|
||||
};
|
||||
use clap::{crate_version, Parser};
|
||||
use fdlimit::raise_fd_limit;
|
||||
use reth_consensus::BeaconConsensus;
|
||||
use reth_db::{
|
||||
cursor::DbCursorRO,
|
||||
@ -85,6 +86,10 @@ impl Command {
|
||||
/// Execute `node` command
|
||||
// TODO: RPC
|
||||
pub async fn execute(&self) -> eyre::Result<()> {
|
||||
// Raise the fd limit of the process.
|
||||
// Does not do anything on windows.
|
||||
raise_fd_limit();
|
||||
|
||||
let config: Config = confy::load_path(&self.config).unwrap_or_default();
|
||||
info!("reth {} starting", crate_version!());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user