@@ -456,7 +456,7 @@ export class NodeCommand extends BaseCommand {
456
456
return subTasks
457
457
}
458
458
459
- // TODO: move to KeyManager
459
+ // TODO: duplicate into network deploy
460
460
async initializeSetup ( config , k8 ) {
461
461
// compute other config parameters
462
462
config . keysDir = path . join ( validatePath ( config . cacheDir ) , 'keys' )
@@ -781,7 +781,7 @@ export class NodeCommand extends BaseCommand {
781
781
title : 'Copy Gossip keys to staging' ,
782
782
task : async ( ctx , _ ) => {
783
783
const config = /** @type {NodeSetupConfigClass } **/ ctx . config
784
- await this . copyGossipKeysToStaging ( config . keyFormat , config . keysDir , config . stagingKeysDir , ctx . config . nodeIds )
784
+ await this . keyManager . copyGossipKeysToStaging ( config . keyFormat , config . keysDir , config . stagingKeysDir , ctx . config . nodeIds )
785
785
}
786
786
} ,
787
787
{
@@ -1868,7 +1868,7 @@ export class NodeCommand extends BaseCommand {
1868
1868
task : async ( ctx , _ ) => {
1869
1869
const config = /** @type {NodeAddConfigClass } **/ ctx . config
1870
1870
1871
- await this . copyGossipKeysToStaging ( config . keyFormat , config . keysDir , config . stagingKeysDir , config . allNodeIds )
1871
+ await this . keyManager . copyGossipKeysToStaging ( config . keyFormat , config . keysDir , config . stagingKeysDir , config . allNodeIds )
1872
1872
}
1873
1873
} ,
1874
1874
{
@@ -2133,34 +2133,6 @@ export class NodeCommand extends BaseCommand {
2133
2133
}
2134
2134
}
2135
2135
2136
- // TODO: move to KeyManager
2137
- async copyGossipKeysToStaging ( keyFormat , keysDir , stagingKeysDir , nodeIds ) {
2138
- // copy gossip keys to the staging
2139
- for ( const nodeId of nodeIds ) {
2140
- switch ( keyFormat ) {
2141
- case constants . KEY_FORMAT_PEM : {
2142
- const signingKeyFiles = this . keyManager . prepareNodeKeyFilePaths ( nodeId , keysDir , constants . SIGNING_KEY_PREFIX )
2143
- await this . keyManager . copyNodeKeysToStaging ( signingKeyFiles , stagingKeysDir )
2144
-
2145
- // generate missing agreement keys
2146
- const agreementKeyFiles = this . keyManager . prepareNodeKeyFilePaths ( nodeId , keysDir , constants . AGREEMENT_KEY_PREFIX )
2147
- await this . keyManager . copyNodeKeysToStaging ( agreementKeyFiles , stagingKeysDir )
2148
- break
2149
- }
2150
-
2151
- case constants . KEY_FORMAT_PFX : {
2152
- const privateKeyFile = Templates . renderGossipPfxPrivateKeyFile ( nodeId )
2153
- fs . cpSync ( path . join ( keysDir , privateKeyFile ) , path . join ( stagingKeysDir , privateKeyFile ) )
2154
- fs . cpSync ( path . join ( keysDir , constants . PUBLIC_PFX ) , path . join ( stagingKeysDir , constants . PUBLIC_PFX ) )
2155
- break
2156
- }
2157
-
2158
- default :
2159
- throw new FullstackTestingError ( `Unsupported key-format ${ keyFormat } ` )
2160
- }
2161
- }
2162
- }
2163
-
2164
2136
// Command Definition
2165
2137
/**
2166
2138
* Return Yargs command definition for 'node' command
0 commit comments