File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ ws_listener = "0.0.0.0:3000"
77# JSON-RPC 最大连接数,默认 100
88jsonrpc_max_connections = 100
99
10+ # JSON-RPC 最大请求体大小,单位字节,默认 10485760(10MB)
11+ # max_request_body_size = 10485760
12+
13+ # JSON-RPC 最大响应体大小,单位字节,默认 10485760(10MB)
14+ # max_response_body_size = 10485760
15+
1016# 是否启用 Unix Socket(仅非 Windows 平台)
1117# 启用后会额外监听 unix_socket_path 对应的 Axum 主路由
1218enable_unix_socket = false
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ pub struct ServerConfig {
3030
3131 // 监控数据缓冲写入配置(可选)
3232 pub monitoring_buffer : Option < MonitoringBufferConfig > ,
33+
34+ // JSON-RPC 最大请求体大小(字节),默认 10485760(10MB)
35+ pub max_request_body_size : Option < u32 > ,
36+
37+ // JSON-RPC 最大响应体大小(字节),默认 10485760(10MB)
38+ pub max_response_body_size : Option < u32 > ,
3339}
3440
3541/// 监控数据缓冲写入配置
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ ws_listener = "0.0.0.0:3000"
44# JSON-RPC 最大连接数,默认 100
55jsonrpc_max_connections = 100
66
7+ # JSON-RPC 最大请求体大小,单位字节,默认 10485760(10MB)
8+ # max_request_body_size = 10485760
9+
10+ # JSON-RPC 最大响应体大小,单位字节,默认 10485760(10MB)
11+ # max_response_body_size = 10485760
12+
713# 是否启用 Unix Socket(仅非 Windows 平台)
814# 启用后会额外监听 unix_socket_path 对应的 Axum 主路由
915enable_unix_socket = false
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ pub async fn run(config: &nodeget_lib::config::server::ServerConfig) {
6060 . set_config (
6161 jsonrpsee:: server:: ServerConfig :: builder ( )
6262 . max_connections ( config. jsonrpc_max_connections . unwrap_or ( 100 ) )
63- . max_response_body_size ( u32 :: MAX )
64- . max_request_body_size ( u32 :: MAX )
63+ . max_response_body_size ( config . max_response_body_size . unwrap_or ( 10 * 1024 * 1024 ) )
64+ . max_request_body_size ( config . max_request_body_size . unwrap_or ( 10 * 1024 * 1024 ) )
6565 . build ( ) ,
6666 )
6767 . to_service_builder ( )
You can’t perform that action at this time.
0 commit comments