This is an implementation of a P2P system that can be used to share and download files in a local network.
After booting, the system does the following:
- It looks for other nodes running in the network.
- It chooses a ID different from all the others in the network.
- It opens a CLI that makes it possible to search and download files from other clients.
- It spawns a server process that makes it possible for other clients to search for and download local files.
In order to run, clone the repository and execute make run. Note that you need to have Erlang installed.
git clone https://github.com/SOI-TP-Final/tp-final.git
cd tp-final
make run
By default, the server listens for TCP requests at port 12345, shares the files located in the directory called shared_folder, and stores downloaded files in the downloads directory.
These defaults can be changed with the following syntax:
make run "ARGS=TCP_PORT SHARED_FOLDER DOWNLOADS_FOLDER"
For instance, to open at port 23456 and use the folders my_shared_folder and my_downloads:
make run "ARGS=23456 my_shared_folder my_downloads"
The files available for sharing have to be placed in the directory called shared_folder or in the one specified by argument, as described in Running.
The CLI offers several commands:
ayuda: lists available commands along with their descriptions.buscar FILENAME_WITH_WILDCARDS: searches all the files in the network matching by name, with support for wildcards.descargar FILENAME NODE_ID: downloads a file shared by a given node.id_nodo NODE_ID: shows information for a given node with idNODE_ID.listar_mis_archivos: outputs a list of files available for sharing.listar_nodos: shows the IDs of the other nodes that are active on the network.mi_id: shows the ID of the node in the network.mostrar_descargas: opens up a screen that keeps track of ongoing downloads and their current progress.salir: exits the CLI and powers off the server.