diff --git a/sphinx/source/operators/start_network.rst b/sphinx/source/operators/start_network.rst index 5d47495a0e0c..61284dc33d67 100644 --- a/sphinx/source/operators/start_network.rst +++ b/sphinx/source/operators/start_network.rst @@ -73,6 +73,43 @@ If the network has already been opened to users, members need to trust the joini .. note:: When starting up the network or when joining an existing network, the secrets required to decrypt the ledger are sealed and written to a file so that the network can later be recovered. See :ref:`operators/recovery:Catastrophic Recovery` for more details on how to recover a crashed network. .. note:: If starting up the network with PBFT enabled as the consensus protocol, be sure to add the ``--consensus pbft`` CLI argument when starting up the node. For more info on the provided consensus protocols please see :ref:`here ` +Using a Configuration File +-------------------------- + +``cchost`` can be started using a configuration file in TOML or INI format. + +.. code-block:: toml + + # config.toml + enclave-file = + enclave-type = debug + consensus = raft + node-address = + rpc-address = + public-rpc-address = + + [] + network-cert-file = + member-info = "," + gov-script = + +.. code-block:: ini + + ; config.ini + enclave-file = + enclave-type = debug + consensus = raft + node-address = + rpc-address = + public-rpc-address = + + [] + network-cert-file = + member-info = "," + gov-script = + +To pass configuration files, use the ``--config`` option: ``./cchost --config=config.ini``. An error will be generated if the configuration file contains extra fields. Options in the configuration file will be read along with normal command line arguments. Additional information for configuration files in CLI11 can be found `here `_. + Opening a Network to Users -------------------------- diff --git a/sphinx/source/quickstart/index.rst b/sphinx/source/quickstart/index.rst index 6f895873b5cc..840727160e33 100644 --- a/sphinx/source/quickstart/index.rst +++ b/sphinx/source/quickstart/index.rst @@ -20,7 +20,7 @@ Once this is done, you can quickly spin up a CCF network and start :ref:`issuing [2019-10-29 14:48:12.138] See https://microsoft.github.io/CCF/users/issue_commands.html for more information. [2019-10-29 14:48:12.138] Press Ctrl+C to shutdown the network. -You should also get familiar with some of :ref:`concepts:CCF's concepts`. You will then be able to: +You should also get familiar with some of :ref:`CCF's concepts `. You will then be able to: 1. :ref:`Create a consortium and agree on the constitution ` 2. :ref:`Develop a CCF application, based on the example logging application ` diff --git a/src/host/main.cpp b/src/host/main.cpp index f4b5a5f8809a..d1516c7d1acc 100644 --- a/src/host/main.cpp +++ b/src/host/main.cpp @@ -36,6 +36,9 @@ int main(int argc, char** argv) CLI::App app{"ccf"}; + app.set_config("--config", "", "Read an INI or TOML file", false); + app.allow_config_extras(false); + app.require_subcommand(1, 1); std::string enclave_file; @@ -263,6 +266,8 @@ int main(int argc, char** argv) std::string network_enc_pubk_file = "network_enc_pubk.pem"; auto start = app.add_subcommand("start", "Start new network"); + start->configurable(); + start ->add_option( "--network-cert-file", @@ -299,6 +304,8 @@ int main(int argc, char** argv) ->required(); auto join = app.add_subcommand("join", "Join existing network"); + join->configurable(); + join ->add_option( "--network-cert-file", @@ -325,6 +332,8 @@ int main(int argc, char** argv) ->required(); auto recover = app.add_subcommand("recover", "Recover crashed network"); + recover->configurable(); + recover ->add_option( "--network-cert-file",