Skip to content

Commit a8711a8

Browse files
feat: node log command also download config.txt and settings.txt (#342)
Signed-off-by: Jeffrey Tang <[email protected]>
1 parent 7462ce1 commit a8711a8

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

resources/templates/settings.txt

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
checkSignedStateFromDisk, 1
22
csvFileName, MainNetStats
3-
csvOutputFolder, data/stats
43
doUpnp, false
5-
enableEventStreaming, true
6-
eventsLogDir, /opt/hgcapp/eventsStreams
7-
eventsLogPeriod, 5
8-
maxEventQueueForCons, 1000
9-
maxOutgoingSyncs, 8
10-
numConnections, 1000
4+
loadKeysFromPfxFiles, 0
5+
maxOutgoingSyncs, 1
116
reconnect.active, 1
12-
reconnect.asyncStreamTimeoutMilliseconds, 60000
137
reconnect.reconnectWindowSeconds, -1
148
showInternalStats, 1
15-
state.saveStatePeriod, 900
16-
state.signedStateDisk, 5
17-
throttle7extra, 0.5
9+
state.saveStatePeriod, 300
1810
useLoopbackIp, false
1911
waitAtStartup, false
20-
jasperDb.iteratorInputBufferBytes, 16777216
21-
prometheusEndpointEnabled, true
22-
transactionMaxBytes, 6144
23-
loadKeysFromPfxFiles, true
24-
crypto.enableNewKeyStoreModel, true
25-
12+
state.mainClassNameOverride, com.hedera.services.ServicesMain
13+
maxEventQueueForCons, 1000
14+
merkleDb.hashesRamToDiskThreshold, 8388608
15+
event.creation.maxCreationRate, 20

src/commands/node.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ export class NodeCommand extends BaseCommand {
10841084
])
10851085

10861086
ctx.config = {
1087+
namespace: self.configManager.getFlag(flags.namespace),
10871088
nodeIds: helpers.parseNodeIds(self.configManager.getFlag(flags.nodeIDs))
10881089
}
10891090
self.logger.debug('Initialized config', { config: ctx.config })
@@ -1092,7 +1093,7 @@ export class NodeCommand extends BaseCommand {
10921093
{
10931094
title: 'Copy logs from all nodes',
10941095
task: (ctx, _) => {
1095-
getNodeLogs(this.k8, flags.namespace)
1096+
getNodeLogs(this.k8, ctx.config.namespace)
10961097
}
10971098
}
10981099
], {

src/core/helpers.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ export async function getNodeLogs (k8, namespace) {
203203
fs.mkdirSync(targetDir, { recursive: true })
204204
await k8.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/output/swirlds.log`, targetDir)
205205
await k8.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/output/hgcaa.log`, targetDir)
206+
await k8.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/config.txt`, targetDir)
207+
await k8.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/settings.txt`, targetDir)
206208
} catch (e) {
207209
// not throw error here, so we can continue to finish downloading logs from other pods
208210
// and also delete namespace in the end

0 commit comments

Comments
 (0)