go get -u github.com/gravetii/diztl
- Make a copy of the
config-template.ymlwhich is a bare-bones configuration file for diztl, and name it
cp config-template.yml config.yml. The
config.ymlfile is the actual config file required for diztl to work. If you want to make any changes to the configuration, this is the file you want to edit. Note that this file is untracked in the repo (unlike the
config-template.yml) which ensures that changes specific to your environment aren't reflected publicly. If any changes are to be reflected publicly, they need to go into the
- Optionally, you can also add the
config.ymlentry in your
.git/info/excludefile so that git doesn't prompt you to add it to the stage all the time.
In the root folder of the project:
go run tracker/main.go: This runs the tracker node on the localhost.
- Specify the local IP address of the
config.ymlfile to allow
Nodes to connect to it.
go run node/main.go: Run this anywhere on any machine in the network to fire up a
Node starts up without any errors, you will be able to search for files that have been shared by other peers in the same network.
Diztl consists of two main components:
- Tracker: The
Tracker's responsibility is to allow co-ordination and communication between the different
- Node: A
Nodeis basically any peer in the network. It can share resources as well as request for and download resources from other
Nodes in the network.
The current implementation isn't completely decentralized in that the search queries from a
Node are sent to the
Tracker which then broadcasts the request across all peers in the network, requesting them to reply back with the files they have that might be of interest to the caller
Once the requesting
Node decides on the file it wants to download from the target peer, communication happens solely between the two peers without any intervention from the
Node first starts up, it indexes all the files to be shared in the default share folder located under
<user_root>/Documents/diztl/share. By default, downloaded files are located under
/output directory of the shared folder. The
Node then connects to the
Tracker and registers itself after which it can participate in the network and communicate with other nodes. The share and output folders can be configured by changing the corresponding configurations in the
config.yml file (requires restart of tracker and/or node).
For the formats of different request-response structures, take a look at the
diztl/diztl.proto file which contains the protobuf specifications as well as the gRPC service definitions.
gRPC: The project uses gRPC as its communication protocol along with protocol buffers as the data-interchange format.
fsnotify: The project makes use of fsnotify to detect file-system changes and indexes them dynamically, thus making them avaiable for search across the entire network in real-time.
Edit [May 30, 2019]: Watching on file-system changes is currently disabled through config because of this issue. This means new files added to shared folders aren't immediately available for discovery to other peers without node restart.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to the project.
- Sandeep Dasika
This project is licensed under the MIT License - see the LICENSE.md file for details