Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/fail
.khost-data
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "khost"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
authors = ["Kaspa developers"]
license = "MIT OR Apache-2.0"
Expand Down
12 changes: 11 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ impl Config {
.with_local_interface(8989);

let origin = Origin::try_new("https://github.com/aspectron/rusty-kaspa", Some("pnn-v1"))?;
let covpp_origin =
Origin::try_new("https://github.com/kaspanet/rusty-kaspa", Some("covpp"))?;

let kaspad = Network::into_iter()
.map(|network| kaspad::Config::new(origin.clone(), network))
.map(|network| {
let selected_origin = match network {
Network::Mainnet => origin.clone(),
Network::Testnet10 => origin.clone(),
Network::Testnet12 => covpp_origin.clone(),
};
kaspad::Config::new(selected_origin.clone(), network)
})
.collect::<Vec<_>>();

let nginx = nginx::Config::default();
Expand Down
3 changes: 3 additions & 0 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,14 @@ where
enum Preset {
PNNv1,
// Delta,
Covpp,
Custom,
}

let preset = if name == "rusty-kaspa" {
cliclack::select(format!("Select git origin for '{name}':"))
.item(Preset::PNNv1, "pnn-v1 (aspectron/pnn-v1)", "")
.item(Preset::Covpp, "covpp (kaspanet/covpp)", "")
// .item(
// Preset::Delta,
// "Delta",
Expand All @@ -201,6 +203,7 @@ where
Preset::PNNv1 => {
Origin::try_new("https://github.com/aspectron/rusty-kaspa", Some("pnn-v1"))?
}
Preset::Covpp => Origin::try_new("https://github.com/kaspanet/rusty-kaspa", Some("covpp"))?,
// Preset::Delta => {
// Origin::try_new("https://github.com/aspectron/rusty-kaspa", Some("delta"))?
// }
Expand Down
6 changes: 3 additions & 3 deletions src/kaspad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Config {
let (grpc, wrpc_borsh, wrpc_json) = match network {
Network::Mainnet => (16110, 17110, 18110),
Network::Testnet10 => (16210, 17210, 18210),
Network::Testnet11 => (16310, 17310, 18310),
Network::Testnet12 => (16311, 17210, 18210),
};

Self {
Expand Down Expand Up @@ -143,9 +143,9 @@ impl From<&Config> for Vec<String> {
args.push("--testnet");
args.push("--netsuffix=10");
}
Network::Testnet11 => {
Network::Testnet12 => {
args.push("--testnet");
args.push("--netsuffix=11");
args.push("--netsuffix=12");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ pub enum Network {
#[default]
Mainnet,
Testnet10,
Testnet11,
Testnet12,
}

impl Display for Network {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self {
Network::Mainnet => write!(f, "mainnet"),
Network::Testnet10 => write!(f, "testnet-10"),
Network::Testnet11 => write!(f, "testnet-11"),
Network::Testnet12 => write!(f, "testnet-12"),
}
}
}