feat: publish HTTPS port even in testnet, and use testnet in request binary

This commit is contained in:
nazeh
2025-01-08 12:33:46 +03:00
parent 61c532fe85
commit dc01377d09
4 changed files with 17 additions and 9 deletions

View File

@@ -15,3 +15,7 @@ Or make a direct HTTP request.
```bash
cargo run --bin request GET https://<Pkarr domain>/[path]
```
### Testnet
You can pass a `--testnet` argument to run the query in testnet mode (using local DHT testnet).

View File

@@ -14,6 +14,9 @@ struct Cli {
method: Method,
/// Pubky or HTTPS url
url: Url,
/// Use testnet mode
#[clap(long)]
testnet: bool,
}
#[tokio::main]
@@ -24,7 +27,11 @@ async fn main() -> Result<()> {
.with_env_filter(env::var("TRACING").unwrap_or("info".to_string()))
.init();
let client = Client::new()?;
let client = if args.testnet {
Client::testnet()?
} else {
Client::new()?
};
// Build the request
let response = client.get(args.url).send().await?;