Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add missing config values to mapper #405

Conversation

georgi-l95
Copy link
Contributor

Description:
This PR makes the following changes:

  • On the server side adds the following missing configs to the mapper:
    • producer.type → PRODUCER_TYPE (default: "PRODUCTION")
    • mediator.type → MEDIATOR_TYPE (default: "PRODUCTION")
  • On the simulator side adds the following missing configs to the mapper:
    • From GrpcConfig.java:
      • grpc.serverAddress (default: "localhost")
      • grpc.port (default: 8080)
    • From BlockStreamConfig.java:
      • blockStream.simulatorMode (default: "PUBLISHER")
      • blockStream.delayBetweenBlockItems (default: 1_500_000)
      • blockStream.maxBlockItemsToStream (default: 100_000)
      • blockStream.streamingMode (default: "MILLIS_PER_BLOCK")
      • blockStream.millisecondsPerBlock (default: 1000)
      • blockStream.blockItemsBatchSize (default: 1000)
    • From BlockGeneratorConfig.java:
      • generator.generationMode (default: "DIR")
      • generator.folderRootPath (default: "")
      • generator.managerImplementation (default: "BlockAsFileBlockStreamManager")
      • generator.paddedLength (default: 36)
      • generator.fileExtension (default: ".blk.gz")
      • generator.startBlockNumber (default: 1)
      • generator.endBlockNumber (default: -1)

Additional external variables added to both are:

  • prometheus.endpointEnabled (default: true)
  • prometheus.endpointPortNumber (default: 9999)

Adds two new gradle tasks for the simulator:

  • runPublisher (starts simulator in Publisher mode with enabled prometheus on port 9998)
  • runConsumer (starts simulator in Consumer mode with enabled prometheus on port 9997)

Related issue(s):

Fixes #285

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@georgi-l95 georgi-l95 added Simulator Issue related to Block Stream Simulator Block Node Issues/PR related to the Block Node. labels Dec 13, 2024
@georgi-l95 georgi-l95 added this to the 0.3.0 milestone Dec 13, 2024
@georgi-l95 georgi-l95 self-assigned this Dec 13, 2024
@georgi-l95 georgi-l95 requested a review from a team as a code owner December 13, 2024 09:12
@georgi-l95 georgi-l95 linked an issue Dec 13, 2024 that may be closed by this pull request
2 tasks
@georgi-l95 georgi-l95 changed the title add missing config values to mapper chore: Add missing config values to mapper Dec 13, 2024
Copy link
Contributor

@mattp-swirldslabs mattp-swirldslabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. LGTM.

simulator/build.gradle.kts Show resolved Hide resolved
Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@georgi-l95 georgi-l95 merged commit 6c75418 into main Dec 13, 2024
13 of 19 checks passed
@georgi-l95 georgi-l95 deleted the 285-chore-add-all-newer-configuration-items-to-environment-variable-mapping branch December 13, 2024 18:50
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.97%. Comparing base (a81b59b) to head (4be2a3b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #405   +/-   ##
=========================================
  Coverage     96.96%   96.97%           
- Complexity      395      397    +2     
=========================================
  Files            79       80    +1     
  Lines          1417     1421    +4     
  Branches         93       93           
=========================================
+ Hits           1374     1378    +4     
  Misses           32       32           
  Partials         11       11           
Files with missing lines Coverage Δ
...er/config/ServerMappedConfigSourceInitializer.java 100.00% <ø> (ø)
...config/SimulatorMappedConfigSourceInitializer.java 100.00% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Block Node Issues/PR related to the Block Node. Simulator Issue related to Block Stream Simulator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: Add all newer configuration items to Environment Variable mapping.
3 participants