Skip to content

Commit

Permalink
fix(node-loader): Fix anoying error with too large RPC data (#3162)
Browse files Browse the repository at this point in the history
  • Loading branch information
techraed authored Aug 24, 2023
1 parent 37b9168 commit e279e6c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gsdk/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use subxt::{

const DEFAULT_GEAR_ENDPOINT: &str = "wss://rpc-node.gear-tech.io:443";
const DEFAULT_TIMEOUT: u64 = 60_000;
const ONE_HUNDRED_MEGA_BYTES: u32 = 100 * 1024 * 1024;

struct Params(Option<Box<RawValue>>);

Expand All @@ -63,6 +64,11 @@ impl RpcClient {
if url.starts_with("ws") {
Ok(Self::Ws(
WsClientBuilder::default()
// Actually that stand for the response too.
// *WARNING*:
// After updating jsonrpsee to 0.20.0 and higher
// use another method created only for that.
.max_request_body_size(ONE_HUNDRED_MEGA_BYTES)
.connection_timeout(Duration::from_millis(timeout))
.request_timeout(Duration::from_millis(timeout))
.build(url)
Expand Down

0 comments on commit e279e6c

Please sign in to comment.