github.com/osdi23p228/fabric@v0.0.0-20221218062954-77808885f5db/docs/source/dev-setup/build.rst (about)

     1  Building Hyperledger Fabric
     2  ---------------------------
     3  
     4  The following instructions assume that you have already set up your
     5  :doc:`development environment <devenv>`.
     6  
     7  To build Hyperledger Fabric:
     8  
     9  ::
    10  
    11      make dist-clean all
    12  
    13  Building the documentation
    14  ~~~~~~~~~~~~~~~~~~~~~~~~~~
    15  
    16  If you are contributing to the documentation, you can build the Fabric
    17  documentation on your local machine. This allows you to check the formatting
    18  of your changes using your web browser before you open a pull request.
    19  
    20  You need to download the following prerequisites before you can build the
    21  documentation:
    22  
    23  - `Python 3.7 <https://wiki.python.org/moin/BeginnersGuide/Download>`__
    24  - `Pipenv <https://pipenv.readthedocs.io/en/latest/#install-pipenv-today>`__
    25  
    26  After you make your updates to the documentation source files, you can generate
    27  a build that includes your changes by running the following commands:
    28  
    29  ::
    30  
    31      cd fabric/docs
    32      pipenv install
    33      pipenv shell
    34      make html
    35  
    36  This will generate all the html files in the ``docs/build/html`` folder. You can
    37  open any file to start browsing the updated documentation using your browser. If you
    38  want to make additional edits to the documentation, you can rerun ``make html``
    39  to incorporate the changes.
    40  
    41  Running the unit tests
    42  ~~~~~~~~~~~~~~~~~~~~~~
    43  
    44  Use the following command to run all unit tests:
    45  
    46  ::
    47  
    48      make unit-test
    49  
    50  To run a subset of tests, set the TEST_PKGS environment variable.
    51  Specify a list of packages (separated by space), for example:
    52  
    53  ::
    54  
    55      export TEST_PKGS="github.com/osdi23p228/fabric/core/ledger/..."
    56      make unit-test
    57  
    58  To run a specific test use the ``-run RE`` flag where RE is a regular
    59  expression that matches the test case name. To run tests with verbose
    60  output use the ``-v`` flag. For example, to run the ``TestGetFoo`` test
    61  case, change to the directory containing the ``foo_test.go`` and
    62  call/execute
    63  
    64  ::
    65  
    66      go test -v -run=TestGetFoo
    67  
    68  
    69  Running Node.js Client SDK Unit Tests
    70  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    71  
    72  You must also run the Node.js unit tests to ensure that the Node.js
    73  client SDK is not broken by your changes. To run the Node.js unit tests,
    74  follow the instructions
    75  `here <https://github.com/hyperledger/fabric-sdk-node/blob/master/README.md>`__.
    76  
    77  Configuration
    78  -------------
    79  
    80  Configuration utilizes the `viper <https://github.com/spf13/viper>`__
    81  and `cobra <https://github.com/spf13/cobra>`__ libraries.
    82  
    83  There is a **core.yaml** file that contains the configuration for the
    84  peer process. Many of the configuration settings can be overridden on
    85  the command line by setting ENV variables that match the configuration
    86  setting, but by prefixing with *'CORE\_'*. For example, setting
    87  `peer.networkId` can be accomplished with:
    88  
    89  ::
    90  
    91      CORE_PEER_NETWORKID=custom-network-id peer
    92  
    93  .. Licensed under Creative Commons Attribution 4.0 International License
    94     https://creativecommons.org/licenses/by/4.0/