Skip to content

Commit cc6b146

Browse files
committed
improvement according github comments
1 parent 600acb5 commit cc6b146

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

configuration/example.config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ near_rpc_url = "https://beta.rpc.mainnet.near.org"
115115

116116
### Lake framework configuration
117117
[lake_config]
118-
# Number of threads to use for fetching data from fatnear
118+
# Number of threads to use for fetching data from fastnear
119119
# Default: 2 * available threads
120120
#num_threads = 8
121121

rpc-server/src/metrics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ lazy_static! {
113113
"Optimistic updating status. 0: working, 1: not working",
114114
).unwrap();
115115

116+
pub(crate) static ref CURRENT_PROTOCOL_VERSION: IntGauge = try_create_int_gauge(
117+
"current_protocol_version",
118+
"Current protocol version",
119+
).unwrap();
120+
116121
pub(crate) static ref LEGACY_DATABASE_TX_DETAILS: IntCounterVec = register_int_counter_vec(
117122
"legacy_database_tx_details",
118123
"Total number of calls to the legacy database for transaction details",

rpc-server/src/utils.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ pub async fn get_current_protocol_version(
149149
near_rpc_client: &JsonRpcClient,
150150
) -> anyhow::Result<near_primitives::version::ProtocolVersion> {
151151
let params = near_jsonrpc_client::methods::status::RpcStatusRequest;
152-
Ok(near_rpc_client.call(params, None).await?.protocol_version)
152+
let protocol_version = near_rpc_client.call(params, None).await?.protocol_version;
153+
crate::metrics::CURRENT_PROTOCOL_VERSION.set(protocol_version as i64);
154+
Ok(protocol_version)
153155
}
154156

155157
async fn handle_streamer_message(
@@ -205,7 +207,7 @@ pub async fn update_final_block_regularly(
205207
)
206208
.await
207209
{
208-
tracing::error!("Error to handle_streamer_message: {:?}", err);
210+
tracing::error!("Error in fn handle_streamer_message(): {:?}", err);
209211
};
210212
// Sleep for 500ms before the next iteration
211213
tokio::time::sleep(std::time::Duration::from_millis(500)).await;

0 commit comments

Comments
 (0)