github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docs/source/cli/sawadm.rst (about)

     1  ..
     2     Copyright 2017 Intel Corporation
     3  
     4     Licensed under the Apache License, Version 2.0 (the "License");
     5     you may not use this file except in compliance with the License.
     6     You may obtain a copy of the License at
     7  
     8         http://www.apache.org/licenses/LICENSE-2.0
     9  
    10     Unless required by applicable law or agreed to in writing, software
    11     distributed under the License is distributed on an "AS IS" BASIS,
    12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13     See the License for the specific language governing permissions and
    14     limitations under the License.
    15  
    16  .. _sawadm-reference-label:
    17  
    18  ******
    19  sawadm
    20  ******
    21  
    22  The ``sawadm`` command is used for Sawtooth administration tasks.
    23  The ``sawadm`` subcommands create validator keys during
    24  initial configuration and help create the genesis block when
    25  initializing a validator.
    26  
    27  .. literalinclude:: output/sawadm_usage.out
    28     :language: console
    29  
    30  sawadm genesis
    31  ==============
    32  
    33  The ``sawadm genesis`` subcommand produces a file for use during the
    34  initialization of a validator. A network requires an initial block (known as the
    35  `genesis block`) whose signature will determine the blockchain ID. This initial
    36  block is produced from a list of batches, which will be applied at
    37  genesis time.
    38  
    39  The optional argument `input_file` specifies one or more files containing
    40  serialized ``BatchList`` protobuf messages to add to the genesis data. (Use a
    41  space to separate multiple files.) If no input file is specified,
    42  ``sawadm keygen`` produces an empty genesis block.
    43  
    44  The output is a file containing a serialized ``GenesisData`` protobuf message.
    45  This file, when placed at `sawtooth_data`/``genesis.batch``, will trigger
    46  the genesis process.
    47  
    48  .. Note::
    49  
    50    The location of `sawtooth_data` depends on whether the
    51    environment variable ``SAWTOOTH_HOME`` is set. If it is, then
    52    `sawtooth_data` is located at ``SAWTOOTH_HOME/data``. If it is
    53    not, then `sawtooth_data` is located at ``/var/lib/sawtooth``.
    54  
    55  When ``sawadm genesis`` runs, it displays the path and filename of the
    56  target file where the serialized ``GenesisData`` is written. (Default:
    57  `sawtooth_data`/``genesis.batch``.) For example:
    58  
    59  .. code-block:: console
    60  
    61      $ sawadm genesis config.batch mktplace.batch
    62      Generating /var/lib/sawtooth/genesis.batch
    63  
    64  Use ``--output`` `filename` to specify a different name for the target file.
    65  
    66  .. literalinclude:: output/sawadm_genesis_usage.out
    67     :language: console
    68  
    69  
    70  sawadm keygen
    71  =============
    72  
    73  The ``sawadm keygen`` subcommand generates keys that the validator uses to
    74  sign blocks. This system-wide key must be created during Sawtooth
    75  configuration.
    76  
    77  Validator keys are stored in the directory ``/etc/sawtooth/keys/``. By
    78  default, the public-private key files are named ``validator.priv`` and
    79  validator.pub. Use the <key-name> argument to specify a different file
    80  name.
    81  
    82  .. literalinclude:: output/sawadm_keygen_usage.out
    83     :language: console
    84  
    85  .. Licensed under Creative Commons Attribution 4.0 International License
    86  .. https://creativecommons.org/licenses/by/4.0/