github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/docs/dev-setup/build.md (about)

     1  ## Building the fabric
     2  
     3  The following instructions assume that you have already set up your [development environment](devenv.md).
     4  
     5  To build the Fabric:
     6  
     7  ```
     8  cd $GOPATH/src/github.com/hyperledger/fabric
     9  make dist-clean all
    10  ```
    11  
    12  ### Running the unit tests
    13  
    14  Use the following sequence to run all unit tests
    15  
    16  ```
    17  cd $GOPATH/src/github.com/hyperledger/fabric
    18  make unit-test
    19  ```
    20  
    21  To run a specific test use the `-run RE` flag where RE is a regular expression that matches the test case name. To run tests with verbose output use the `-v` flag. For example, to run the `TestGetFoo` test case, change to the directory containing the `foo_test.go` and call/excecute
    22  
    23  ```
    24  go test -v -run=TestGetFoo
    25  ```
    26  
    27  ### Running Node.js Unit Tests
    28  
    29  You must also run the Node.js unit tests to insure that the Node.js client SDK is not broken by your changes. To run the Node.js unit tests, follow the instructions [here](https://github.com/hyperledger/fabric-sdk-node/README.md).
    30  
    31  ### Running Behave BDD Tests
    32  
    33  **Note:** currently, the behave tests must be run from within in the Vagrant
    34  environment. See the devenv setup instructions if you have not already set up
    35  your [Vagrant environment](devenv.md#Boostrapping-the-VM-using-Vagrant).
    36  
    37  [Behave](http://pythonhosted.org/behave/) tests will setup networks of peers with different security and consensus configurations and verify that transactions run properly. To run these tests
    38  
    39  ```
    40  cd $GOPATH/src/github.com/hyperledger/fabric
    41  make behave
    42  ```
    43  Some of the Behave tests run inside Docker containers. If a test fails and you want to have the logs from the Docker containers, run the tests with this option:
    44  
    45  ```
    46  cd $GOPATH/src/github.com/hyperledger/fabric/bddtests
    47  behave -D logs=Y
    48  ```
    49  
    50  ## Building outside of Vagrant
    51  It is possible to build the project and run peers outside of Vagrant. Generally
    52  speaking, one has to 'translate' the vagrant [setup file](https://github.com/hyperledger/fabric/blob/master/devenv/setup.sh)
    53  to the platform of your choice.
    54  
    55  ### Building on Z
    56  To make building on Z easier and faster, [this script](https://github.com/hyperledger/fabric/tree/master/devenv/setupRHELonZ.sh) is provided (which is similar to the [setup file](https://github.com/hyperledger/fabric/blob/master/devenv/setup.sh) provided for vagrant). This script has been tested only on RHEL 7.2 and has some assumptions one might want to re-visit (firewall settings, development as root user, etc.). It is however sufficient for development in a personally-assigned VM instance.
    57  
    58  To get started, from a freshly installed OS:
    59  ```
    60  sudo su
    61  yum install git
    62  mkdir -p $HOME/git/src/github.com/hyperledger
    63  cd $HOME/git/src/github.com/hyperledger
    64  git clone http://gerrit.hyperledger.org/r/fabric
    65  source fabric/devenv/setupRHELonZ.sh
    66  ```
    67  From this point, you can proceed as described above for the Vagrant development environment.
    68  
    69  ```
    70  cd $GOPATH/src/github.com/hyperledger/fabric
    71  make peer unit-test behave
    72  ```
    73  
    74  ### Building on Power Platform
    75  
    76  Development and build on Power (ppc64le) systems is done outside of vagrant as outlined [here](#building-outside-of-vagrant-). For ease of setting up the dev environment on Ubuntu, invoke [this script](https://github.com/hyperledger/fabric/tree/master/devenv/setupUbuntuOnPPC64le.sh) as root. This script has been validated on Ubuntu 16.04 and assumes certain things (like, development system has OS repositories in place, firewall setting etc) and in general can be improvised further.
    77  
    78  To get started on Power server installed with Ubuntu, first ensure you have properly setup your Host's [GOPATH environment variable](https://github.com/golang/go/wiki/GOPATH). Then, execute the following commands to build the fabric code:
    79  
    80  ```
    81  mkdir -p $GOPATH/src/github.com/hyperledger
    82  cd $GOPATH/src/github.com/hyperledger
    83  git clone http://gerrit.hyperledger.org/r/fabric
    84  sudo ./fabric/devenv/setupUbuntuOnPPC64le.sh
    85  cd $GOPATH/src/github.com/hyperledger/fabric
    86  make dist-clean all
    87  ```
    88  
    89  ## Configuration
    90  
    91  Configuration utilizes the [viper](https://github.com/spf13/viper) and [cobra](https://github.com/spf13/cobra) libraries.
    92  
    93  There is a **core.yaml** file that contains the configuration for the peer process. Many of the configuration settings can be overridden on the command line by setting ENV variables that match the configuration setting, but by prefixing with *'CORE_'*. For example, logging level manipulation through the environment is shown below:
    94  
    95      CORE_PEER_LOGGING_LEVEL=CRITICAL peer
    96  
    97  ## Logging
    98  
    99  Logging utilizes the [go-logging](https://github.com/op/go-logging) library.
   100  
   101  The available log levels in order of increasing verbosity are: *CRITICAL | ERROR | WARNING | NOTICE | INFO | DEBUG*
   102  
   103  See [specific logging control](https://github.com/hyperledger/fabric/blob/master/docs/Setup/logging-control.md) instructions when running the peer process.