Skip to content

Commit d50dec2

Browse files
Rename batcher folder and package to gateway
1 parent 418199f commit d50dec2

File tree

17 files changed

+57
-57
lines changed

17 files changed

+57
-57
lines changed

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,25 +317,25 @@ agg_mode_docker_clean: agg_mode_docker_down
317317
agg_mode_run_migrations: agg_mode_docker_up
318318
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin migrate -- postgres://postgres:postgres@localhost:5435/
319319

320-
agg_mode_batcher_start_local: agg_mode_run_migrations
321-
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin batcher -- config-files/config-agg-mode-batcher.yaml
320+
agg_mode_gateway_start_local: agg_mode_run_migrations
321+
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin gateway -- config-files/config-agg-mode-gateway.yaml
322322

323-
agg_mode_batcher_start_ethereum_package: agg_mode_run_migrations
324-
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin batcher -- config-files/config-agg-mode-batcher-ethereum-package.yaml
323+
agg_mode_gateway_start_ethereum_package: agg_mode_run_migrations
324+
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin gateway -- config-files/config-agg-mode-gateway-ethereum-package.yaml
325325

326-
agg_mode_batcher_poller_start_local: agg_mode_run_migrations
327-
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin agg_mode_batcher_poller -- config-files/config-agg-mode-batcher.yaml
326+
agg_mode_payments_poller_start_local: agg_mode_run_migrations
327+
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin agg_mode_payments_poller -- config-files/config-agg-mode-gateway.yaml
328328

329-
agg_mode_batcher_poller_start_ethereum_package: agg_mode_run_migrations
330-
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin agg_mode_batcher_poller -- config-files/config-agg-mode-batcher-ethereum-package.yaml
329+
agg_mode_payments_poller_start_ethereum_package: agg_mode_run_migrations
330+
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin agg_mode_payments_poller -- config-files/config-agg-mode-gateway-ethereum-package.yaml
331331

332332
AGG_MODE_SENDER ?= 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
333-
agg_mode_batcher_send_payment:
333+
agg_mode_gateway_send_payment:
334334
@cast send --value 1ether \
335335
0x922D6956C99E12DFeB3224DEA977D0939758A1Fe \
336336
--private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
337337

338-
agg_mode_batcher_send_sp1_proof:
338+
agg_mode_gateway_send_sp1_proof:
339339
@NONCE=$$(curl -s http://127.0.0.1:8089/nonce/0x70997970C51812dc3A010C7d01b50e0d17dc79C8 | jq -r '.data.nonce'); \
340340
curl -X POST \
341341
-H "Content-Type: multipart/form-data" \

aggregation_mode/Cargo.lock

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aggregation_mode/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
resolver = "2"
3-
members = ["./batcher", "./proof_aggregator", "./db", "./payments_poller"]
3+
members = ["./gateway", "./proof_aggregator", "./db", "./payments_poller"]
44

55
[workspace.package]
66
version = "0.1.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "batcher"
2+
name = "gateway"
33
version = "0.1.0"
44
edition = "2021"
55

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ use crate::{
2525
};
2626

2727
#[derive(Clone, Debug)]
28-
pub struct BatcherServer {
28+
pub struct GatewayServer {
2929
db: Db,
3030
config: Config,
3131
}
3232

33-
impl BatcherServer {
33+
impl GatewayServer {
3434
pub fn new(db: Db, config: Config) -> Self {
3535
Self { db, config }
3636
}
3737

3838
pub async fn start(&self) {
39-
// Note: BatcherServer is thread safe so we can just clone it (no need to add mutexes)
39+
// Note: GatewayServer is thread safe so we can just clone it (no need to add mutexes)
4040
let port = self.config.port;
4141
let state = self.clone();
4242

@@ -71,7 +71,7 @@ impl BatcherServer {
7171

7272
let address = address_raw.to_lowercase();
7373

74-
let Some(state) = req.app_data::<Data<BatcherServer>>() else {
74+
let Some(state) = req.app_data::<Data<GatewayServer>>() else {
7575
return HttpResponse::InternalServerError()
7676
.json(AppResponse::new_unsucessfull("Internal server error", 500));
7777
};
@@ -88,14 +88,14 @@ impl BatcherServer {
8888
}
8989
}
9090

91-
// Posts an SP1 proof to the batcher, recovering the address from the signature
91+
// Posts an SP1 proof to the gateway, recovering the address from the signature
9292
async fn post_proof_sp1(
9393
req: HttpRequest,
9494
MultipartForm(data): MultipartForm<SubmitProofRequestSP1>,
9595
) -> impl Responder {
9696
let recovered_address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8".to_lowercase();
9797

98-
let Some(state) = req.app_data::<Data<BatcherServer>>() else {
98+
let Some(state) = req.app_data::<Data<GatewayServer>>() else {
9999
return HttpResponse::InternalServerError()
100100
.json(AppResponse::new_unsucessfull("Internal server error", 500));
101101
};
@@ -194,7 +194,7 @@ impl BatcherServer {
194194
}
195195

196196
/// TODO: complete for risc0 (see `post_proof_sp1`)
197-
// Posts a Risc0 proof to the batcher, recovering the address from the signature
197+
// Posts a Risc0 proof to the gateway, recovering the address from the signature
198198
async fn post_proof_risc0(
199199
_req: HttpRequest,
200200
MultipartForm(_): MultipartForm<SubmitProofRequestRisc0>,
@@ -208,7 +208,7 @@ impl BatcherServer {
208208
req: HttpRequest,
209209
params: web::Query<GetReceiptsQueryParams>,
210210
) -> impl Responder {
211-
let Some(state) = req.app_data::<Data<BatcherServer>>() else {
211+
let Some(state) = req.app_data::<Data<GatewayServer>>() else {
212212
return HttpResponse::InternalServerError().json(AppResponse::new_unsucessfull(
213213
"Internal server error: Failed to get app data",
214214
500,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::env;
22

3-
use batcher::{config::Config, db::Db, http::BatcherServer};
3+
use gateway::{config::Config, db::Db, http::GatewayServer};
44
use tracing_subscriber::{EnvFilter, FmtSubscriber};
55

66
fn read_config_filepath_from_args() -> String {
@@ -30,7 +30,7 @@ async fn main() {
3030
.await
3131
.expect("db to start");
3232

33-
let http_server = BatcherServer::new(db, config.clone());
33+
let http_server = GatewayServer::new(db, config.clone());
3434

3535
let http_server_handle = tokio::spawn(async move { http_server.start().await });
3636

0 commit comments

Comments
 (0)