Skip to content

Commit

Permalink
config: add helper for retrieving rpc config
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Dec 16, 2024
1 parent 2faf6b1 commit 3496436
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crates/sui-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ impl NodeConfig {
pub fn jsonrpc_server_type(&self) -> ServerType {
self.jsonrpc_server_type.unwrap_or(ServerType::Http)
}

pub fn rpc(&self) -> Option<&sui_rpc_api::Config> {
self.rpc.as_ref()
}
}

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ impl SuiNode {

let rpc_index = if is_full_node
&& config.enable_experimental_rest_api
&& config.rpc.as_ref().is_some_and(|rpc| rpc.enable_indexing())
&& config.rpc().is_some_and(|rpc| rpc.enable_indexing())
{
Some(Arc::new(RpcIndexStore::new(
&config.db_path(),
Expand Down

0 comments on commit 3496436

Please sign in to comment.