start a new wallet for each iteration

This commit is contained in:
Boss Marco 2021-11-03 16:20:55 +01:00
parent dce86113b1
commit 8d9386ac00
No known key found for this signature in database
GPG Key ID: 89A3EC33C625C3DF

View File

@ -41,12 +41,6 @@ export async function runBench1(configJson: any): Promise<void> {
const myHttpLib = new NodeHttpLib();
myHttpLib.setThrottling(false);
const wallet = await getDefaultNodeWallet({
// No persistent DB storage.
persistentStoragePath: undefined,
httpLib: myHttpLib,
});
await wallet.client.call(WalletApiOperation.InitWallet, {});
const numIter = b1conf.iterations ?? 1;
const numDeposits = b1conf.deposits ?? 5;
@ -54,6 +48,17 @@ export async function runBench1(configJson: any): Promise<void> {
const withdrawAmount = (numDeposits + 1) * 10;
for (let i = 0; i < numIter; i++) {
// Create a new wallet in each iteration
// otherwise the TPS go down
// my assumption is that the in-memory db file gets too large
const wallet = await getDefaultNodeWallet({
// No persistent DB storage.
persistentStoragePath: undefined,
httpLib: myHttpLib,
});
await wallet.client.call(WalletApiOperation.InitWallet, {});
await wallet.client.call(WalletApiOperation.WithdrawFakebank, {
amount: b1conf.currency + ":" + withdrawAmount,
bank: b1conf.bank,
@ -74,9 +79,9 @@ export async function runBench1(configJson: any): Promise<void> {
stopWhenDone: true,
});
}
}
wallet.stop();
wallet.stop();
}
}
/**