Skip to content

GautamGadipudi/mars-rovers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
Oct 26, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 26, 2020
Oct 26, 2020

Repository files navigation

mars-rovers

Author: Gautam Gadipudi

Id: gg7148

All docker testing environment is taken from Professor Fryer's repository: MulticastTestingEnvironment.

To build

This will also build any java files in the current directory in the container.

docker build -t javaapptest .

To create the node network

Only needs to be done once.

docker network create --subnet=172.18.0.0/16 nodenet

To Run (for example, node 1)

This will ultimately run the java Main class as an application.

docker run -it -p 8080:8080 --cap-add=NET_ADMIN --net nodenet --ip 172.18.0.21 javaapptest 1

To Run (node 2):

docker run -it -p 8081:8080 --cap-add=NET_ADMIN --net nodenet --ip 172.18.0.22 javaapptest 2

To Block Nodes 2 and 3 on Node 1

Using the block=ip http query parameter.

curl "http://localhost:8080/?block=172.18.0.22&block=172.18.0.23"

To unblock Node 2 on Node 1

Using the unblock=ip http query parameter.

curl "http://localhost:8080/?unblock=172.18.0.22"