Skip to content

QualiChain/P2Cstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

QualiChain P2Cstore Project

web

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.

Index:

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.

System Requirements

  • Git
  • Java 1.8
  • Maven
  • At least 512MB of RAM

Setup

  1. 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   ...    
  1. Fork and clone the projcet

  2. 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.

On P2Cstore

The system participants are the following:

  • 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.

The main operations supported are:

  • 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.

Compile and clean up

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    

Run

BootStrap Node

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

Storage Peers

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

Readers

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

Credits

The continuous development of this project is what makes it alive and it is only possible due to all the people who contribute

Acknowledgements

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.

License

License: MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published