-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
Cratify workspace
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,8 @@ | ||
[package] | ||
name = "zingo-proxy" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[[bin]] | ||
name = "zproxy" | ||
path = "bin/zproxy.rs" | ||
|
||
[[bin]] | ||
name = "nproxy" | ||
path = "bin/nproxy.rs" | ||
|
||
[[bin]] | ||
name = "nserver" | ||
path = "bin/nserver.rs" | ||
|
||
[dependencies] | ||
http = "0.2.4" | ||
tokio = { version = "1", features = ["full"] } | ||
tonic = "0.10.2" | ||
# zcash_client_backend = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zingo_rc.2.1", features = ["lightwalletd-tonic"] } | ||
zcash_client_backend = { git = "https://github.com/zingolabs/librustzcash.git", branch = "nym_integration", features = ["lightwalletd-tonic"] } | ||
# zingo-netutils = { git = "https://github.com/aloearev/zingolib.git", branch = "cratify_netutils" } | ||
zingo-netutils = { git = "https://github.com/zingolabs/zingolib.git", branch = "nym_integration" } | ||
prost = "0.12" | ||
bytes = "1.1" | ||
tokio-socks = "0.5" | ||
nym-sdk = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-sphinx-addressing = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-validator-client = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-bin-common = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-sphinx-anonymous-replies = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
ctrlc = "3.2.1" | ||
|
||
[workspace] | ||
members = [ | ||
"zingo-proxyd", | ||
"zingo-rpc", | ||
] | ||
|
||
# Use the edition 2021 dependency resolver in the workspace, to match the crates | ||
resolver = "2" |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[package] | ||
name = "zingo-proxyd" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[[bin]] | ||
name = "zingoproxyd" | ||
path = "src/bin/zingoproxyd.rs" | ||
|
||
[lib] | ||
name = "zingoproxylib" | ||
path = "src/lib.rs" | ||
|
||
[features] | ||
nym_wallet = [] | ||
nym_server = [] | ||
test-features = [] | ||
|
||
[dependencies] | ||
zingo-rpc = { path = "../zingo-rpc" } | ||
|
||
http = "0.2.4" | ||
tokio = { version = "1", features = ["full"] } | ||
tonic = "0.10.2" | ||
# zcash_client_backend = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zingo_rc.2.1", features = ["lightwalletd-tonic"] } | ||
zcash_client_backend = { git = "https://github.com/zingolabs/librustzcash.git", branch = "nym_integration", features = ["lightwalletd-tonic"] } | ||
# zingo-netutils = { git = "https://github.com/aloearev/zingolib.git", branch = "cratify_netutils" } | ||
zingo-netutils = { git = "https://github.com/zingolabs/zingolib.git", branch = "nym_integration" } | ||
prost = "0.12" | ||
bytes = "1.1" | ||
tokio-socks = "0.5" | ||
nym-sdk = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-sphinx-addressing = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-validator-client = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-bin-common = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
nym-sphinx-anonymous-replies = { git = "https://github.com/nymtech/nym", branch = "master" } | ||
ctrlc = "3.2.1" | ||
|
||
tower = { version = "0.4" } | ||
hyper-rustls = { version = "0.23", features = ["http2"] } | ||
tokio-rustls = "0.23" | ||
hyper = { version = "0.14", features = ["full"] } | ||
http-body = "0.4.4" | ||
webpki-roots = "0.21.0" | ||
rustls-pemfile = "1.0.0" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//! Zingo-Proxy daemon | ||
use std::time::Duration; | ||
use std::{process, thread}; | ||
|
||
extern crate ctrlc; | ||
|
||
use zingo_rpc::nym::utils::nym_spawn; | ||
Check failure on line 8 in zingo-proxyd/src/bin/zingoproxyd.rs GitHub Actions / Clippy (MSRV)unused import: `zingo_rpc::nym::utils::nym_spawn`
Check failure on line 8 in zingo-proxyd/src/bin/zingoproxyd.rs GitHub Actions / Clippy (MSRV)unused import: `zingo_rpc::nym::utils::nym_spawn`
|
||
use zingoproxylib::{nym_server::nym_serve, server::spawn_server}; | ||
Check failure on line 9 in zingo-proxyd/src/bin/zingoproxyd.rs GitHub Actions / Clippy (MSRV)unused import: `nym_server::nym_serve`
Check failure on line 9 in zingo-proxyd/src/bin/zingoproxyd.rs GitHub Actions / Clippy (MSRV)unused import: `nym_server::nym_serve`
|
||
|
||
#[tokio::main] | ||
async fn main() { | ||
ctrlc::set_handler(move || { | ||
println!("Received Ctrl+C, exiting."); | ||
process::exit(0); | ||
}) | ||
.expect("Error setting Ctrl-C handler"); | ||
|
||
#[cfg(any(feature = "nym_wallet", feature = "nym_server"))] | ||
{ | ||
nym_bin_common::logging::setup_logging(); | ||
} | ||
|
||
#[cfg(any(not(feature = "nym_server"), feature = "nym_wallet"))] | ||
{ | ||
let server_port = 8080; | ||
spawn_server(server_port, 9067, 18232).await; | ||
loop { | ||
thread::sleep(Duration::from_secs(10)); | ||
} | ||
} | ||
|
||
#[cfg(all(feature = "nym_server", not(feature = "nym_wallet")))] | ||
{ | ||
let path = "/tmp/nym_server"; | ||
let mut server = nym_spawn(path).await; | ||
let our_address = server.nym_address(); | ||
println!("\nnserver - nym address: {our_address}"); | ||
nym_serve(&mut server).await; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//! Zingo-Proxy gRPC Server. | ||
//! NOTE: This is currently a very simple implementation meant only for development and testing, and in its current form should not be used to run mainnet nodes. | ||
#![warn(missing_docs)] | ||
#![forbid(unsafe_code)] | ||
|
||
pub mod nym_server; | ||
pub mod server; |