mirror of
https://github.com/aljazceru/pubky-core.git
synced 2025-12-31 04:44:37 +01:00
feat: publish HTTPS port even in testnet, and use testnet in request binary
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user