Skip to content

The module project for 50.041 - Designing a P2P Torrent backend with Chord!

Notifications You must be signed in to change notification settings

sheikhshack/chord-DL3N-50.041

Repository files navigation

distributed-chaos-50.041

Integration-Tests

For validating our Chord protocol, we have implemented several tests to simulate certain test cases using the in-house validation tool, Sentry. The details of these test cases can be found in Section 8 of our Final Report. The command to run the test case (as selected in code) is:

cd ./integration-tests/
go run sentry.go

Panopticon

The Panopticon is an in-house debugger tool for viewing all chord nodes' predecessor and successor. Panopticon exists as a docker container that will sustain a consistent and easy to read table. Below is such an example

                                    ID             predecessor               successor stabilized
panopticon    |           alpha (68601):     nodeCharlie (53816)       nodeBravo (96447)      true
panopticon    |       nodeBravo (96447):           alpha (68601)     nodeCharlie (53816)      true
panopticon    |     nodeCharlie (53816):       nodeBravo (96447)           alpha (68601)      true

To use this, you can run the following command in one terminal (append more services at the end if there are more). Or add a -d if you wish to detach the stdout.

docker-compose -f docker-compose.debug.yaml up alpha bravo charlie

Then in a clean terminal (which you don't need the previous print-outs anymore), run

docker-compose -f docker-compose.debug.yaml up panopticon

The above command will start the Panopticon container.

Protoc

Installation

  1. Install protoc: https://grpc.io/docs/protoc-installation/
  2. Install go plugins for protocol compiler
    go get google.golang.org/protobuf/cmd/protoc-gen-go \
           google.golang.org/grpc/cmd/protoc-gen-go-grpc
  3. Ensure that $GOPATH/bin is located within PATH
       export PATH="$PATH:$(go env GOPATH)/bin"

Build/Rebuild gRPC library

Build the generated protoc code with:

protoc --go_out=./node/gossip/ --go_opt=paths=source_relative \
       --go-grpc_out=./node/gossip/ --go-grpc_opt=paths=source_relative \
       ./proto/internal.proto

Docker

Quick start (Build and Compose)

./builder.sh
docker-compose up

Build using DockerFile

To build a DockerFile as the image chord_node:

docker build -t chord_node .

Ensure that 4th step has been configured properly:

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w' -o node_exec <file with main function>

docker-compose

docker-compose up

For dynamic scaling version:

docker-compose up --scale chord_member=9 #9 members

About

The module project for 50.041 - Designing a P2P Torrent backend with Chord!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published