Bit-torrent client implementation as part of CS2433 (Principles of Programming Language II ) by Prof. Saurabh Joshi .
- Description
- Documentation
- Setup
- Usage
- Guidelines for contribution
- External packages
- Resources and References
- Objective
- Get familair with writing concurrent programs.
- Using software technologies like Continous Integration , Unit Testing , Documentation .
- Features
- Downloading multiple torrent files concurrently.
- Fetching Peer lists from both HTTP and UDP Trackers.
- Fetching pieces of blocks concurrently from Peers.
- Enabling Resume capabilities on abrupt termination.
- Generating detailed log files for debugging.
- A command line interface for managing.
- Team
- Shraiysh Gupta (CS17BTECH11050)
- Puneet Mangla (CS17BTECH11029)
- Lingam Sai Ramana Reddy (Cs17BTECH11022)
- Hitesh (MA17BTECH11004)
- You can refer to this to see the documentation generated for the master branch.
-
Installing Golang
- Follow this link OR
- Run
sudo apt-get install golang - Set the environment variables
GOPATHandGOBINas follows :GOPATH="$HOME/go"GOBIN="$GOPATH/bin"PATH=$PATH:$GOBIN
-
Building
Get dep for installing the dependencies
$ cd $GOPATH/src/github.com # Come to the appropriate directory $ git clone https://github.com/IITH-SBJoshi/concurrency-8.git $ cd concurrency-8/ $ dep ensure # Get the dependencies $ ./build.sh # To check if all tests passes
- Downloading
go run main.go --files File1 File2 File3 -v -d ../../
- Flags
| Flag Name | Description | Default |
|---|---|---|
--files [path] [path] ... |
List of Torrent Files | empty |
--download -d |
Specify the download path for downloading the files. | "" |
--rescap -rc |
True if pause and resume feature is needed. False otherwise. | false |
--resume -r |
True to resume partially downloaded files. | false |
--help |
Print this help message and exit. | - |
--verbose -v |
True if misc output is required. False otherwise. | false |
-
Take open issues and ask for assignment in comment section.
-
Working on seperate branch
- Clone the repository :
git clone https://github.com/IITH-SBJoshi/concurrency-8.git - Create a issue specific branch in cloned repository :
git checkout -b issue#<issue number> - Run the code by following the steps above
- You can now start working on your current branch
- Clone the repository :
-
Testing the changes
- Run the test cases if any:
go test <test file>.go - Check the linting (Install golint, if not already installed):
golint <file_name> - Run
./build.shto check if the build passes
Note: If running
goreportcard-cli -vshows errors in the files that are in thevendor/directory, ignore those issues. The TRAVIS build will take care that those files are not checked. - Run the test cases if any:
-
Commiting the changes
- Update
.gitignoreif there is any need . - To add changes in your working directory :
git add . - Commit your changes :
git commit -m "<message>" - Follow a simple commit message guideline eg .
Fix <issue_id> : <small description> Author@<your name>
- Update
-
Pushing the changes
- Get current master:
git fetch origin master - Merge master with your branch:
git merge master - Push your changes :
git push origin <your branch name>:<your branch name> - Make sure that
Travis CI buildis passed.
- Get current master:
-
Generating Pull requests :
- Generate a pull request from your
branchbranch tomasterbranch. - Give the PR and apt title, and mention
Fixes #<issue_number>in the comment to link it with the issue. - Don't close the issue by your own.
- Generate a pull request from your
-
Commenting your Code
- Include your comments directly preceding an object for GoDoc to document it.
- Indent pre-formatted comments.
- Refer to the Guidelines for more info on commenting.