...
1 # GoTorrent
2 BitTorrent Client Implementation
3
4 ## Project Status : [](https://travis-ci.com/IITH-SBJoshi/concurrency-8) [](https://github.com/IITH-SBJoshi/concurrency-8/blob/master/LICENSE)
5 - Able to parse torrent files.
6
7 ## Setup
8 1. **Install Golang**
9 - Follow [this](https://golang.org/doc/install) link **OR**
10 - Run ```sudo apt-get install golang```
11 - Set the environment variables `GOPATH` and `GOBIN` as follows :
12 - ```GOPATH="$HOME/go"```
13 - ```GOBIN="$GOPATH/bin"```
14 - ```PATH=$PATH:$GOBIN```
15 2. **Run the code**
16
17 Get [dep](https://github.com/golang/dep) for installing the dependencies
18 ```
19 $ cd $GOPATH/src/github.com # Come to the appropriate directory
20 $ git clone https://github.com/IITH-SBJoshi/concurrency-8.git
21 $ cd concurrency-8/
22 $ dep ensure # Get the dependencies
23 $ go run main.go # Run the code
24 ```
25
26 ## Guidelines for contribution :
27 1. Take open issues and ask for assignment in comment section.
28 2. **Working on seperate branch**
29 - Clone the repository : ```git clone https://github.com/IITH-SBJoshi/concurrency-8.git```
30 - Create a issue specific branch in cloned repository : ```git checkout -b issue#<issue number>```
31 - Run the code by following the steps above
32 - You can now start working on your current branch
33 3. **Testing the changes**
34 - Run the test cases if any: ```go test <test file>.go```
35 - Check the linting (Install [golint](https://github.com/golang/lint), if not already installed): ```golint <file_name>```
36 - Run `./build.sh` to check if the build passes
37
38 Note: If running `goreportcard-cli -v` shows errors in the files that are in the `vendor/` directory, ignore those issues. The TRAVIS build will take care that those files are not checked.
39 4. **Commiting the changes**
40 - Update ```.gitignore``` if there is any need .
41 - To add changes in your working directory : ```git add .```
42 - Commit your changes : ```git commit -m "<message>"```
43 - Follow a simple commit message guideline eg . ``` Fix <issue_id> : <small description> Author@<your name>```
44 5. **Pushing the changes**
45 - Get current master: `git fetch origin master`
46 - Merge master with your branch: `git merge master`
47 - Push your changes : ```git push origin <your branch name>:<your branch name>```
48 - Make sure that ```Travis CI build``` is passed.
49 6. **Generating Pull requests :**
50 - [Generate a pull request](https://help.github.com/articles/about-pull-requests/) from your ```branch``` branch to ```master``` branch.
51 - Give the PR and apt title, and mention `Fixes #<issue_number>` in the comment to link it with the issue.
52 - Don't close the issue by your own.
53 7. **Commenting your Code**
54 - Include your comments directly preceding an object for GoDoc to document it.
55 - Indent pre-formatted comments.
56 - Refer to the [Guidelines](https://blog.golang.org/godoc-documenting-go-code) for more info on commenting.
57 8. **Documentation**
58 - You can refer to [this](http://104.211.220.36/pkg/github.com/concurrency-8/) to see the documentation generated for the master branch.
59 - Documentation will be updated automatically upon a pull request into master.
60
61 ### Resources and References
62 - [Bittorent Specifications](http://jonas.nitro.dk/bittorrent/bittorrent-rfc.html)
63 - [Bittorent Specifications](http://www.bittorrent.org/beps/bep_0003.html)
64 - [Bittorrent in Javascript](https://allenkim67.github.io/programming/2016/05/04/how-to-make-your-own-bittorrent-client.html)
65 - [Bittorrent in C#](https://www.seanjoflynn.com/research/bittorrent.html)
66 - [Complete Bittorrent in Go](https://github.com/jackpal/Taipei-Torrent)
67 - [Network Programming in Go](https://ipfs.io/ipfs/QmfYeDhGH9bZzihBUDEQbCbTc5k5FZKURMUoUvfmc27BwL/index.html)
68 - [Concurrency in Go](https://github.com/golang/go/wiki/LearnConcurrency)
69 - [Go advanced testing tips & tricks](https://medium.com/@povilasve/go-advanced-tips-tricks-a872503ac859)
70 - [Travis CI tutorial](https://docs.travis-ci.com/user/tutorial/)
View as plain text