A repository containing an implementation of a secure blockchain based decentralized and distributed network, targeted towards improving unmanned vehicular communications (UAV's) in conflict zone scenarios.
The following configurations have been made to both the Raspberry Pis to simulate the presence of multiple UAVs along with a single GCS:
-
rasp-008 - Utilised as a server, thereby replicating the GCS. (Can also run client code if and when needed with no modifications whatsoever)
-
rasp-028 - Utilised as a client, thereby replicating a single UAV. Further UAVs are also simulated on this Raspberry Pi.
-
Ports :-
- The GCS is maintained at a static IP (rasp-008: 10.35.70.8:33333)
- All the UAVs are maintained on any of the two IP addresses (based on the choice of the user)raspberry (rasp-028/rasp-008: 0.0.0.0: ports ranging between 33334-33999)
-
Clone the main branch of this repository to your local machine.
-
Make changes to the path present in the following lines within the following files (to match the directory within your local machine where the repository is cloned):
a. Line 22 and 35 : Blockchain/blockchain.py b. Line 17 - GCS/gcs.py c. Line 33 - Network/server.py d. Line 85 - UAV/uav.py
-
pip install -r requirements.txt
- to install all the requirements present within the requirements.txt file. -
Depending on the OS on which the program is being run; run the following commands (in order) in a terminal window within the cloned repository:
-
(a)
python .\Runner-GCS.py
orpython Runner-GCS.py
- Windows based systems.(b)
python3 Runner-GCS.py
- Linux based systems -
(a)
python .\Runner-UAV.py
orpython Runner-UAV.py
- Windows based systems (Run this command in a new terminal window)(b)
python3 Runner-UAV.py
- Linux based systems (Run this command in a new terminal window)
-
-
Ideal conditions - To test the blockchain network under ideal conditions, follow the steps mentioned in the section How To Run (above). You should see a file named College Green.txt being generated and populated, located within the GCS subdirectory of your cloned project.
-
Failure of UAV's - To test the blockchain network in a case where a UAV has been disconnected from the network, follow the below mentioned steps:
- Follow the steps mentioned in the section How To Run (above).
- On the terminal window containing logs from the command Runner-UAV.py, press
Ctrl + C
. - A subdirectory named UAV1 should be generated within the UAV subdirectory of your cloned project. The newly generated subdirectory should also contain a file named localBChain.txt which should be populated with all the contents of the blockchain and should continue to be populated until further reconnection of the UAV to the GCS.
- To reconnect the UAV to the GCS and blockchain network, navigate back to the terminal window mentioned in Step ii of this section. On this window, press
Ctrl + C
(yet again) to reconnect the UAV back to the GCS. You should observe that the file College Green.txt continues to be updated as and when the UAV is reconnected.
-
Disconnection of the GCS - To test the blockchain network in a case where the GCS has been disconnected from the blockchain, follow the below mentioned steps:
- Follow the steps mentioned in the section How To Run (above).
- On the terminal window containing logs from the command Runner-GCS.py, press
Ctrl+C
. - On the terminal window containing logs from the command Runner-UAV.py, press
Ctrl+C
. - You should observe that the file localBChain.txt (mentioned under Step iii of Section 2) would be populated with all the contents of the blockchain and would continue to be updated unless acted upon the GCS otherwise.
- To reconnect the GCS back to the blockchain network, run the commands mentioned under Step 4.i, present under the section How To Run (above), in a new terminal window.
- On the terminal window mentioned in Step iii of this section, press
Ctrl+C
yet again, and you should see all files being populated as expected in an ideal condition.
-
Presence of multiple UAVs - to test the presence of multiple UAVs within the blockchain network, simply follow all the steps above containing the file Runner-UAV.py 'n' number of times, where n is the number of UAVs that you would like to create.
This program involves the use of OS libraries, which create and modify files within the project directory. This might result in the need for access to certain permissions or RBAC modes. Hence, we recommend that you clone this project to a local directory on your machine (such as Desktop) which would not additional permissions to create and modify files.
Hello and welcome! We are so glad that you are interested in contributing to Rasp Secure Blockchain UAVNet! We only have a couple of rules and we hope you enjoy the process :)
- Don't move or delete any files. Only modify them.
- Fork the repository
- Clone your forked repository to your computer
- Head to the issues tab and look for an issue that you like.
- Once you have decided what issue to work on, give it a shot!
- Once done, push the code to your forked repository.
- Head to the Pull Requests tab and click on "Create New Pull Request"
- On the left of the arrow should be this repo and on the right should be yours.
- Add a small description to the Pull Request describing what you've done.
- Mention what Issue you have worked on. If the issue number is #3, you can mention "Closes #3" in the Pull Request description.
- Submit Pull Request
It's that easy! We hope you enjoy contributing to our repository. Don't hesitate to contact any of the maintainers about any problems!