All Projects β†’ sheharyarn β†’ Dbfs

sheharyarn / Dbfs

Licence: mit
Distributed Blockchain-based File Storage πŸ“‘

Programming Languages

elixir
2628 projects
erlang
1774 projects

Projects that are alternatives of or similar to Dbfs

Node
Mysterium Network Node - official implementation of distributed VPN network (dVPN) protocol
Stars: ✭ 681 (+1413.33%)
Mutual labels:  blockchain, distributed-systems
Kubernetes Gpu Guide
This guide should help fellow researchers and hobbyists to easily automate and accelerate there deep leaning training with their own Kubernetes GPU cluster.
Stars: ✭ 740 (+1544.44%)
Mutual labels:  distributed-systems, cluster
Maskbook
The portal to the new, open internet. ([I:b])
Stars: ✭ 691 (+1435.56%)
Mutual labels:  blockchain, encryption
Ffsend
πŸ“¬ Easily and securely share files from the command line. A fully featured Firefox Send client.
Stars: ✭ 5,448 (+12006.67%)
Mutual labels:  hacktoberfest, encryption
Kudo
Kubernetes Universal Declarative Operator (KUDO)
Stars: ✭ 849 (+1786.67%)
Mutual labels:  hacktoberfest, cluster
Memento
Simple + Powerful interface to the Mnesia Distributed Database πŸ’Ύ
Stars: ✭ 597 (+1226.67%)
Mutual labels:  hacktoberfest, distributed-systems
Oak
Meaningful control of data in distributed systems.
Stars: ✭ 698 (+1451.11%)
Mutual labels:  hacktoberfest, distributed-systems
Node Worker Nodes
A node.js library to run cpu-intensive tasks in a separate processes and not block the event loop.
Stars: ✭ 468 (+940%)
Mutual labels:  hacktoberfest, cluster
Abci Host
Clojure host/server for Tendermint's ABCI protocol.
Stars: ✭ 18 (-60%)
Mutual labels:  blockchain, distributed-systems
Blockchain Reading List
Blockchain Manchester Meetups, Talks and Reading List
Stars: ✭ 17 (-62.22%)
Mutual labels:  blockchain, distributed-systems
Iotex Core
Official implementation of IoTeX blockchain protocol in Go.
Stars: ✭ 505 (+1022.22%)
Mutual labels:  blockchain, distributed-systems
Awesome Scalability Toolbox
My opinionated list of products and tools used for high-scalability projects
Stars: ✭ 34 (-24.44%)
Mutual labels:  encryption, distributed-systems
Secure Ls
πŸ”’ Secure localStorage data with high level of encryption and data compression
Stars: ✭ 486 (+980%)
Mutual labels:  hacktoberfest, encryption
Fabric Sdk Node
Hyperledger Fabric SDK for Node https://wiki.hyperledger.org/display/fabric
Stars: ✭ 676 (+1402.22%)
Mutual labels:  blockchain, hacktoberfest
Scalecube Services
ScaleCube Services is a high throughput, low latency reactive microservices library built to scale. it features: API-Gateways, service-discovery, service-load-balancing, the architecture supports plug-and-play service communication modules and features. built to provide performance and low-latency real-time stream-processing. its open and designed to accommodate changes. (no sidecar in a form of broker or any kind)
Stars: ✭ 482 (+971.11%)
Mutual labels:  distributed-systems, cluster
Rotki
A portfolio tracking, analytics, accounting and tax reporting application that protects your privacy
Stars: ✭ 689 (+1431.11%)
Mutual labels:  blockchain, hacktoberfest
Caliper
A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
Stars: ✭ 447 (+893.33%)
Mutual labels:  blockchain, hacktoberfest
Hazelcast
Open-source distributed computation and storage platform
Stars: ✭ 4,662 (+10260%)
Mutual labels:  hacktoberfest, distributed-systems
Typechain
πŸ”Œ TypeScript bindings for Ethereum smart contracts
Stars: ✭ 769 (+1608.89%)
Mutual labels:  blockchain, hacktoberfest
Lethean Vpn
Lethean Virtual Private Network (VPN)
Stars: ✭ 29 (-35.56%)
Mutual labels:  blockchain, distributed-systems

DBFS

Distributed Blockchain-based File Storage in Elixir πŸ“‘

DBFS is an experiment to implement a (very naΓ―ve) distributed file storage service using a blockchain in Elixir. With growing interest in Blockchains and Cryptocurrencies, I wanted to understand the complex inner workings of Blockchains and their feasibility in the context of business applications. I started by writing a very simple Blockchain to get started, and then wrote DBFS as a slightly more complex version that actually did something.

Screenshots, Talk and Paper

I gave a lightning talk about the project at the ElixirConf 2018 in Europe, which you can check out here.

I also wrote a basic whitepaper detailing the application as part of my semester project, and you can also see some screenshots of the application here:

Architecture

The application is divided into two parts:

  • Elixir Backend: The core application, responsible for storing the data, performing consensus among nodes and exposing an API for clients
  • React Frontend: A Javascript based web-client that connects to the backend, provides a UI to perform operations and displays statistics about all the connected nodes.

The application is designed as a "Private Blockchain" after weighing the pros and cons of different approaches, and even though it should absolutely not be used in production, it is meant to be run on private infrastructure instead of being made publicly available so any node can connect.

The sys.config file defines 3 nodes. You can change this to add or remove nodes, but you'll have to perform the setup on each node (if you're running it on different machines). You'll also have to make sure that your hosts file points these domains to their correct IPs.

Setup

You need to have these dependencies installed at minimum:

  • Erlang/OTP 20.1
  • Elixir 1.5.2
  • Postgres 9.4
  • Node.js 9.6.1 for Assets and Yarn
  • Ruby 2.3.3 for Sass

Set up the Backend:

$ git clone to.shyr.io/dbfs ~/dbfs
$ cd ~/dbfs
$ mix deps.get
$ mix compile

Set up the Frontend:

$ git clone to.shyr.io/dbfs-web ~/dbfs-web
$ cd ~/dbfs-web
$ yarn install

For the first node of the backend, we need to create its instance and initialize the blockchain database. For other nodes, we can simply create their instances without creating the blockchain (They will automatically be synchronized when we start them). Assuming, you're starting all nodes on the same machine:

$ cd ~/dbfs
$ NODE=newyork   PRIMARY=1 mix do ecto.create, ecto.migrate, ecto.seed
$ NODE=london    PRIMARY=0 mix do ecto.create, ecto.migrate, ecto.seed
$ NODE=singapore PRIMARY=0 mix do ecto.create, ecto.migrate, ecto.seed

Get it Running

To finally start the backend nodes, you need to pass them a port, node name and boot-up config. You can start one node or multiple, depending on the requirements.

$ NODE=newyork PORT=3000 elixir --name [email protected] --erl "-config sys.config" –S mix phoenix.server

If you decide to run multiple nodes together, you also need to initialize the distributed Mnesia tables which are responsible for performing consensus across the network. First enter the REPL command-line of one of the running nodes, and enter the following:

iex> DBFS.Consensus.Global.setup

Finally, to start the Web-Client:

$ cd ~/dbfs-web
$ PORT=4000 yarn start

Usage

To use the application and upload/download files, they need to be encrypted using your private key. You can generate one using ssh-keygen:

$ ssh-keygen -b 1024 -t rsa -f key -q -N ""

What's Next?

Nothing. This was just an experiment and a learning experience. I'm not planning on doing any more work on this, but you're free to play around and learn from my mistakes (You should absolutely not make the same design decisions I made).

License

All code here is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].