This is a lab for the course Mobile and distributed computing systems at Luleå University of Technology
git clone https://github.com/your_username_/Project-Name.git
From the project directory run
docker build --tag kademlia .
docker compose up
To initilize the network executing the following script
./init.sh
This scripts executes the join command onto a random chosen node.
All nodes have an CLI that can be interacted with thru docker
docker exec -ti <container-id> cli <command>
All nodes have a RESTFUL API with the following method
Method: GET, endpoint: /objects/{hash}/
The {hash} portion of the HTTP path is to be substituted for the hash of the object. A successful call should result in the contents of the object being responded with.
Method: POST, endpoint: /objects
Each message sent to the endpoint must contain a data object in its HTTP body. If the operation is successful, the node will reply with 201 CREATED containing both the contents of the uploaded object and a Location: /objects/{hash} header, where {hash} will be substituted for the hash of the uploaded object.
go test ./... -coverprofile=coverage.out
go tool cover -func coverage.out