new file: .gitignore

new file:   Cargo.lock
	new file:   Cargo.toml
	new file:   src/main.rs
This commit is contained in:
Michael Wain 2025-03-08 02:46:28 +03:00
commit 0e0371f4da
4 changed files with 5133 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

5106
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

10
Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
name = "Gamal"
version = "0.1.0"
edition = "2021"
[dependencies]
arti-client = { version = "0.28.0", features = ["onion-service-client", "onion-service-service", "pt-client"] }
tokio = { version = "1", features = ["full"] }
env_logger = "0.11.6"
log = "0.4.20"

16
src/main.rs Normal file
View File

@ -0,0 +1,16 @@
use arti_client::{config::onion_service::OnionServiceConfigBuilder, TorClient, TorClientConfig};
use log::info;
#[tokio::main]
async fn main() {
let config = TorClientConfig::default();
if let Ok(tor_client) = TorClient::create_bootstrapped(config).await {
info!("Bootstrapped");
let onion_service_config = OnionServiceConfigBuilder::default().build().unwrap();
if let Ok(es) = tor_client.launch_onion_service(onion_service_config) {
info!("Onion name: {}", es.0.onion_name().unwrap());
}
} else {
info!("Error with bootstrapping");
}
}