Commit bbf77f1 1 parent aeb2077 commit bbf77f1 Copy full SHA for bbf77f1
File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,16 @@ pub async fn execute_command(
285
285
std:: process:: exit ( 1 ) ;
286
286
} ;
287
287
288
- match compute_node_ops. add_compute_node ( ) . await {
288
+ let gpu_count: u32 = match & node_config. compute_specs {
289
+ Some ( specs) => specs
290
+ . gpu
291
+ . as_ref ( )
292
+ . map ( |gpu| gpu. count . unwrap_or ( 0 ) )
293
+ . unwrap_or ( 0 ) ,
294
+ None => 0 ,
295
+ } ;
296
+
297
+ match compute_node_ops. add_compute_node ( gpu_count) . await {
289
298
Ok ( added_node) => {
290
299
if added_node {
291
300
// If we are adding a new compute node we wait for a proper
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ impl<'c> ComputeNodeOperations<'c> {
29
29
}
30
30
31
31
// Returns true if the compute node was added, false if it already exists
32
- pub async fn add_compute_node ( & self ) -> Result < bool , Box < dyn std:: error:: Error > > {
32
+ pub async fn add_compute_node (
33
+ & self ,
34
+ gpu_count : u32 ,
35
+ ) -> Result < bool , Box < dyn std:: error:: Error > > {
33
36
Console :: section ( "🔄 Adding compute node" ) ;
34
37
let compute_node = self
35
38
. compute_registry
@@ -77,7 +80,7 @@ impl<'c> ComputeNodeOperations<'c> {
77
80
. as_bytes ( ) ;
78
81
79
82
// Create the signature bytes
80
- let compute_units: U256 = U256 :: from ( 1000 ) ;
83
+ let compute_units: U256 = U256 :: from ( 1000 * gpu_count ) ;
81
84
let add_node_tx = self
82
85
. prime_network
83
86
. add_compute_node ( node_address, compute_units, signature. to_vec ( ) )
You can’t perform that action at this time.
0 commit comments