@@ -530,8 +530,8 @@ export class NodeCommand extends BaseCommand {
530
530
const podName = podNames [ nodeId ]
531
531
subTasks . push ( {
532
532
title : `Update node: ${ chalk . yellow ( nodeId ) } [ platformVersion = ${ releaseTag } ]` ,
533
- task : ( ) =>
534
- platformInstaller . fetchPlatform ( podName , releaseTag )
533
+ task : async ( ) =>
534
+ await platformInstaller . fetchPlatform ( podName , releaseTag )
535
535
} )
536
536
}
537
537
@@ -834,12 +834,12 @@ export class NodeCommand extends BaseCommand {
834
834
if ( self . configManager . getFlag ( flags . app ) !== '' && self . configManager . getFlag ( flags . app ) !== constants . HEDERA_APP_NAME ) {
835
835
subTasks . push ( {
836
836
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
837
- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
837
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
838
838
} )
839
839
} else {
840
840
subTasks . push ( {
841
841
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
842
- task : ( ) => self . checkNetworkNodeState ( nodeId )
842
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId )
843
843
} )
844
844
}
845
845
}
@@ -886,7 +886,7 @@ export class NodeCommand extends BaseCommand {
886
886
const accountId = accountMap . get ( nodeId )
887
887
subTasks . push ( {
888
888
title : `Adding stake for node: ${ chalk . yellow ( nodeId ) } ` ,
889
- task : ( ) => self . addStake ( ctx . config . namespace , accountId , nodeId )
889
+ task : async ( ) => await self . addStake ( ctx . config . namespace , accountId , nodeId )
890
890
} )
891
891
}
892
892
@@ -955,7 +955,7 @@ export class NodeCommand extends BaseCommand {
955
955
const podName = ctx . config . podNames [ nodeId ]
956
956
subTasks . push ( {
957
957
title : `Stop node: ${ chalk . yellow ( nodeId ) } ` ,
958
- task : ( ) => self . k8 . execContainer ( podName , constants . ROOT_CONTAINER , 'systemctl stop network-node' )
958
+ task : async ( ) => await self . k8 . execContainer ( podName , constants . ROOT_CONTAINER , 'systemctl stop network-node' )
959
959
} )
960
960
}
961
961
@@ -1235,12 +1235,12 @@ export class NodeCommand extends BaseCommand {
1235
1235
if ( config . app !== '' && config . app !== constants . HEDERA_APP_NAME ) {
1236
1236
subTasks . push ( {
1237
1237
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1238
- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
1238
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
1239
1239
} )
1240
1240
} else {
1241
1241
subTasks . push ( {
1242
1242
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1243
- task : ( ) => self . checkNetworkNodeState ( nodeId )
1243
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId )
1244
1244
} )
1245
1245
}
1246
1246
}
@@ -1615,6 +1615,7 @@ export class NodeCommand extends BaseCommand {
1615
1615
title : 'Check existing nodes staked amount' ,
1616
1616
task : async ( ctx , task ) => {
1617
1617
const config = /** @type {NodeAddConfigClass } **/ ctx . config
1618
+ self . logger . info ( 'sleep 60 seconds for the handler to be able to trigger the network node stake weight recalculate' )
1618
1619
await sleep ( 60000 )
1619
1620
const accountMap = getNodeAccountMap ( config . existingNodeIds )
1620
1621
for ( const nodeId of config . existingNodeIds ) {
@@ -1729,7 +1730,7 @@ export class NodeCommand extends BaseCommand {
1729
1730
for ( const nodeId of config . existingNodeIds ) {
1730
1731
subTasks . push ( {
1731
1732
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1732
- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
1733
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
1733
1734
} )
1734
1735
}
1735
1736
@@ -1796,8 +1797,8 @@ export class NodeCommand extends BaseCommand {
1796
1797
for ( const nodeId of config . allNodeIds ) {
1797
1798
subTasks . push ( {
1798
1799
title : `Check Node: ${ chalk . yellow ( nodeId ) } ` ,
1799
- task : ( ) =>
1800
- self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
1800
+ task : async ( ) =>
1801
+ await self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
1801
1802
'fullstack.hedera.com/type=network-node' ,
1802
1803
`fullstack.hedera.com/node-name=${ nodeId } `
1803
1804
] , 1 , 60 * 15 , 1000 ) // timeout 15 minutes
@@ -1896,12 +1897,12 @@ export class NodeCommand extends BaseCommand {
1896
1897
title : 'Check all nodes are ACTIVE' ,
1897
1898
task : async ( ctx , task ) => {
1898
1899
const subTasks = [ ]
1899
- // sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string
1900
+ self . logger . info ( ' sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string' )
1900
1901
await sleep ( 30000 )
1901
1902
for ( const nodeId of ctx . config . allNodeIds ) {
1902
1903
subTasks . push ( {
1903
1904
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1904
- task : ( ) => self . checkNetworkNodeState ( nodeId , 200 )
1905
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 200 )
1905
1906
} )
1906
1907
}
1907
1908
@@ -1941,9 +1942,9 @@ export class NodeCommand extends BaseCommand {
1941
1942
} ,
1942
1943
{
1943
1944
title : 'Stake new node' ,
1944
- task : ( ctx , _ ) => {
1945
+ task : async ( ctx , _ ) => {
1945
1946
const config = /** @type {NodeAddConfigClass } **/ ctx . config
1946
- self . addStake ( config . namespace , ctx . newNode . accountId , config . nodeId )
1947
+ await self . addStake ( config . namespace , ctx . newNode . accountId , config . nodeId )
1947
1948
}
1948
1949
} ,
1949
1950
{
@@ -2606,7 +2607,7 @@ export class NodeCommand extends BaseCommand {
2606
2607
for ( const nodeId of config . existingNodeIds ) {
2607
2608
subTasks . push ( {
2608
2609
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
2609
- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
2610
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
2610
2611
} )
2611
2612
}
2612
2613
@@ -2669,6 +2670,9 @@ export class NodeCommand extends BaseCommand {
2669
2670
for ( const /** @type {NetworkNodeServices } **/ service of config . serviceMap . values ( ) ) {
2670
2671
await self . k8 . kubeClient . deleteNamespacedPod ( service . nodePodName , config . namespace , undefined , undefined , 1 )
2671
2672
}
2673
+ self . logger . info ( 'sleep for 15 seconds to give time for pods to finish terminating' )
2674
+ await sleep ( 15000 )
2675
+
2672
2676
// again, the pod names will change after the pods are killed
2673
2677
config . serviceMap = await self . accountManager . getNodeServiceMap (
2674
2678
config . namespace )
@@ -2679,7 +2683,7 @@ export class NodeCommand extends BaseCommand {
2679
2683
}
2680
2684
} ,
2681
2685
{
2682
- title : 'Check node pods are running ' ,
2686
+ title : 'Check node pods are ready ' ,
2683
2687
task :
2684
2688
async ( ctx , task ) => {
2685
2689
const subTasks = [ ]
@@ -2689,11 +2693,11 @@ export class NodeCommand extends BaseCommand {
2689
2693
for ( const nodeId of config . allNodeIds ) {
2690
2694
subTasks . push ( {
2691
2695
title : `Check Node: ${ chalk . yellow ( nodeId ) } ` ,
2692
- task : ( ) =>
2693
- self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
2694
- 'fullstack.hedera.com/type=network-node' ,
2695
- `fullstack.hedera.com/node-name=${ nodeId } `
2696
- ] , 1 , 60 * 15 , 1000 ) // timeout 15 minutes
2696
+ task : async ( ) =>
2697
+ await self . k8 . waitForPodReady (
2698
+ [ 'fullstack.hedera.com/type=network-node' ,
2699
+ `fullstack.hedera.com/node-name=${ nodeId } ` ] ,
2700
+ 1 , 300 , 2000 )
2697
2701
} )
2698
2702
}
2699
2703
@@ -2710,9 +2714,6 @@ export class NodeCommand extends BaseCommand {
2710
2714
title : 'Fetch platform software into network nodes' ,
2711
2715
task :
2712
2716
async ( ctx , task ) => {
2713
- // without this sleep, copy software from local build to container sometimes fail
2714
- await sleep ( 15000 )
2715
-
2716
2717
const config = /** @type {NodeUpdateConfigClass } **/ ctx . config
2717
2718
return self . fetchLocalOrReleasedPlatformSoftware ( config . allNodeIds , config . podNames , config . releaseTag , task , config . localBuildPath )
2718
2719
}
@@ -2761,12 +2762,12 @@ export class NodeCommand extends BaseCommand {
2761
2762
title : 'Check all nodes are ACTIVE' ,
2762
2763
task : async ( ctx , task ) => {
2763
2764
const subTasks = [ ]
2764
- // sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string
2765
+ self . logger . info ( ' sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string' )
2765
2766
await sleep ( 30000 )
2766
2767
for ( const nodeId of ctx . config . allNodeIds ) {
2767
2768
subTasks . push ( {
2768
2769
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
2769
- task : ( ) => self . checkNetworkNodeState ( nodeId , 200 )
2770
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 200 )
2770
2771
} )
2771
2772
}
2772
2773
@@ -3098,7 +3099,7 @@ export class NodeCommand extends BaseCommand {
3098
3099
for ( const nodeId of config . existingNodeIds ) {
3099
3100
subTasks . push ( {
3100
3101
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
3101
- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
3102
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
3102
3103
} )
3103
3104
}
3104
3105
@@ -3157,6 +3158,7 @@ export class NodeCommand extends BaseCommand {
3157
3158
title : 'Check node pods are running' ,
3158
3159
task :
3159
3160
async ( ctx , task ) => {
3161
+ self . logger . info ( 'sleep 20 seconds to give time for pods to come up after being killed' )
3160
3162
await sleep ( 20000 )
3161
3163
const subTasks = [ ]
3162
3164
const config = /** @type {NodeDeleteConfigClass } **/ ctx . config
@@ -3165,8 +3167,8 @@ export class NodeCommand extends BaseCommand {
3165
3167
for ( const nodeId of config . allNodeIds ) {
3166
3168
subTasks . push ( {
3167
3169
title : `Check Node: ${ chalk . yellow ( nodeId ) } ` ,
3168
- task : ( ) =>
3169
- self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
3170
+ task : async ( ) =>
3171
+ await self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
3170
3172
'fullstack.hedera.com/type=network-node' ,
3171
3173
`fullstack.hedera.com/node-name=${ nodeId } `
3172
3174
] , 1 , 60 * 15 , 1000 ) // timeout 15 minutes
@@ -3238,12 +3240,12 @@ export class NodeCommand extends BaseCommand {
3238
3240
title : 'Check all nodes are ACTIVE' ,
3239
3241
task : async ( ctx , task ) => {
3240
3242
const subTasks = [ ]
3241
- // sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string
3243
+ self . logger . info ( ' sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string' )
3242
3244
await sleep ( 30000 )
3243
3245
for ( const nodeId of ctx . config . allNodeIds ) {
3244
3246
subTasks . push ( {
3245
3247
title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
3246
- task : ( ) => self . checkNetworkNodeState ( nodeId , 200 )
3248
+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 200 )
3247
3249
} )
3248
3250
}
3249
3251
@@ -3285,7 +3287,7 @@ export class NodeCommand extends BaseCommand {
3285
3287
title : 'Trigger stake weight calculate' ,
3286
3288
task : async ( ctx , task ) => {
3287
3289
const config = /** @type {NodeDeleteConfigClass } **/ ctx . config
3288
- // sleep 60 seconds for the handler to be able to trigger the network node stake weight recalculate
3290
+ self . logger . info ( ' sleep 60 seconds for the handler to be able to trigger the network node stake weight recalculate' )
3289
3291
await sleep ( 60000 )
3290
3292
const accountMap = getNodeAccountMap ( config . allNodeIds )
3291
3293
// send some write transactions to invoke the handler that will trigger the stake weight recalculate
0 commit comments