Skip to content

Commit d2f5e17

Browse files
authored
feat: deprecate debug [timestamp] command (#868)
Signed-off-by: nikolay <[email protected]>
1 parent f68a8e0 commit d2f5e17

20 files changed

+3
-682
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ PLATFORM_JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xlog:gc*:gc.lo
1616
NETWORK_NODE_LOGS_ROOT_PATH=./network-logs/node
1717
APPLICATION_ROOT_PATH=./compose-network/network-node
1818
APPLICATION_CONFIG_PATH=./compose-network/network-node/data/config
19-
RECORD_PARSER_ROOT_PATH=./src/services/record-parser
2019
MIRROR_NODE_CONFIG_PATH=.
2120

2221
#### Network Node Memory Limits ####

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ Available commands:
121121
--balance to set starting hbar balance of the created accounts.
122122
--async to enable or disable asynchronous creation of accounts.
123123
--b or --blocklist to enable or disable account blocklisting. Depending on how many private keys are blocklisted, this will affect the generated on startup accounts.
124-
--enable-debug to enable or disable debugging of the local node [boolean] [default: false]
125124
--network-tag to select custom network node tag [string] [defaults: predefined selected configuration]
126125
--mirror-tag to select custom mirror node tag [string] [defaults: predefined selected configuration]
127126
--relay-tag to select custom hedera-json-rpc relay tag [string] [defaults: predefined selected configuration]
@@ -133,9 +132,6 @@ Available commands:
133132
--h or --host to override the default host.
134133
--balance to set starting hbar balance of the created accounts.
135134
--async to enable or disable asynchronous creation of accounts.
136-
debug [timestamp] - Parses and prints the contents of the record file that has been created
137-
during the selected timestamp.
138-
Important: Local node must be started with the -g, --enable-debug flag to enable this feature
139135
```
140136

141137
Note: Generated accounts are 3 types (ECDSA, Alias ECDSA and ED25519). All of them are usable via HederaSDK. Only Alias ECDSA accounts can be imported into wallet like Metamask or used in ethers.

docker-compose-state-migration.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ services:
5656
- "${APPLICATION_ROOT_PATH}/log4j2.xml:/opt/hgcapp/services-hedera/HapiApp2.0/log4j2.xml"
5757
- "${APPLICATION_ROOT_PATH}/hedera.crt:/opt/hgcapp/services-hedera/HapiApp2.0/hedera.crt"
5858
- "${APPLICATION_ROOT_PATH}/hedera.key:/opt/hgcapp/services-hedera/HapiApp2.0/hedera.key"
59-
- "${RECORD_PARSER_ROOT_PATH}:/opt/hgcapp/recordParser"
6059

6160
minio:
6261
image: minio/minio

docker-compose.multinode.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ services:
6666
- "${APPLICATION_ROOT_PATH}/log4j2.xml:/opt/hgcapp/services-hedera/HapiApp2.0/log4j2.xml"
6767
- "${APPLICATION_ROOT_PATH}/hedera.crt:/opt/hgcapp/services-hedera/HapiApp2.0/hedera.crt"
6868
- "${APPLICATION_ROOT_PATH}/hedera.key:/opt/hgcapp/services-hedera/HapiApp2.0/hedera.key"
69-
- "${RECORD_PARSER_ROOT_PATH}:/opt/hgcapp/recordParser"
7069

7170
network-node-2:
7271
<<: *network-node-definition

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ services:
5656
- "${APPLICATION_ROOT_PATH}/log4j2.xml:/opt/hgcapp/services-hedera/HapiApp2.0/log4j2.xml"
5757
- "${APPLICATION_ROOT_PATH}/hedera.crt:/opt/hgcapp/services-hedera/HapiApp2.0/hedera.crt"
5858
- "${APPLICATION_ROOT_PATH}/hedera.key:/opt/hgcapp/services-hedera/HapiApp2.0/hedera.key"
59-
- "${RECORD_PARSER_ROOT_PATH}:/opt/hgcapp/recordParser"
6059

6160
record-streams-uploader:
6261
image: "${UPLOADER_IMAGE_PREFIX}uploader-mirror:${UPLOADER_IMAGE_TAG}"

src/Errors/LocalNodeErrors.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,4 @@ export const Errors = {
7272
* @returns {LocalNodeErrors} The client error.
7373
*/
7474
CLEINT_ERROR: (msg?: string) => new LocalNodeErrors("Client Error", `Something went wrong, while trying to create SDK Client${msg ? `: ${msg}` : ``}`),
75-
76-
/**
77-
* Create a no record file found error.
78-
* @returns {LocalNodeErrors} The no record file found error.
79-
*/
80-
NO_RECORD_FILE_FOUND_ERROR: () => new LocalNodeErrors('No record file found Error', "This record file doesn't not exist, check if timestamp is correct and local-node was started in debug mode using --enable-debug option"),
81-
82-
/**
83-
* Create an invalid timestamp error.
84-
* @returns {LocalNodeErrors} The invalid timestamp error.
85-
*/
86-
INVALID_TIMESTAMP_ERROR: () => new LocalNodeErrors('Invalid Timestamp Error', 'Invalid timestamp string. Accepted formats are: 0000000000.000000000 and 0000000000-000000000'),
87-
88-
/**
89-
* Create a debug mode check error.
90-
* @returns {LocalNodeErrors} The debug mode check error.
91-
*/
92-
DEBUG_MODE_CHECK_ERROR: () => new LocalNodeErrors('Debug Mode check Error', 'Debug mode is not enabled to use this command. Please use the --enable-debug flag to enable it.'),
9375
}

src/constants.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ export const UNKNOWN_VERSION = "Unknown";
5050
export const NECESSARY_PORTS = [5551, 8545, 5600, 5433, 50211, 8082, 6379];
5151
export const OPTIONAL_PORTS = [7546, 8080, 3000];
5252
export const EVM_ADDRESSES_BLOCKLIST_FILE_RELATIVE_PATH = '../../compose-network/network-node'
53-
export const RELATIVE_TMP_DIR_PATH = 'services/record-parser/temp';
54-
export const RELATIVE_RECORDS_DIR_PATH = 'network-logs/node/recordStreams/record0.0.3';
55-
export const RECORD_PARSER_SOURCE_REL_PATH = '../../src/services/record-parser';
5653
export const NETWORK_NODE_CONFIG_DIR_PATH = 'compose-network/network-node/data/config';
5754
export const APPLICATION_YML_RELATIVE_PATH = 'compose-network/mirror-node/application.yml';
5855
export const MIN_MEMORY_SINGLE_MODE = 4;
@@ -127,10 +124,6 @@ export const INIT_STATE_MIRROR_PROP_SET = `${CHECK_SUCCESS} Needed mirror node p
127124
export const INIT_STATE_NO_NODE_CONF_NEEDED = `${CHECK_SUCCESS} No additional node configuration needed.`;
128125
export const INIT_STATE_NO_ENV_VAR_CONFIGURED = `${CHECK_SUCCESS} No new environment variables were configured.`;
129126

130-
// Debug state
131-
export const DEBUG_STATE_INIT_MESSAGE = `${CHECK_SUCCESS} Debug State Initialized!`;
132-
export const DEBUG_STATE_STARTING_MESSAGE = `${LOADING} Debug State Starting...`;
133-
134127
// StateController
135128
export const STATE_CONTROLLER_MISSING_STATE_CONFIG_ERROR = `${CHECK_FAIL} Something is wrong with state configuration!`;
136129

src/data/StateData.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { NetworkPrepState } from '../state/NetworkPrepState';
2626
import { StartState } from '../state/StartState';
2727
import { StopState } from '../state/StopState';
2828
import { StateConfiguration } from '../types/StateConfiguration';
29-
import { DebugState } from '../state/DebugState';
3029
import { ResourceCreationState } from '../state/ResourceCreationState';
3130

3231
/**
@@ -51,8 +50,6 @@ export class StateData {
5150
return this.getAccountCreationConfiguration();
5251
case 'resourceCreation':
5352
return this.getResourceCreationConfiguration();
54-
case 'debug':
55-
return this.getDebugConfiguration();
5653
default:
5754
return undefined;
5855
}
@@ -141,18 +138,4 @@ export class StateData {
141138
]
142139
};
143140
}
144-
145-
/**
146-
* Get the configuration for the debug state.
147-
* @returns {StateConfiguration} The configuration for the debug state.
148-
* @private
149-
*/
150-
private getDebugConfiguration(): StateConfiguration {
151-
return {
152-
'stateMachineName' : 'debug',
153-
'states' : [
154-
new DebugState()
155-
]
156-
};
157-
}
158141
}

