Skip to content

Commit

Permalink
Rpc max connection env (#720)
Browse files Browse the repository at this point in the history
* rpc_max_connections env

* remove .idea
  • Loading branch information
apoorvsadana authored Jan 23, 2024
1 parent 7416750 commit 373c3fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DEPLOYER_ACCOUNT_PRIVATE_KEY=0x0288a51c164874bb6a1ca7bd1cb71823c234a86d0f7b150d7

# Kakarot Environment
KAKAROT_RPC_URL=127.0.0.1:3030
RPC_MAX_CONNECTIONS=100
## check `./deployments/katana/deployments.json` after running `make devnet`
KAKAROT_ADDRESS=
PROXY_ACCOUNT_CLASS_HASH=0x105356ebf9c56df723dc6952dae0cffd8f6e0c22281cf0ee7df8ddde60281c0
Expand Down
6 changes: 5 additions & 1 deletion src/eth_rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ pub async fn run_server(

let service = ServiceBuilder::new().layer(cors);

let server = ServerBuilder::default().set_middleware(service).build(socket_addr.parse::<SocketAddr>()?).await?;
let server = ServerBuilder::default()
.max_connections(std::env::var("RPC_MAX_CONNECTIONS").unwrap_or("100".to_string()).parse().unwrap())
.set_middleware(service)
.build(socket_addr.parse::<SocketAddr>()?)
.await?;

let addr = server.local_addr()?;

Expand Down

0 comments on commit 373c3fc

Please sign in to comment.