This commit is contained in:
2025-08-21 17:18:41 +02:00
parent 3f46a35f7b
commit b168d647da
4 changed files with 63 additions and 0 deletions

View File

@@ -12,6 +12,9 @@ pub mut:
country string // 2 letter code as specified in lib/data/countries/data/countryInfo.txt, use that library for validation
capacity NodeCapacity // Hardware capacity details
provisiontime u32 // lets keep it simple and compatible
pubkey string
signature_node string //signature done on node to validate pubkey with privkey
signature_farmer string //signature as done by farmers to validate their identity
}
pub struct DeviceInfo {

View File

@@ -0,0 +1,22 @@
module datamodel
@[heap]
pub struct Reservation {
pub mut:
id u32
customer_id u32 //links back to customer for this capacity
compute_slices []u32
storage_slices []u32
status ReservationStatus
obligation bool //if obligation then will be charged and money needs to be in escrow, otherwise its an intent
start_date u32 //epoch
end_date u32
}
pub enum ReservationStatus {
pending
confirmed
assigned
cancelled
done
}

View File

@@ -0,0 +1,22 @@
module datamodel
// typically 1GB of memory, but can be adjusted based based on size of machine
@[heap]
pub struct ComputeSlice {
pub mut:
nodeid u32 // the node in the grid, there is an object describing the node
id int // the id of the slice in the node
mem_gb f64
storage_gb f64
passmark int
vcores int
cpu_oversubscription int
storage_oversubscription int
price_range []f64 = [0.0, 0.0]
gpus u8 // nr of GPU's see node to know what GPU's are
price_cc f64 // price per slice (even if the grouped one)
pricing_policy PricingPolicy
sla_policy SLAPolicy
}

View File

@@ -0,0 +1,16 @@
module datamodel
// 1GB of storage
@[heap]
pub struct StorageSlice {
pub mut:
nodeid u32 // the node in the grid
id int // the id of the slice in the node, are tracked in the node itself
price_cc f64 // price per slice (even if the grouped one)
pricing_policy PricingPolicy //copied from node which is part of nodegroup
sla_policy SLAPolicy
}