mirror of
https://github.com/aljazceru/pubky-core.git
synced 2026-01-11 18:24:33 +01:00
fix(pubky): testnet hardcoded configurations
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user