switch from LP to credits

This commit is contained in:
ghe0 2025-06-23 03:38:46 +03:00
parent 13a00e2318
commit e88f64589a
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4
4 changed files with 4 additions and 2 deletions

3
Cargo.lock generated

@ -1,7 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
# SPDX-License-Identifier: Apache-2.0
version = 4
[[package]]

@ -375,6 +375,7 @@ fn clap_cmd() -> Command {
.arg(
Arg::new("price")
.long("price")
// TODO: maximum allowed price per month (for 732 hours)
.help("price per unit per minute; check docs")
.default_value("20000")
.value_parser(clap::value_parser!(u64).range(1..50000000))

@ -157,6 +157,7 @@ impl Request {
Ok((node.ip, new_vm_resp))
}
// TODO: get node that offers best offer for the user's request
pub fn get_node(&self) -> Result<proto::VmNodeListResp, Error> {
let (free_ports, offers_ipv4) = match &self.ipv4 {
IPv4Config::PublishPorts(vec) => (vec.len() as u32, false),

@ -340,6 +340,7 @@ pub fn inspect_node(ip: String) -> Result<proto::VmNodeListResp, Error> {
Ok(block_on(grpc::get_one_node(req))?)
}
// TODO: this will now depend on the server's ratio
pub fn calculate_nanolp(
vcpus: u32,
memory_mb: u32,