Commands

The bdtsim command offers several sub-commands for carrying out simulations and working with the results. Check bdtsim -h for a full list of supported commands and available parameters.

Below you can find more detailed information about available sub-commands:

bulk-execute

bdtsim bulk-execute <bulk configuration> allows running multiple simulations in parallel, using a process pool. Simulations and renderings are defined using a YAML based bulk configuration file. For examples, see the bulk-configurations directory.

The following arguments are available:

  • -p <N>, --processes <N>: number of processes (simulations) to run in parallel; defaults to number of available CPUs

environment-info

bdtsim environment-info <environment> prints some information about the selected environment.

The following arguments are available:

  • --account-file <filename>: Specify account configuration file to be used. When not provided, wallets will be generated randomly and saved. File locations are

    • Linux: $HOME/.config/bdtsim/accounts.yaml
    • Windows: %APPDATA%\bdtsim\accounts.yaml

    File should look like:

accounts:
  operator:
    name: Operator
    privateKey: <operators's private key>
  seller:
    name: Seller
    privateKey: <seller's private key>
  buyer:
    name: Buyer
    privateKey: <buyer's private key>
  • -e <key> <value>/--environment-parameter <key> <value>: Pass parameters (key/values pairs) to the selected environment. Please read the environments documentation for a list of supported parameters, dependent on the selected environment. You can use -e <key> <value> multiple times to pass multiple key value pairs.

list-data-providers

bdtsim list-data-providers prints a list of supported data providers to be used in the simulation. The printed values can be used as data provider argument for the run command.

Please read the data providers documentation for more details.

list-environments

bdtsim list-environments prints a list of supported environments in which simulations can be carried out. The printed values can be used as environment argument for the run command.

Please read the environments documentation for more details.

list-protocols

bdtsim list-protocols prints a list of supported protocols to be simulated. The printed values can be used as protocol argument for the run command.

Please read the protocols documentation for more details.

list-renderers

bdtsim list-renderers prints a list of supported renderers for printing/visualizing simulation results. The listed renderer names can be used as renderer argument for the render command.

Please read the renderers documentation for more details.

render

bdtsim render <renderer> takes a simulation results and converts it into readable and interpretable output. Use the list-renderers command to get a list of available renderers.

The following parameters are available:

  • -i <filename>, --input <filename>: input file with simulation result, defaults to - (read from stdin)
  • --input-compression <true/false>: treat the input as gzip compressed data (after base64 decoding), defaults to true
  • --input-b64encoding <true/false>: decode base64 encoding (done before decompressing), defaults to true
  • -o <filename>, --output <filename>: output file for rendering result, defaults to - (write to stdout)
  • -r <key> <value>, --renderer-parameter <key> <value>: pass additional parameters to the renderer

run

bdtsim run <protocol> <environment> simulates the behavior of a protocol in the given environment. The results are returned in form of a result file, which can be interpreted by the bdtsim render command. The result can either directly written to stdout or written to a result file using the --output parameter (for more information, see parameter details below).

The following additional parameters are available:

  • --account-file <filename>: Specify account configuration file to be used. For details see environment-info command
  • --protocol-path <protocol path>: Limit protocol paths to be simulated (more information/parameter format).
  • --data-provider <data provider>: set the data provider to be used during the simulation
  • --price <price>: set the price for the asset to be traded
  • -p <key> <value>, --protocol-parameter <key> <value>: pass additional parameters to the protocol
  • -e <key> <value>, --environment-parameter <key> <value>: pass additional parameters to the environment
  • -d <key> <value>, --data-provider-parameter <key> <value>: pass additional parameters to the data provider
  • -o <filename>, --output <filename>: write output to the given file, defaults to -(write to stdout)
  • --output-compression <true/false>: do a gzip compression on the generated output (before base64 encoding), defaults to true
  • --output-b64encoding <true/false>: encode the output using the base64 standard (after compression), defaults to true