A distribulted file storage system for Qualichain. P2Cstore supports both peer-to-peer and cloud-backed storage. Among other use cases, P2Cstore can work in parallel to a blockchain for storing files that are added through transactions on the blockchain.
P2Cstore has been developed for Linux but considering that the only thing necessary to run the program is Java and Maven it should work on Windows and macOS too
If something doesn’t work, please file an issue.
- Git
- Java 1.8
- Maven
- At least 512MB of RAM
- To be able to connect to the network one has to have the inet ip enable on the machine.
To achieve that perform the following steps:
$ sudo nano /etc/hosts
Once inside the file comment the line that has:
127.0.1.1 ...
By simple adding a #, as such:
#127.0.1.1 ...
-
Fork and clone the projcet
-
In case one wants to use clouds it has to Configure AWS S3 and Configure GCP. Afterwards it is necessary to add the credentials to the Resources/config.properties file on the project.
- The Storage peers - Nodes that store content from other nodes and participate in the routing algorithm. Storage peers can perform all the operations on the system.
- The Readers - Nodes that do not store content from other nodes nor have to give storage space to the system. This type of participant can only read from the system.
- Cloud providers - Comercial cloud providers like AWS and GCP.
- Add operation - Storage peers can add content to the system using this operation.
- Get operation - Storage peers and Readers can read content from the system using this operation.
- Delete operation - Storage peers can delete content from the system using this operation.
- Update operation - Storage peers can update content from the system using this operation.
There are also a few auxiliary operations available. To learn about them one simply has to type help on the program terminal and click Enter and a list with all the operations is displayed.
As previously stated the present demonstration is for Linux computers, namely Ubuntu-based Linux and Fedora-based Linux.
The examples provided are for these operating systems because the code was developed in a Ubuntu-based environment and it was tested on a Fedora-based environment.
Compile the code on a Ubuntu-based machine:
$ source bss-launch --install
Compile the code on a Fedora-based machine:
$ ./runFedora.sh --install
Clean up the code on a Ubuntu-based machine:
$ source bss-launch --clean
Clean up code on a Fedora-based machine:
$ ./runFedora.sh --clean
For the system to function properly it is necessary to have a set of BootStrap Nodes to which the regular nodes will connect to interact with the system and know its state. Therefore, these are the nodes that must be connected first.
Therefore...
Run the code on a Ubuntu-based machine for the BootStrap Node:
$ source bss-launch --bssNode BootStrapNode0 #In which 0 can be 0-3
Run the code on a Fedora-based machine for the BootStrap Node:
$ ./runFedora.sh --bssNode BootStrapNode0 #In which 0 can be 0-3
For the storage peers the command is a little bit different.
The command to run the program on a Ubuntu-based machine for Storage Peers:
$ source bss-launch --storagePeer nodeID
#If nodeID is empty, a new node is created, if it is not the system will launch the node with that nodeID
The command to run the program on a Fedora-based machine for Storage Peers:
$ ./runFedora.sh --storagePeer nodeID
#If nodeID is empty, a new node is created, if it is not the system will launch the node with that nodeID
For readers we do the following:
The command to run the program on a Ubuntu-based machine for Readers:
$ source bss-launch get-shared ownerID/file_key
# In which ownerID and file_key is shared with the reader by a storage peer
The command to run the program on a Fedora-based machine for Readers:
$ ./runFedora.sh get-shared ownderID/file_key
# In which ownerID and file_key is shared with the reader by a storage peer
The continuous development of this project is what makes it alive and it is only possible due to all the people who contribute
This work was initially developed in the scope of the master's thesis of @MarceloFRSilva who developed the first version of this work.
We are grateful to the authors of existing related projects used in the development of this one:
Thank you very much for your Kademlia DHT open source project.