@@ -689,7 +689,7 @@ export class NodeCommandTasks {
689
689
690
690
// don't try to download from the same node we are deleting, it won't work
691
691
const nodeAlias =
692
- ctx . config . nodeAlias === config . existingNodeAliases [ 0 ]
692
+ ctx . config . nodeAlias === config . existingNodeAliases [ 0 ] && config . existingNodeAliases . length > 1
693
693
? config . existingNodeAliases [ 1 ]
694
694
: config . existingNodeAliases [ 0 ] ;
695
695
@@ -1282,17 +1282,17 @@ export class NodeCommandTasks {
1282
1282
1283
1283
const nodeId = Templates . nodeIdFromNodeAlias ( config . nodeAlias ) - 1 ;
1284
1284
self . logger . info ( `nodeId: ${ nodeId } , config.newAccountNumber: ${ config . newAccountNumber } ` ) ;
1285
- await self . accountManager . refreshNodeClient ( config . namespace , config . nodeAlias ) ;
1286
- config . nodeClient = await this . accountManager . loadNodeClient ( config . namespace ) ;
1285
+ // await self.accountManager.refreshNodeClient(config.namespace, config.nodeAlias);
1286
+ // config.nodeClient = await this.accountManager.loadNodeClient(config.namespace);
1287
1287
1288
1288
try {
1289
- const nodeUpdateTx = new NodeUpdateTransaction ( ) . setNodeId ( nodeId ) ;
1289
+ let nodeUpdateTx = new NodeUpdateTransaction ( ) . setNodeId ( nodeId ) ;
1290
1290
1291
1291
if ( config . tlsPublicKey && config . tlsPrivateKey ) {
1292
1292
self . logger . info ( `config.tlsPublicKey: ${ config . tlsPublicKey } ` ) ;
1293
1293
const tlsCertDer = self . _loadPermCertificate ( config . tlsPublicKey ) ;
1294
1294
const tlsCertHash = crypto . createHash ( 'sha384' ) . update ( tlsCertDer ) . digest ( ) ;
1295
- nodeUpdateTx . setCertificateHash ( tlsCertHash ) ;
1295
+ nodeUpdateTx = nodeUpdateTx . setCertificateHash ( tlsCertHash ) ;
1296
1296
1297
1297
const publicKeyFile = Templates . renderTLSPemPublicKeyFile ( config . nodeAlias ) ;
1298
1298
const privateKeyFile = Templates . renderTLSPemPrivateKeyFile ( config . nodeAlias ) ;
@@ -1303,7 +1303,7 @@ export class NodeCommandTasks {
1303
1303
if ( config . gossipPublicKey && config . gossipPrivateKey ) {
1304
1304
self . logger . info ( `config.gossipPublicKey: ${ config . gossipPublicKey } ` ) ;
1305
1305
const signingCertDer = self . _loadPermCertificate ( config . gossipPublicKey ) ;
1306
- nodeUpdateTx . setGossipCaCertificate ( signingCertDer ) ;
1306
+ nodeUpdateTx = nodeUpdateTx . setGossipCaCertificate ( signingCertDer ) ;
1307
1307
1308
1308
const publicKeyFile = Templates . renderGossipPemPublicKeyFile ( config . nodeAlias ) ;
1309
1309
const privateKeyFile = Templates . renderGossipPemPrivateKeyFile ( config . nodeAlias ) ;
@@ -1312,19 +1312,19 @@ export class NodeCommandTasks {
1312
1312
}
1313
1313
1314
1314
if ( config . newAccountNumber ) {
1315
- nodeUpdateTx . setAccountId ( config . newAccountNumber ) ;
1315
+ nodeUpdateTx = nodeUpdateTx . setAccountId ( config . newAccountNumber ) ;
1316
1316
}
1317
1317
1318
1318
let parsedNewKey ;
1319
1319
if ( config . newAdminKey ) {
1320
1320
parsedNewKey = PrivateKey . fromStringED25519 ( config . newAdminKey . toString ( ) ) ;
1321
- nodeUpdateTx . setAdminKey ( parsedNewKey . publicKey ) ;
1321
+ nodeUpdateTx = nodeUpdateTx . setAdminKey ( parsedNewKey . publicKey ) ;
1322
1322
}
1323
- await nodeUpdateTx . freezeWith ( config . nodeClient ) ;
1323
+ nodeUpdateTx = nodeUpdateTx . freezeWith ( config . nodeClient ) ;
1324
1324
1325
1325
// config.adminKey contains the original key, needed to sign the transaction
1326
1326
if ( config . newAdminKey ) {
1327
- await nodeUpdateTx . sign ( parsedNewKey ) ;
1327
+ nodeUpdateTx = await nodeUpdateTx . sign ( parsedNewKey ) ;
1328
1328
}
1329
1329
const signedTx = await nodeUpdateTx . sign ( config . adminKey ) ;
1330
1330
const txResp = await signedTx . execute ( config . nodeClient ) ;
0 commit comments