Skip to content

Commit

Permalink
Introduce RpcParams in sc-cli (#5601)
Browse files Browse the repository at this point in the history
This PR is a pure refactoring by consolidating all the RPC related
parameters into a dedicated `RpcParams` struct, allowing us at subcoin
to build a custom run cmd without the need to duplicate code.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent 1f1f20a commit 278d1bf
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 287 deletions.
10 changes: 5 additions & 5 deletions cumulus/client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl PurgeChainCmd {
Some('y') | Some('Y') => {},
_ => {
println!("Aborted");
return Ok(())
return Ok(());
},
}
}
Expand Down Expand Up @@ -432,19 +432,19 @@ impl sc_cli::CliConfiguration for NormalizedRunCmd {
}

fn rpc_max_request_size(&self) -> sc_cli::Result<u32> {
Ok(self.base.rpc_max_request_size)
self.base.rpc_max_request_size()
}

fn rpc_max_response_size(&self) -> sc_cli::Result<u32> {
Ok(self.base.rpc_max_response_size)
self.base.rpc_max_response_size()
}

fn rpc_max_subscriptions_per_connection(&self) -> sc_cli::Result<u32> {
Ok(self.base.rpc_max_subscriptions_per_connection)
self.base.rpc_max_subscriptions_per_connection()
}

fn rpc_buffer_capacity_per_connection(&self) -> sc_cli::Result<u32> {
Ok(self.base.rpc_message_buffer_capacity_per_connection)
Ok(self.base.rpc_params.rpc_message_buffer_capacity_per_connection)
}

fn rpc_batch_config(&self) -> sc_cli::Result<RpcBatchRequestConfig> {
Expand Down
12 changes: 12 additions & 0 deletions prdoc/pr_5601.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Introduce `RpcParams` in sc-cli

doc:
- audience: Node Dev
description: |
Refactors and consolidates all RPC-related parameters in the run command into a dedicated `RpcParams` struct. This change allows downstream users to build custom run command without duplicating code.

crates:
- name: cumulus-client-cli
bump: none
- name: sc-cli
bump: major
Loading

0 comments on commit 278d1bf

Please sign in to comment.