/resilientdb

ResilientDB: Global-Scale Sustainable Blockchain Fabric

Primary LanguageC++Apache License 2.0Apache-2.0

ResilientDB: Global-Scale Sustainable Blockchain Fabric

ResilientDB is a High Throughput Yielding Permissioned Blockchain Fabric founded by ExpoLab at UC Davis in 2018. ResilientDB advocates a system-centric design by adopting a multi-threaded architecture that encompasses deep pipelines. Further, ResilientDB separates the ordering of client transactions from their execution, which allows it to process messages out-of-order.

Quick Facts on ResilientDB

  1. ResilientDB's core consensus protocol is based on a highly optimized PBFT [Castro and Liskov, 1998] implementation to achieve agreement among replicas. The core consensus layer is further expanded with the state-of-the-art consensus protocols [the release is pending] such as GeoBFT, PoE, RCC, RingBFT, PVP, PoC, HotStuff, and DAG.
  2. ResilientDB expects minimum of 3f+1 replicas, where f is the maximum number of arbitrary (or malicious) replicas.
  3. ReslientDB designates one of its replicas as the primary (replicas with identifier 0), which is also responsible for initiating the consensus.
  4. ResilientDB exposes a wide range of API services such as a Key-Value, Smart Contracts, UTXO, and Python SDK. Examples DApp that are being built on ResilientDB are: NFT Marketplace and Debitable.
  5. To facilitate the persistence of the chain and chain state, ResilientDB provides durability through LevelDB and RocksDB.
  6. To support deployment and maintenance, ResilientDB provides access to a seamless GUI display along with access to Grafana for plotting monitoring data.
  7. [Historial Facts] The ResilientDB project was founded by Mohammad Sadoghi along with his students (Suyash Gupta as the lead Architect, Sajjad Rahnama, Jelle Hellings) at UC Davis in 2018 and was open-sourced in late 2019. On September 30, 2021, we released ResilientDB v-3.0. In 2022, ResilientDB was completely re-written and re-architected (Junchao Chen as the lead Architect along with the entire NexRes Team), paving the way for a new sustainable foundation, referred to as NexRes (Next Generation ResilientDB); thus, on September 30, 2022, NexRes-v1.0.0 was born, marking a new beginning for ResilientDB.

Online Documentation:

You may find the latest ResilientDB documentation, including a programming guide, on our blog repository. This README file provides basic setup instructions.

Table of Contents

  1. Software Stack Architecture
  2. Platform Layer: Consensus Manager Architecture (ordering, recovery, network, chain management, storage)
  3. Service Layer: Transaction Manager Design (runtime and chain state) [TBA]
  4. Tooling & API Layer: Key-Value, Solidity Smart Contract, Unspent Transaction Output (UTXO) Model, Python SDK
  5. Installing & Deploying ResilientDB

OS Requirements

Ubuntu 20.*


Build and Deploy ResilientDB

Install dependencies:

./INSTALL.sh

Run ResilientDB (Providing a Key-Value Service):

./example/start_kv_server.sh
  • This script will start 4 replica and 1 client. Each replica instantiates a key-value store.

Build Interactive Tools:

bazel build example/kv_server_tools

Run tools to set a value by a key (for example, set the value with key "test" and value "test_value"):

bazel-bin/example/kv_server_tools example/kv_client_config.config set test test_value

You will see the following result if successful:

client set ret = 0

Run tools to get value by a key (for example, get the value with key "test"):

bazel-bin/example/kv_server_tools example/kv_client_config.config get test

You will see the following result if successful:

client get value = test_value

Run tools to get all values that have been set:

bazel-bin/example/kv_server_tools example/kv_client_config.config getvalues

You will see the following result if successful:

client getvalues value = [test_value]

Enable SDK

If you want to enable sdk verification, add a flag to the command

./example/start_kv_server.sh --define enable_sdk=True

And in example/kv_config.config

require_txn_validation:true,

FAQ

If installing bazel fails on a ubuntu server, follow these steps:

mkdir bazel-src

cd bazel-src

wget https://github.com/bazelbuild/bazel/releases/download/5.4.0/bazel-5.4.0-dist.zip

sudo apt-get install build-essential openjdk-11-jdk python zip unzip

unzip bazel-5.4.0-dist.zip

env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" bash ./compile.sh

sudo mv output/bazel /usr/local/bin