dash consistency
This commit is contained in:
parent
8eeef81560
commit
2811c84c25
@ -4,6 +4,6 @@
|
|||||||
/Dockerfile
|
/Dockerfile
|
||||||
/redis-cell-server/
|
/redis-cell-server/
|
||||||
/target
|
/target
|
||||||
/web3-proxy/flamegraph.svg
|
/web3_proxy/flamegraph.svg
|
||||||
/web3-proxy/perf.data
|
/web3_proxy/perf.data
|
||||||
/web3-proxy/perf.data.old
|
/web3_proxy/perf.data.old
|
||||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -5194,7 +5194,7 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "web3-proxy"
|
name = "web3_proxy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
FROM rust:1-bullseye as builder
|
FROM rust:1-bullseye as builder
|
||||||
|
|
||||||
WORKDIR /usr/src/web3-proxy
|
WORKDIR /usr/src/web3_proxy
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/src/web3-proxy/target \
|
--mount=type=cache,target=/usr/src/web3_proxy/target \
|
||||||
cargo install --locked --path ./web3_proxy
|
cargo install --locked --path ./web3_proxy
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
FROM debian:bullseye-slim
|
||||||
|
14
README.md
14
README.md
@ -1,6 +1,6 @@
|
|||||||
# web3-proxy
|
# web3_proxy
|
||||||
|
|
||||||
Web3-proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.
|
Web3_proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.
|
||||||
|
|
||||||
**Under construction!** This code is under active development. The basics seem to work, but theres lots of tests and features to write still.
|
**Under construction!** This code is under active development. The basics seem to work, but theres lots of tests and features to write still.
|
||||||
|
|
||||||
@ -15,12 +15,12 @@ $ cargo install sea-orm-cli
|
|||||||
$ cargo run --release -- --help
|
$ cargo run --release -- --help
|
||||||
```
|
```
|
||||||
```
|
```
|
||||||
Compiling web3-proxy v0.1.0 (/home/bryan/src/web3-proxy/web3-proxy)
|
Compiling web3_proxy v0.1.0 (/home/bryan/src/web3_proxy/web3_proxy)
|
||||||
Finished release [optimized + debuginfo] target(s) in 17.69s
|
Finished release [optimized + debuginfo] target(s) in 17.69s
|
||||||
Running `target/release/web3-proxy --help`
|
Running `target/release/web3_proxy --help`
|
||||||
Usage: web3-proxy [--port <port>] [--workers <workers>] [--config <config>]
|
Usage: web3_proxy [--port <port>] [--workers <workers>] [--config <config>]
|
||||||
|
|
||||||
Web3-proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.
|
web3_proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--port what port the proxy should listen on
|
--port what port the proxy should listen on
|
||||||
@ -84,7 +84,7 @@ Flame graphs make finding slow code painless:
|
|||||||
|
|
||||||
Run the proxy under gdb for advanced debugging:
|
Run the proxy under gdb for advanced debugging:
|
||||||
|
|
||||||
cargo build --release && RUST_LOG=web3_proxy=debug rust-gdb --args target/debug/web3-proxy --listen-port 7503 --rpc-config-path ./config/production-eth.toml
|
cargo build --release && RUST_LOG=web3_proxy=debug rust-gdb --args target/debug/web3_proxy --listen-port 7503 --rpc-config-path ./config/production-eth.toml
|
||||||
|
|
||||||
TODO: also enable debug symbols in the release build by modifying the root Cargo.toml
|
TODO: also enable debug symbols in the release build by modifying the root Cargo.toml
|
||||||
|
|
||||||
|
2
TODO.md
2
TODO.md
@ -206,6 +206,6 @@ in another repo: event subscriber
|
|||||||
- [ ] better error handling. we warn too often for validation errors and use the same error code for most every request
|
- [ ] better error handling. we warn too often for validation errors and use the same error code for most every request
|
||||||
- [ ] use &str more instead of String. lifetime annotations get really annoying though
|
- [ ] use &str more instead of String. lifetime annotations get really annoying though
|
||||||
- [ ] tarpit instead of reject requests (unless theres a lot)
|
- [ ] tarpit instead of reject requests (unless theres a lot)
|
||||||
- [ ] tune database connection pool size. i think a single web3-proxy currently maxes out our server
|
- [ ] tune database connection pool size. i think a single web3_proxy currently maxes out our server
|
||||||
- [ ] subscribing to transactions should be configurable per server. listening to paid servers can get expensive
|
- [ ] subscribing to transactions should be configurable per server. listening to paid servers can get expensive
|
||||||
- [ ] archive servers should be lowest priority
|
- [ ] archive servers should be lowest priority
|
||||||
|
@ -4,7 +4,7 @@ FROM rust:1-bullseye as builder
|
|||||||
WORKDIR /usr/src/redis-cell
|
WORKDIR /usr/src/redis-cell
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/src/web3-proxy/target \
|
--mount=type=cache,target=/usr/src/web3_proxy/target \
|
||||||
{ \
|
{ \
|
||||||
set -eux; \
|
set -eux; \
|
||||||
git clone -b v0.3.0 https://github.com/brandur/redis-cell .; \
|
git clone -b v0.3.0 https://github.com/brandur/redis-cell .; \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "web3-proxy"
|
name = "web3_proxy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "web3_proxy"
|
default-run = "web3_proxy"
|
||||||
|
@ -438,7 +438,7 @@ impl Web3ProxyApp {
|
|||||||
let frontend_rate_limiter = redis_client_pool.as_ref().map(|redis_client_pool| {
|
let frontend_rate_limiter = redis_client_pool.as_ref().map(|redis_client_pool| {
|
||||||
RedisCellClient::new(
|
RedisCellClient::new(
|
||||||
redis_client_pool.clone(),
|
redis_client_pool.clone(),
|
||||||
"web3-proxy",
|
"web3_proxy",
|
||||||
"frontend",
|
"frontend",
|
||||||
public_max_burst,
|
public_max_burst,
|
||||||
app_config.shared.public_rate_limit_per_minute,
|
app_config.shared.public_rate_limit_per_minute,
|
||||||
|
@ -6,7 +6,7 @@ use tracing::info;
|
|||||||
use web3_proxy::app::get_migrated_db;
|
use web3_proxy::app::get_migrated_db;
|
||||||
|
|
||||||
#[derive(Debug, FromArgs)]
|
#[derive(Debug, FromArgs)]
|
||||||
/// Command line interface for admins to interact with web3-proxy
|
/// Command line interface for admins to interact with web3_proxy
|
||||||
pub struct TopConfig {
|
pub struct TopConfig {
|
||||||
/// what database the client should connect to
|
/// what database the client should connect to
|
||||||
#[argh(
|
#[argh(
|
||||||
|
@ -12,7 +12,7 @@ use crate::connection::Web3Connection;
|
|||||||
pub type BlockAndRpc = (Arc<Block<TxHash>>, Arc<Web3Connection>);
|
pub type BlockAndRpc = (Arc<Block<TxHash>>, Arc<Web3Connection>);
|
||||||
|
|
||||||
#[derive(Debug, FromArgs)]
|
#[derive(Debug, FromArgs)]
|
||||||
/// Web3-proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.
|
/// Web3_proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.
|
||||||
pub struct CliConfig {
|
pub struct CliConfig {
|
||||||
/// what port the proxy should listen on
|
/// what port the proxy should listen on
|
||||||
#[argh(option, default = "8544")]
|
#[argh(option, default = "8544")]
|
||||||
|
@ -151,7 +151,7 @@ impl Web3Connection {
|
|||||||
let period = 1;
|
let period = 1;
|
||||||
RedisCellClient::new(
|
RedisCellClient::new(
|
||||||
redis_conection,
|
redis_conection,
|
||||||
"web3-proxy",
|
"web3_proxy",
|
||||||
&format!("{}:{}", chain_id, url_str),
|
&format!("{}:{}", chain_id, url_str),
|
||||||
hard_rate_limit,
|
hard_rate_limit,
|
||||||
hard_rate_limit,
|
hard_rate_limit,
|
||||||
|
Loading…
Reference in New Issue
Block a user