src/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ yargs(hideBin(process.argv))
6363
},
6464
async () => await new StateController("accountCreation").startStateMachine()
6565
)
66-
.command(
67-
"debug [timestamp]",
68-
"Parses and prints the contents of the record file that has been created during the selected timestamp.",
69-
(yargs: yargs.Argv<{}>) => {
70-
CLIService.loadDebugOptions(yargs);
71-
},
72-
async () => await new StateController("debug").startStateMachine()
73-
)
7466
.middleware(Bootstrapper.initialize)
7567
.demandCommand()
7668
.strictCommands()

src/services/CLIService.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,12 @@ export class CLIService implements IService{
8383
CLIService.userComposeOption(yargs);
8484
CLIService.userComposeDirOption(yargs);
8585
CLIService.blocklistingOption(yargs);
86-
CLIService.enableDebugOption(yargs);
8786
CLIService.selectNetworkTag(yargs);
8887
CLIService.selectMirrorTag(yargs);
8988
CLIService.selectRelayTag(yargs);
9089
CLIService.createInitialResources(yargs);
9190
}
9291

93-
/**
94-
* Loads debug options for the CLI service.
95-
* @param {yargs.Argv<{}>} yargs - The yargs instance.
96-
*/
97-
public static loadDebugOptions(yargs: Argv<{}>): void {
98-
CLIService.loadCommonOptions(yargs)
99-
CLIService.timestampOption(yargs);
100-
}
101-
10292
/**
10393
* Loads the account options for the CLI.
10494
* @param {yargs.Argv<{}>} yargs - The yargs instance.
@@ -149,8 +139,6 @@ export class CLIService implements IService{
149139
const blocklisting = argv.blocklist as boolean;
150140
const startup = argv.startup as boolean;
151141
const verbose = CLIService.resolveVerboseLevel(argv.verbose as string);
152-
const timestamp = argv.timestamp as string;
153-
const enableDebug = argv.enableDebug as boolean;
154142
const networkTag = argv.networkTag as string;
155143
const mirrorTag = argv.mirrorTag as string;
156144
const relayTag = argv.relayTag as string;
@@ -171,8 +159,6 @@ export class CLIService implements IService{
171159
blocklisting,
172160
startup,
173161
verbose,
174-
timestamp,
175-
enableDebug,
176162
networkTag,
177163
mirrorTag,
178164
relayTag,
@@ -213,8 +199,6 @@ export class CLIService implements IService{
213199
return false;
214200
case 'generate-accounts':
215201
return false;
216-
case 'debug':
217-
return false;
218202
default:
219203
return true;
220204
};
@@ -276,23 +260,6 @@ export class CLIService implements IService{
276260
});
277261
}
278262

279-
/**
280-
* Adds the 'timestamp' option to the command line arguments.
281-
* This option is a string that records the file timestamp.
282-
* It is required.
283-
*
284-
* @param {yargs.Argv<{}>} yargs - The yargs instance to which the option is added.
285-
* @private
286-
* @static
287-
*/
288-
private static timestampOption(yargs: Argv<{}>): void {
289-
yargs.option('timestamp', {
290-
type: 'string',
291-
describe: 'Record file timestamp',
292-
demandOption: true
293-
});
294-
}
295-
296263
/**
297264
* Adds the 'dev' option to the command line arguments.
298265
* This option is a boolean that enables or disables developer mode.
@@ -469,24 +436,6 @@ export class CLIService implements IService{
469436
default: 'info',
470437
})
471438
}
472-
473-
/**
474-
* Adds the 'enable-debug' option to the command line arguments.
475-
* This option is a boolean that enables or disables debugging of the local node.
476-
* It is not required and defaults to false.
477-
*
478-
* @param {yargs.Argv<{}>} yargs - The yargs instance to which the option is added.
479-
* @private
480-
* @static
481-
*/
482-
private static enableDebugOption(yargs: Argv<{}>): void {
483-
yargs.option('enable-debug', {
484-
type: 'boolean',
485-
describe: 'Enable or disable debugging of the local node',
486-
demandOption: false,
487-
default: false
488-
});
489-
}
490439

491440
/**
492441
* Adds the 'network-tag' option to the command line arguments.

0 commit comments

Comments
 (0)