Skip to content

Commit 0716064

Browse files
transfer from GitHub hyperledger/fabric
Copied from commit sha 346f9fb448140e931fed73b46f528de6dacbc0d0 to Gerrit. Verified that all DCO signoff received or IBM contribution. Change-Id: I812a2f48382a3cd37e153cd056d0ea94b7f416a0 Signed-off-by: Christopher Ferris <[email protected]>
1 parent a0f4c0d commit 0716064

File tree

1,161 files changed

+379596
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,161 files changed

+379596
-0
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
obc-peer
2+
.git

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.sh text eol=lf
2+
*.go text eol=lf
3+
*.yaml text eol=lf
4+
*.yml text eol=lf
5+
*.md text eol=lf
6+
*.json text eol=lf
7+
*.proto text eol=lf
8+
*.py text eol=lf
9+
*.js text eol=lf
10+
*.txt text eol=lf
11+
LICENSE text eol=lf

.github/ISSUE_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- For general purpose questions, use Stack Overflow http://stackoverflow.com/questions/tagged/hyperledger -->
2+
3+
## Description
4+
<!-- Describe your issue or user story in detail -->
5+
6+
## Describe How to Reproduce
7+
<!-- If an issue, provide sufficient context and steps to reproduce the issue -->

.github/PULL_REQUEST_TEMPLATE.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!-- Describe your changes in detail. -->
5+
6+
## Motivation and Context
7+
<!-- Why is this change required? What problem does it solve? -->
8+
<!-- If it fixes an open issue, please link to the issue here. -->
9+
Fixes #
10+
11+
## How Has This Been Tested?
12+
<!-- If this PR does not contain a new test case, explain why. -->
13+
<!-- Describe in detail how you tested your changes. -->
14+
15+
## Checklist:
16+
<!-- To check a box, and an 'x': [x] -->
17+
<!-- To uncheck box, add a space: [ ] -->
18+
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
19+
- [] I have added a [Signed-off-by](https://github.com/hyperledger/fabric/blob/master/CONTRIBUTING.md#legal-stuff).
20+
- [] I have either added documentation to cover my changes or this change requires no new documentation.
21+
- [] I have either added unit tests to cover my changes or this change requires no new tests.
22+
- [] I have run [golint](https://github.com/golang/lint) and have fixed valid warnings in code I have added or modified. This tool generates false positives so you may choose to ignore some warnings. The goal is clean, consistent, and readable code.
23+
24+
<!-- The continuous integration build process will run [make checks](https://github.com/hyperledger/fabric/blob/master/Makefile#L22) to confirm that tests pass and that code quality meets minimum standards. You may optionally run this locally as PRs will not be accepted until they pass. -->
25+
26+
Signed-off-by:

.gitignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Local build binaries
2+
node-cli/node-cli
3+
*.pyc
4+
/build/*
5+
/bin
6+
.idea
7+
*.iml
8+
.DS_Store
9+
tags
10+
.tags
11+
.vagrant/
12+
/build
13+
# Emacs backup files
14+
*~
15+
*#
16+
.#*
17+
# bddtest log files
18+
*.log
19+
# bddtest coverage files
20+
bddtests/coverage
21+
*.cov
22+
# Makefile dummy artifacts
23+
.*-dummy
24+
# go-carpet output files
25+
go-carpet-coverage*
26+
# make node-sdk copied files
27+
sdk/node/lib/protos/*

.travis.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
language: go
2+
go:
3+
- 1.6
4+
sudo: required
5+
services:
6+
- docker
7+
env:
8+
- TEST_TARGET=unit-test
9+
- TEST_TARGET=behave
10+
11+
before_install:
12+
13+
- echo "Starting Docker Daemon "
14+
- |
15+
export TR_PULL_REQUEST="$TRAVIS_PULL_REQUEST" && export GIT_USER="$TRAVIS_REPO_SLUG"
16+
USER_NAME="$(echo $GIT_USER | cut -d '/' -f 1)" && REPO_NAME="$(echo $GIT_USER | cut -d '/' -f 2)"
17+
ip="$(ifconfig docker0 | grep "inet addr:" | awk '{print $2}' | cut -d ':' -f 2)"
18+
port="$(ps -ef | grep docker | awk '{print $11}' | cut -d ':' -f 3)"
19+
sudo stop docker
20+
sudo docker daemon -H tcp://0.0.0.0:$port -H unix:///var/run/docker.sock >> dockerlogfile.log 2>&1 &
21+
22+
install:
23+
24+
- echo " INSTALLING DEPENDENCIES "
25+
- |
26+
cd $HOME/gopath/src/github.com/$USER_NAME/$REPO_NAME/scripts/provision/ && chmod +x host.sh && sudo ./host.sh
27+
echo " Installing Rocks DB, g++ compilers & Dependencies "
28+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get -qq update && sudo apt-get -qq install g++-4.8 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
29+
sudo apt-get install build-essential -y
30+
sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev
31+
cd /tmp
32+
git clone --branch v4.1 --single-branch --depth 1 https://github.com/facebook/rocksdb.git
33+
cd rocksdb
34+
make shared_lib
35+
sudo INSTALL_PATH=/usr/local make install-shared
36+
sudo ldconfig
37+
38+
before_script:
39+
40+
- echo " CREATING BASE IMAGE "
41+
- cd $HOME/gopath/src/github.com/$USER_NAME/$REPO_NAME/scripts && chmod +x foldercopy.sh && ./foldercopy.sh $TR_PULL_REQUEST $USER_NAME $REPO_NAME
42+
- sudo rm -rf /var/hyperledger/ && sudo mkdir /var/hyperledger/ && sudo chown $USER:$USER /var/hyperledger
43+
- cd /$HOME/gopath/src/github.com/hyperledger/fabric
44+
- make linter
45+
46+
script:
47+
48+
- echo "Executing Tests"
49+
- cd $HOME/gopath/src/github.com/hyperledger/fabric
50+
- sed -i -e 's/172.17.0.1:2375\b/'"$ip:$port"'/g' $HOME/gopath/src/github.com/hyperledger/fabric/bddtests/compose-defaults.yml
51+
- export BEHAVE_OPTS="-D logs=Y -o testsummary.log" #Defined to both jobs.
52+
- make $TEST_TARGET
53+
54+
after_failure:
55+
56+
- |
57+
echo "Click below links to view behave container log files"
58+
cd $HOME/gopath/src/github.com/hyperledger/fabric
59+
chmod +x scripts/containerlogs.sh
60+
sudo ./scripts/containerlogs.sh
61+
62+
notifications:
63+
64+
slack: 'hyperledgerproject:azMP8Mw3cfGigXkqi5RujZXr'
65+
on_success: always
66+
on_failure: always

CONTRIBUTING.md

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
### Welcome
2+
3+
We welcome contributions to the Hyperledger Project in many forms, and there's always plenty to do!
4+
5+
First things first, please review the Hyperledger Project's [Code of Conduct](https://github.com/hyperledger/hyperledger/wiki/Hyperledger-Project-Code-of-Conduct) before participating. It is important that we keep things civil.
6+
7+
### Getting help
8+
If you are looking for something to work on, or need some expert assistance in debugging a problem or working out a fix to an issue, our [community](https://www.hyperledger.org/community) is always eager to help. We hang out on [Slack](https://hyperledgerproject.slack.com/), IRC (#hyperledger on freenode.net) and the [mailing lists](http://lists.hyperledger.org/). Most of us don't bite ;-) and will be glad to help.
9+
10+
### Requirements and Use Cases
11+
We have a [Requirements WG](https://github.com/hyperledger/hyperledger/wiki/Requirements-WG) that is documenting use cases and from those use cases deriving requirements. If you are interested in contributing to this effort, please feel free to join the discussion in [slack](https://hyperledgerproject.slack.com/messages/requirements/).
12+
13+
### Reporting bugs
14+
If you are a user and you find a bug, please submit an [issue](https://github.com/hyperledger/fabric/issues). Please try to provide sufficient information for someone else to reproduce the issue. One of the project's maintainers should respond to your issue within 24 hours. If not, please bump the issue and request that it be reviewed.
15+
16+
### Fixing issues and working stories
17+
Review the [issues list](https://github.com/hyperledger/fabric/issues) and find something that interests you. You could also check the ["help wanted"](https://github.com/hyperledger/fabric/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) list. It is wise to start with something relatively straight forward and achievable. Usually there will be a comment in the issue that indicates whether someone has already self-assigned the issue. If no one has already taken it, then add a comment assigning the issue to yourself, eg.: ```I'll work on this issue.```. Please be considerate and rescind the offer in comments if you cannot finish in a reasonable time, or add a comment saying that you are still actively working the issue if you need a little more time.
18+
19+
We are using the [GitHub Flow](https://guides.github.com/introduction/flow/) process to manage code contributions. If you are unfamiliar, please review that link before proceeding.
20+
21+
To work on something, whether a new feature or a bugfix:
22+
1. Create a [fork](https://help.github.com/articles/fork-a-repo/) (if you haven't already)
23+
24+
2. Clone it locally
25+
```
26+
git clone https://github.com/yourid/fabric.git
27+
```
28+
29+
3. Add the upstream repository as a remote
30+
```
31+
git remote add upstream https://github.com/hyperledger/fabric.git
32+
```
33+
34+
4. Create a branch
35+
Create a descriptively-named branch off of your cloned fork ([more detail here](https://help.github.com/articles/syncing-a-fork/))
36+
```
37+
cd fabric
38+
git checkout -b issue-nnnn
39+
```
40+
41+
5. Commit your code
42+
43+
Commit to that branch locally, and regularly push your work to the same branch on the server.
44+
45+
6. Commit messages
46+
47+
Commit messages must have a short description no longer than 50 characters followed by a blank line and a longer, more descriptive message that includes reference to issue(s) being addressed so that they will be automatically closed on a merge e.g. ```Closes #1234``` or ```Fixes #1234```.
48+
49+
7. Pull Request (PR)
50+
51+
**Note:** Each source file must include a license header for the Apache Software License 2.0. A template of that header can be found [here](https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/headers.txt).
52+
53+
When you need feedback or help, or you think the branch is ready for merging, open a pull request (make sure you have first successfully built and tested with the [Unit and Behave Tests](docs/dev-setup/install.md#3-test)).
54+
55+
_Note: if your PR does not merge cleanly, use ```git rebase master``` in your feature branch to update your pull request rather than using ```git merge master```_.
56+
57+
8. Did we mention tests? All code changes should be accompanied by new or modified tests.
58+
59+
9. Continuous Integration (CI): Be sure to check [Travis](https://travis-ci.org/) or the Slack [#fabric-ci-status](https://hyperledgerproject.slack.com/messages/fabric-ci-status) channel for status of your build. You can re-trigger a build on [Jenkins](https://jenkins.io/) with a PR comment containing `reverify jenkins`.
60+
61+
**Note:** While some underlying work to migrate the build system from Travis to Jenkins is taking place, you can ask the [maintainers](https://github.com/hyperledger/fabric/blob/master/MAINTAINERS.txt) to re-trigger a Travis build for your PR, either by adding a comment to the PR or on the [#fabric-ci-status](https://hyperledgerproject.slack.com/messages/fabric-ci-status) Slack channel.
62+
63+
10. Any code changes that affect documentation should be accompanied by corresponding changes (or additions) to the documentation and tests. This will ensure that if the merged PR is reversed, all traces of the change will be reversed as well.
64+
65+
After your Pull Request (PR) has been reviewed and signed off, a maintainer will merge it into the master branch.
66+
67+
## Coding guidelines
68+
69+
### Coding Golang <a name="coding-go"></a>
70+
- We code in Go&trade; and strictly follow the [best practices](http://golang.org/doc/effective_go.html)
71+
and will not accept any deviations. You must run the following tools against your Go code and fix all errors and warnings:
72+
- [golint](https://github.com/golang/lint)
73+
- [go vet](https://golang.org/cmd/vet/)
74+
- [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports)
75+
76+
## Generating gRPC code <a name="gRPC"></a>
77+
78+
If you modify any `.proto` files, run the following command to generate/update the respective `.pb.go` files.
79+
80+
```
81+
cd $GOPATH/src/github.com/hyperledger/fabric
82+
make protos
83+
```
84+
85+
## Adding or updating Go packages <a name="vendoring"></a>
86+
87+
The Hyperledger Fabric Project uses Go 1.6 vendoring for package management. This means that all required packages reside in the `vendor` folder within the fabric project. Go will use packages in this folder instead of the GOPATH when the `go install` or `go build` commands are executed. To manage the packages in the `vendor` folder, we use [Govendor](https://github.com/kardianos/govendor), which is installed in the Vagrant environment. The following commands can be used for package management:
88+
89+
```
90+
# Add external packages.
91+
govendor add +external
92+
93+
# Add a specific package.
94+
govendor add github.com/kardianos/osext
95+
96+
# Update vendor packages.
97+
govendor update +vendor
98+
99+
# Revert back to normal GOPATH packages.
100+
govendor remove +vendor
101+
102+
# List package.
103+
govendor list
104+
```
105+
106+
### Becoming a maintainer
107+
This project is managed under open governance model as described in our [charter](https://www.hyperledger.org/about/charter). Projects or sub-projects will be lead by a set of maintainers. New projects can designate an initial set of maintainers that will be approved by the Technical Steering Committee when the project is first approved. The project's maintainers will, from time-to-time, consider adding a new maintainer. An existing maintainer will post a pull request to the [MAINTAINERS.txt](MAINTAINERS.txt) file. If a majority of the maintainers concur in the comments, the pull request is then merged and the individual becomes a maintainer.
108+
109+
### Legal stuff
110+
111+
**Note:** Each source file must include a license header for the Apache Software License 2.0. A template of that header can be found [here](https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/headers.txt).
112+
113+
We have tried to make it as easy as possible to make contributions. This applies to how we handle the legal aspects of contribution. We use the same approach&mdash;the [Developer's Certificate of Origin 1.1 (DCO)](docs/biz/DCO1.1.txt)&mdash;that the Linux&reg; Kernel [community](http://elinux.org/Developer_Certificate_Of_Origin) uses to manage code contributions.
114+
We simply ask that when submitting a pull request, the developer must include a sign-off statement in the pull request description.
115+
116+
Here is an example Signed-off-by line, which indicates that the submitter accepts the DCO:
117+
118+
```
119+
Signed-off-by: John Doe <[email protected]>
120+
```

0 commit comments

Comments
 (0)