Skip to content

Commit

Permalink
Limiter/logs (#2737)
Browse files Browse the repository at this point in the history
add doc & log
  • Loading branch information
wow-sven authored Oct 9, 2024
1 parent cf89d39 commit a180c3a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions crates/rooch-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,17 @@ pub struct RoochOpt {
#[clap(long, default_value_t, value_enum)]
pub service_status: ServiceStatus,

/// Set quota size that defines how many requests can occur
/// before the governor middleware starts blocking requests from an IP address and
/// clients have to wait until the elements of the quota are replenished.
///
/// **The burst_size must not be zero.**
#[clap(long)]
pub traffic_burst_size: Option<u32>,

/// Set the interval after which one element of the quota is replenished in seconds.
///
/// **The interval must not be zero.**
#[clap(long)]
pub traffic_per_second: Option<u64>,

Expand Down
5 changes: 5 additions & 0 deletions crates/rooch-rpc-server/src/service/blocklist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ where
}
},
};

tracing::debug!("requset headers: {:?}", &req.headers());
tracing::debug!("client ip: {:?}", &client);
tracing::debug!("proxied client ip: {:?}", &proxied_client);

let s = self.check_impl(&client, &proxied_client);

// Extraction worked, let's check blocklist needed.
Expand Down
4 changes: 2 additions & 2 deletions sdk/typescript/templates/react-counter/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<Theme appearance="dark">
<QueryClientProvider client={queryClient}>
<RoochProvider networks={networkConfig} defaultNetwork='testnet'>
<WalletProvider preferredWallets={['OneKey']} chain={'bitcoin'} autoConnect>
<RoochProvider networks={networkConfig} defaultNetwork='localnet'>
<WalletProvider preferredWallets={['UniSat']} chain={'bitcoin'} autoConnect>
<App/>
</WalletProvider>
</RoochProvider>
Expand Down

0 comments on commit a180c3a

Please sign in to comment.