Skip to content

Commit

Permalink
Dump transaction ids
Browse files Browse the repository at this point in the history
  • Loading branch information
akoptelov committed Oct 30, 2023
1 parent b326f96 commit da97478
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions helm/runner/templates/_job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
template:
spec:
restartPolicy: Never
volumes:
- name: tmp
hostPath:
path: /tmp
containers:
- name: main
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand All @@ -13,6 +17,9 @@ template:
{{ include "runner.networkArgs" . | indent 10 }}
{{ include "runner.sendArgs" . | indent 10 }}
]
volumeMounts:
- name: tmp
mountPath: /tmp
{{ end }}

{{ define "runner.loadArgs" }}
Expand Down
10 changes: 9 additions & 1 deletion src/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export const runCommand = new Command()
.addOption(durationOption())
.addOption(infiniteOption())
.addOption(periodOption())
.option(
'--dump-tx-ids <file>',
'dump transaction ids into the specified file upon completion'
)
.addOption(noWaitOption());

LoadRegistry.registerLoadCommand(runCommand, async (opts, load, _name) => {
Expand All @@ -125,13 +129,14 @@ LoadRegistry.registerLoadCommand(runCommand, async (opts, load, _name) => {
duration,
infinite,
period,
dumpTxIds,
wait,
} = opts;

const mina = await MinaBlockchainConnection.create(nodesSource(nodes));
const accounts = new PrivateKeysSource(keys, mina);
const txStore = transactionStore();
const idsStore = await transactionIdsStore();
const idsStore = await FileTransactionIdsStore.create();

const loadGen = new LoadGenerator(mina, accounts);

Expand All @@ -145,6 +150,9 @@ LoadRegistry.registerLoadCommand(runCommand, async (opts, load, _name) => {
rotateSenders: rotateKeys,
rotateNodes,
});
if (dumpTxIds !== undefined) {
idsStore.commit(dumpTxIds);
}
if (wait) {
await loadGen.waitAll(idsStore, {});
}
Expand Down

0 comments on commit da97478

Please sign in to comment.