fix(pubky): testnet hardcoded configurations

This commit is contained in:
nazeh
2025-02-13 13:08:24 +03:00
parent 9ac41b43ec
commit 15cfeef84d
2 changed files with 15 additions and 5 deletions

View File

@@ -18,8 +18,9 @@ struct Cli {
/// Pubky Auth url
url: Url,
// Whether or not to use testnet Dht network (local testing)
testnet: Option<bool>,
/// Use testnet mode
#[clap(long)]
testnet: bool,
}
#[tokio::main]
@@ -65,7 +66,8 @@ async fn main() -> Result<()> {
println!("Successfully decrypted recovery file...");
println!("PublicKey: {}", keypair.public_key());
let client = if cli.testnet.unwrap_or_default() {
let client = if cli.testnet {
dbg!("HERE");
let client = Client::builder().testnet().build()?;
// For the purposes of this demo, we need to make sure

View File

@@ -43,8 +43,16 @@ impl ClientBuilder {
/// 2. Pkarr Relay running on port [15411][pubky_common::constants::testnet_ports::PKARR_RELAY]
pub fn testnet(&mut self) -> &mut Self {
self.pkarr
.bootstrap(&["localhost:6881"])
.relays(&["http://localhost:5411"])
.bootstrap(&[format!(
"localhost:{}",
// TODO: update constants
// pubky_common::constants::testnet_ports::BOOTSTRAP
6881
)])
.relays(&[format!(
"http://localhost:{}",
pubky_common::constants::testnet_ports::PKARR_RELAY
)])
.expect("relays urls infallible");
self