Created main.py file for simulation runner and added json example
This commit is contained in:
parent
e38cef5b52
commit
fb2415ea7a
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"consensus_settings": {
|
||||
"snow_ball": {
|
||||
"quorum_size": 14,
|
||||
"sample_size": 20,
|
||||
"decision_threshold": 20
|
||||
}
|
||||
},
|
||||
"distribution": {
|
||||
"yes": 0.6,
|
||||
"no": 0.4,
|
||||
"none": 0.0
|
||||
},
|
||||
"byzantine_settings": {
|
||||
"total_size": 10000,
|
||||
"distribution": {
|
||||
"honest": 1.0,
|
||||
"infantile": 0.0,
|
||||
"random": 0.0,
|
||||
"omniscient": 0.0
|
||||
}
|
||||
},
|
||||
"wards": [
|
||||
{
|
||||
"time_to_finality": {
|
||||
"ttf_threshold" : 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"network_modifiers": [
|
||||
{
|
||||
"random_drop": {
|
||||
"drop_rate": 0.01
|
||||
}
|
||||
}
|
||||
],
|
||||
"seed" : 18042022
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
# Python Imports
|
||||
import typer
|
||||
|
||||
# Project Imports
|
||||
from Utilities.file_parser import ConfigurationFileParser
|
||||
|
||||
|
||||
def main(
|
||||
# todo put in output format possible names (-f --output-format)
|
||||
output_format: str = typer.Argument("parquet"),
|
||||
input_settings: str = typer.Option(..., "--input-settings", "-i"),
|
||||
output_file: str = typer.Option(..., "--output-file", "-o")
|
||||
):
|
||||
# Check config file
|
||||
parser = ConfigurationFileParser(input_settings)
|
||||
config = parser.read_content()
|
||||
# Calls simulation with configuration
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
typer.run(main)
|
||||
|
||||
# Run simulation with arguments
|
||||
|
||||
pass
|
Loading…
Reference in New Issue