Command Line Interface¶
bigchaindb.commands.bigchaindb¶
Implementation of the bigchaindb command, the command-line interface (CLI) for BigchainDB Server.
-
bigchaindb.commands.bigchaindb.run_configure(args, skip_if_exists=False)[source]¶ Run a script to configure the current node.
Parameters: skip_if_exists (bool) – skip the function if a config file already exists
bigchaindb.commands.utils¶
Utility functions and basic common arguments
for argparse.ArgumentParser.
-
bigchaindb.commands.utils.configure_bigchaindb(command)[source]¶ Decorator to be used by command line functions, such that the configuration of bigchaindb is performed before the execution of the command.
Parameters: command – The command to decorate. Returns: The command wrapper function.
-
bigchaindb.commands.utils.start_logging_process(command)[source]¶ Decorator to start the logging subscriber process.
Parameters: command – The command to decorate. Returns: The command wrapper function. Important
Configuration, if needed, should be applied before invoking this decorator, as starting the subscriber process for logging will configure the root logger for the child process based on the state of
bigchaindb.configat the moment this decorator is invoked.
-
bigchaindb.commands.utils.input_on_stderr(prompt='', default=None, convert=None)[source]¶ Output a string to stderr and wait for input.
Parameters:
-
bigchaindb.commands.utils.start_rethinkdb()[source]¶ Start RethinkDB as a child process and wait for it to be available.
Raises: :class:`~bigchaindb.common.exceptions.StartupError` if – RethinkDB cannot be started.
-
bigchaindb.commands.utils.start(parser, argv, scope)[source]¶ Utility function to execute a subcommand.
The function will look up in the
scopeif there is a function calledrun_<parser.args.command>and will run it usingparser.argsas first positional argument.Parameters: - parser – an ArgumentParser instance.
- argv – the list of command line arguments without the script name.
- scope (dict) – map containing (eventually) the functions to be called.
Raises: NotImplementedError– ifscopedoesn’t contain a function calledrun_<parser.args.command>.
-
bigchaindb.commands.utils.mongodb_host(host)[source]¶ Utility function that works as a type for mongodb
hostargs.This function validates the
hostargs provided by to theadd-replicasandremove-replicascommands and checks if each arg is in the form “host:port”Parameters: host (str) – A string containing hostname and port (e.g. “host:port”) Raises: ArgumentTypeError– if it fails to parse the argument