Skip to content

Commit

Permalink
Prettier to ignore generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
fboucquez committed May 21, 2021
1 parent 2500a78 commit 11d3b0a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test/reports/**/*.json
2 changes: 1 addition & 1 deletion presets/mainnet/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ votingSetGrouping: 1440
minVotingKeyLifetime: 112
maxVotingKeyLifetime: 360
votingKeyDesiredLifetime: 360
lastKnownNetworkEpoch: 113
lastKnownNetworkEpoch: 131
stepDuration: 5m
maxBlockFutureTime: 300ms
maxAccountRestrictionValues: 100
Expand Down
2 changes: 1 addition & 1 deletion presets/testnet/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ initialCurrencyAtomicUnits: 7842928625000000
importanceGrouping: 180
votingSetGrouping: 720
votingKeyDesiredLifetime: 720
lastKnownNetworkEpoch: 122
lastKnownNetworkEpoch: 151
minVotingKeyLifetime: 28
maxVotingKeyLifetime: 720
stepDuration: 4m
Expand Down
14 changes: 2 additions & 12 deletions src/service/VotingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import LoggerFactory from '../logger/LoggerFactory';
import { ConfigPreset, NodeAccount, NodePreset } from '../model';
import { BootstrapUtils } from './BootstrapUtils';
import { ConfigParams } from './ConfigService';
import { VotingKeyFile, VotingUtils } from './VotingUtils';
import { VotingUtils } from './VotingUtils';

type VotingParams = ConfigParams;

Expand All @@ -35,15 +35,6 @@ export class VotingService {
public async run(presetData: ConfigPreset, nodeAccount: NodeAccount, nodePreset: NodePreset | undefined): Promise<void> {
const symbolServerToolsImage = presetData.symbolServerToolsImage;

function logVotingKeyFiles(currentVotingFiles: VotingKeyFile[]) {
const log = currentVotingFiles
.map((value) => {
return `${value.filename}, Voting Public Key ${value.publicKey}, Start Epoch: ${value.startEpoch}, End Epoch: ${value.endEpoch}`;
})
.join('\n');
logger.info(`Current Voting files:\n${log}`);
}

if (nodePreset?.voting) {
const target = this.params.target;
const votingKeysFolder = join(
Expand All @@ -59,7 +50,6 @@ export class VotingService {
currentVotingFiles[currentVotingFiles.length - 1]?.endEpoch || presetData.lastKnownNetworkEpoch - 1;
const votingKeyDesiredFutureLifetime = presetData.votingKeyDesiredFutureLifetime || presetData.votingKeyDesiredLifetime / 2;
if (maxVotingKeyEndEpoch > presetData.lastKnownNetworkEpoch + votingKeyDesiredFutureLifetime) {
logVotingKeyFiles(currentVotingFiles);
nodeAccount.voting = currentVotingFiles;
return;
}
Expand Down Expand Up @@ -100,7 +90,7 @@ export class VotingService {
throw new Error('Voting key failed. Check the logs!');
}
}
logger.warn(`A new Voting File for the node ${nodeAccount.name} has been regenerated! `);
logger.warn(`A new Voting File for the node ${nodeAccount.name} has been generated! `);
logger.warn(
`Remember to send a Voting Key Link transaction from main ${nodeAccount.main.address} using the Voting Public Key: ${votingAccount.publicKey} with startEpoch: ${votingKeyStartEpoch} and endEpoch: ${votingKeyEndEpoch}`,
);
Expand Down
2 changes: 2 additions & 0 deletions test/supernode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ lastKnownNetworkEpoch: 70
votingKeyDesiredLifetime: 28 # create short voting key files, 28 is the minimun
votingKeyDesiredFutureLifetime: 300 # create files for at least 60 epochs in the future, this will create voting key file 2 and file 3
useExperimentalNativeVotingKeyGeneration: true # Use new native ts generation
symbolServerImage: symbolplatform/symbol-server-private:gcc-voting-key-unlink-rollback-f2633f4a4c
symbolRestImage: 'symbolplatform/symbol-rest:2.3.6-alpha'
nodes:
- voting: true
rewardProgram: 'supernode'
Expand Down

0 comments on commit 11d3b0a

Please sign in to comment.