Skip to content

Commit

Permalink
Add blocksPerMessage as configuration option. (iron-fish#747)
Browse files Browse the repository at this point in the history
* fix: sync only 2 blocks per time

* chore: lint

* chore: lint, remove space
  • Loading branch information
CumpsD authored and NullSoldier committed Jan 10, 2022
1 parent 123837b commit afa7d9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ironfish/src/fileStores/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ export type ConfigOptions = {
* mempool.
*/
defaultTransactionExpirationSequenceDelta: number

/**
* The default number of blocks to request per message when syncing.
*/
blocksPerMessage: number
}

export const ConfigOptionsSchema: yup.ObjectSchema<Partial<ConfigOptions>> = yup
Expand Down Expand Up @@ -172,6 +177,7 @@ export class Config extends KeyStore<ConfigOptions> {
telemetryApi: DEFAULT_TELEMETRY_API,
accountName: DEFAULT_WALLET_NAME,
generateNewIdentity: false,
blocksPerMessage: 20,
}
}
}
1 change: 1 addition & 0 deletions ironfish/src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class IronfishNode {
logger: logger,
peerNetwork: this.peerNetwork,
strategy: this.strategy,
blocksPerMessage: config.get('blocksPerMessage'),
})

this.config.onConfigChange.on((key, value) => this.onConfigChange(key, value))
Expand Down

0 comments on commit afa7d9e

Please sign in to comment.