Skip to content

Commit

Permalink
chore: migrate gorgon, cerberus and geoip projects (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
xav authored Sep 28, 2023
1 parent 03ccdfd commit 67406ad
Show file tree
Hide file tree
Showing 31 changed files with 1,446 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true
15 changes: 12 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,37 @@ members = [
default = []
full = [
"alloc",
"analytics",
"profiler",
"project_registry",
"collections",
"future",
"geoblock",
"geoip",
"http",
"metrics",
"geoblock"
]
alloc = ["dep:alloc"]
analytics = ["dep:analytics"]
collections = ["dep:collections"]
future = ["dep:future"]
geoblock = ["dep:geoblock", "dep:geoip"]
geoip = ["dep:geoip"]
http = []
metrics = ["dep:metrics", "future/metrics", "alloc/metrics", "http/metrics"]
profiler = ["alloc/profiler"]
geoblock = ["dep:geoblock"]
project_registry = ["dep:project_registry"]

[dependencies]
alloc = { path = "./crates/alloc", optional = true }
analytics = { path = "./crates/analytics", optional = true }
collections = { path = "./crates/collections", optional = true }
future = { path = "./crates/future", optional = true }
geoblock = { path = "./crates/geoblock", optional = true }
geoip = { path = "./crates/geoip", optional = true }
http = { path = "./crates/http", optional = true }
metrics = { path = "./crates/metrics", optional = true }
geoblock = { path = "./crates/geoblock", optional = true }
project_registry = { path = "./crates/project_registry", optional = true }

[dev-dependencies]
anyhow = "1"
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Rust Utilities for WalletConnect

Exports `Jemalloc` (from the [`tikv-jemallocator`](https://github.com/tikv/jemallocator)) with service metrics instrumentation. Also contains a custom lightweight version of the [DHAT profiler](https://github.com/WalletConnect/dhat-rs) to automate heap profiling in async environment.

## `analytics`

Analytics parquet writer.

## `collections`

Extensions for collections such as `HashMap`.
Expand All @@ -14,14 +18,6 @@ Extensions for collections such as `HashMap`.

Convenience `Future` extensions.

## `http`

Metrics and other utils for HTTP servers.

## `metrics`

Global service metrics. Currently based on `opentelemetry` SDK and exported in `prometheus` format.

## `geoblock`

Tower middleware for blocking requests based on clients' IP origin.
Expand All @@ -32,6 +28,22 @@ to run your app otherwise it will fail at runtime.

See [Router::into_make_service_with_connect_info](https://docs.rs/axum/latest/axum/struct.Router.html#method.into_make_service_with_connect_info) for more details.

## `geopip`

IP Geolocation API

## `http`

Metrics and other utils for HTTP servers.

## `metrics`

Global service metrics. Currently based on `opentelemetry` SDK and exported in `prometheus` format.

## `project_registry`

Check project IDs against the WalletConnect registry.

## Examples

- [Metrics integration](examples/metrics.rs). Prints service metrics in the default (`prometheus`) format.
Expand Down
20 changes: 20 additions & 0 deletions crates/analytics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "analytics"
version = "0.1.0"
edition = "2021"

[dependencies]
async-trait = "0.1"
tokio = { version = "1", default-features = false, features = ["rt", "rt-multi-thread", "sync", "time", "macros"] }
tracing = "0.1"

# Misc
thiserror = "1.0"
anyhow = "1"
tap = "1.0"

chrono = { version = "0.4" }
aws-sdk-s3 = "0.25"
bytes = "1.2"
parquet = { git = "https://github.com/WalletConnect/arrow-rs.git", rev = "99a1cc3", default-features = false, features = ["flate2"] }
parquet_derive = { git = "https://github.com/WalletConnect/arrow-rs.git", rev = "99a1cc3" }
Loading

0 comments on commit 67406ad

Please sign in to comment.