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

Flexible configuration for chain simulator #21

Closed
wants to merge 7 commits into from

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented Mar 20, 2024

  • added the possibility to alter the node's default configs
  • added the -num-waiting-validators-per-shard and -num-waiting-validators-meta flags
  • added /simulator/generate-blocks-until-epoch-reached endpoint route + .py example
  • added /simulator/force-reset-validator-statistics endpoint route

@iulianpascalau iulianpascalau marked this pull request as ready for review March 20, 2024 13:29
@iulianpascalau iulianpascalau changed the title Added the possibility to alter the node's default configs Flexible configuration for chain simulator Mar 22, 2024
initialWalletsEndpoint = "/simulator/initial-wallets"
setKeyValuesEndpoint = "/simulator/address/:address/set-state"
setStateMultipleEndpoint = "/simulator/set-state"
addValidatorsKeys = "/simulator/add-keys"
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please add also in the README file information about the new endpoints

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot about the README.md, added.



if __name__ == "__main__":
main()
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

miiu96
miiu96 previously approved these changes Mar 22, 2024
sstanculeanu
sstanculeanu previously approved these changes Mar 22, 2024
andreibancioiu
andreibancioiu previously approved these changes Mar 22, 2024
@@ -14,6 +14,11 @@ var (
Usage: "The main configuration file to load",
Value: "./config/config.toml",
}
nodeOverrideConfigurationFile = cli.StringFlag{
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

t.Parallel()

testString := `
# OverridableConfigTomlValues represents an array of items to be overloaded inside other configuration files, which can be helpful
Copy link
Contributor

Choose a reason for hiding this comment

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

Test string can be shorter, to only have a short, dummy comment instead of the full description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made it shorter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made it shorter here #21


def main():
# create a network provider
provider = ProxyNetworkProvider(SIMULATOR_URL)
Copy link
Contributor

Choose a reason for hiding this comment

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

🤩

provider = ProxyNetworkProvider(SIMULATOR_URL)

# generate blocks until we reach the epoch 10
provider.do_post(f"{GENERATE_BLOCKS_UNTIL_EPOCH_REACHED_URL}/10", {})
Copy link
Contributor

Choose a reason for hiding this comment

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

Could have been a constant. But perfectly fine as it is, in this context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added const here: #22

@gabi-vuls gabi-vuls dismissed stale reviews from andreibancioiu, sstanculeanu, and miiu96 via a443fcf March 22, 2024 16:43
@gabi-vuls gabi-vuls force-pushed the chain-simulator-custom-configs branch from 27dfa3e to ba634bd Compare March 23, 2024 10:28
@miiu96 miiu96 changed the base branch from rc/v1.7.0 to chain-simulator-custom-configs-remade March 27, 2024 09:35
Base automatically changed from chain-simulator-custom-configs-remade to rc/v1.7.0 March 27, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants