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.config
at 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
scope
if there is a function calledrun_<parser.args.command>
and will run it usingparser.args
as 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
– ifscope
doesn’t contain a function calledrun_<parser.args.command>
.
-
bigchaindb.commands.utils.
mongodb_host
(host)[source]¶ Utility function that works as a type for mongodb
host
args.This function validates the
host
args provided by to theadd-replicas
andremove-replicas
commands 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