Skip to content

Commit

Permalink
proxy paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Sep 19, 2024
1 parent 64bcffe commit 7aff618
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
30 changes: 26 additions & 4 deletions dynamic.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
http:
routers:
routerTest:
service: srv-grpc
rule: Host(`localhost`)
routerMainnet:
service: srv-grpc-mainnet
rule: PathPrefix(`/mainnet`)
middlewares:
- strip-network-prefix
- "test-grpc-web"
entryPoints:
- web

routerTestnet:
service: srv-grpc-testnet
rule: PathPrefix(`/testnet`)
middlewares:
- strip-network-prefix
- "test-grpc-web"
entryPoints:
- web
Expand All @@ -13,8 +23,20 @@ http:
grpcWeb:
allowOrigins:
- "*"

strip-network-prefix:
stripPrefix:
prefixes:
- "/mainnet"
- "/testnet"

services:
srv-grpc:
srv-grpc-mainnet:
loadBalancer:
servers:
- url: https://zec.rocks:443

srv-grpc-testnet:
loadBalancer:
servers:
- url: https://testnet.zec.rocks:443
2 changes: 1 addition & 1 deletion src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const PRUNING_DEPTH: usize = 100;

fn is_sync<T: Sync>() {}
fn is_send<T: Send>() {}
const BATCH_SIZE: u32 = 3000;
const BATCH_SIZE: u32 = 10000;

/// # A Zcash wallet
///
Expand Down
2 changes: 1 addition & 1 deletion tests/message-board-sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async fn test_message_board() {
let _ = wasm_bindgen_futures::JsFuture::from(wasm_bindgen_rayon::init_thread_pool(10)).await;
let main_handler = thread::Builder::new()
.spawn_async(|| async {
let mut w = WebWallet::new("main", "http://localhost:1234", 1).unwrap();
let mut w = WebWallet::new("main", "http://localhost:1234/mainnet", 1).unwrap();

let s = zcash_keys::encoding::decode_extended_full_viewing_key(
constants::mainnet::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY,
Expand Down
2 changes: 1 addition & 1 deletion tests/simple-sync-and-send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async fn test_get_and_scan_range() {
assert!(!thread::is_web_worker_thread());
let main_handler = thread::Builder::new().spawn_async(|| async {
assert!(thread::is_web_worker_thread());
let mut w = WebWallet::new("test", "http://localhost:1234", 1).unwrap();
let mut w = WebWallet::new("test", "http://localhost:1234/testnet", 1).unwrap();

let id = w.create_account(SEED, HD_INDEX, BIRTHDAY).await.unwrap();
tracing::info!("Created account with id: {}", id);
Expand Down

0 comments on commit 7aff618

Please sign in to comment.