user_address change not made yet

This commit is contained in:
Bryan Stitt 2022-09-05 06:29:27 +00:00
parent ee3c55401c
commit e261886c60
6 changed files with 7 additions and 9 deletions

@ -318,3 +318,4 @@ in another repo: event subscriber
{"jsonrpc":"2.0","id":null,"error":{"code":-32099,"message":"deadline has elapsed"}}
- [ ] figure out rate limits for private rpcs. eden v1 gives 500 error instead of a code for rate limits
- [ ] https://gitlab.com/moka-labs/tiered-cache-example

@ -9,7 +9,7 @@ redis_url = "redis://dev-redis:6379/"
# TODO: how do we find the optimal redis_max_connections? too high actually ends up being slower
redis_max_connections = 99
redirect_public_url = "https://llamanodes.com/free-rpc-stats"
redirect_user_url = "https://llamanodes.com/user-rpc-stats/{{user_address}}"
redirect_user_url = "https://llamanodes.com/user-rpc-stats/{{user_id}}"
public_rate_limit_per_minute = 0
# 1GB of cache
response_cache_max_bytes = 10000000000

@ -153,11 +153,8 @@ impl Web3ProxyApp {
// safety checks on the config
debug!("redirect_user_url: {}", top_config.app.redirect_user_url);
assert!(
top_config
.app
.redirect_user_url
.contains("{{user_address}}"),
"redirect user url must contain \"{{user_address}}\""
top_config.app.redirect_user_url.contains("{{user_id}}"),
"redirect user url must contain \"{{user_id}}\""
);
// first, we connect to mysql and make sure the latest migrations have run

@ -218,7 +218,7 @@ mod tests {
public_rate_limit_per_minute: 6_000_000,
response_cache_max_bytes: 10_usize.pow(7),
redirect_public_url: "example.com/".to_string(),
redirect_user_url: "example.com/{{user_address}}".to_string(),
redirect_user_url: "example.com/{{user_id}}".to_string(),
..Default::default()
},
balanced_rpcs: HashMap::from([

@ -71,7 +71,7 @@ pub struct AppConfig {
pub response_cache_max_bytes: usize,
/// the stats page url for an anonymous user.
pub redirect_public_url: String,
/// the stats page url for a logged in user. it must contain "{user_address}"
/// the stats page url for a logged in user. it must contain "{user_id}"
pub redirect_user_url: String,
}

@ -72,7 +72,7 @@ pub async fn user_websocket_handler(
// TODO: store this on the app and use register_template?
let reg = Handlebars::new();
// TODO: show the user's address, not their id (remember to update the checks for {{user_address}}} in app.rs)
// TODO: show the user's address, not their id (remember to update the checks for {{user_id}}} in app.rs)
// TODO: query to get the user's address. expose that instead of user_id
let user_url = reg
.render_template(