Plenum Byzantine Fault Tolerant Protocol
Switch branches/tags
Clone or download
Latest commit cff0f21 Sep 22, 2018
Permalink
Failed to load latest commit information.
build-scripts/ubuntu-1604 [INDY-1642] comment BitmasHelper class with tests Aug 31, 2018
ci INDY-1389: remove sdk repo from dockerfile Aug 15, 2018
common [INDY-1642] move discarded to indexes Aug 30, 2018
crypto INDY-1588: add method for generating key proof Aug 20, 2018
data remove non-indy brands (INDY-829) (#381) Sep 18, 2017
design INDY-1290: Add analysis of backup instances May 17, 2018
docs Recorder (#692) Jun 7, 2018
examples payment plugin changes (#774) Jun 26, 2018
ledger Change warning to display to make tests pass Jul 9, 2018
plenum Merge pull request #921 from skhoroshavin/indy-1602 Sep 21, 2018
scripts Log processor: more fixes Aug 9, 2018
settings [INDY-1057] Get rid of RAET code (#512) Feb 20, 2018
state INDY-1583: Fix and additionals for tests Aug 24, 2018
storage improves assert usage in storage Jun 15, 2018
stp_core INDY-1602: Make more consistent naming in quota control Aug 31, 2018
stp_zmq INDY-1602: Trying to fix failing tests Aug 30, 2018
tutorial INDY-1370: change key in cli.getReply() Jun 1, 2018
.flake8 Apply autopep8 (#339) Aug 18, 2017
.gitignore payment plugin changes (#774) Jun 26, 2018
Jenkinsfile [INDY-1057] Get rid of RAET code (#512) Feb 20, 2018
Jenkinsfile.cd optionally sets from env pr context to check Jul 3, 2018
Jenkinsfile.ci Update jenkins CI config Aug 24, 2018
LICENSE * Added Copyright to plenum license Apr 19, 2018
MANIFEST.in Adding support for immutable ledger for transactions. New nodes can n… May 9, 2016
README.md rename plenum_config.py to indy_config.py Jun 14, 2018
indy-logo.png Add link to general overview from README (#529) Feb 14, 2018
runner.py Check test suit preparation exit code Feb 22, 2018
setup.cfg Feature Added: Repo consolidation (#262) Jul 10, 2017
setup.py [INDY-1642] comment BitmasHelper class with tests Aug 31, 2018
terminology.md Feature Added: Repo consolidation (#262) Jul 10, 2017

README.md

logo

Plenum Byzantine Fault Tolerant Protocol

Plenum is the heart of the distributed ledger technology inside Hyperledger Indy. As such, it provides features somewhat similar in scope to those found in Fabric. However, it is special-purposed for use in an identity system, whereas Fabric is general purpose.

Technical Overview of Indy

Please find the general overview of the system in Overview of the system.

More documentation can be found in docs.

Other Documentation

  • Details about the protocol, including a great tutorial, can be found on the wiki.
  • Please have a look at aggregated documentation at indy-node-documentation which describes workflows and setup scripts common for both projects.

Indy Plenum Repository Structure

  • plenum:
    • the main codebase for plenum including Byzantine Fault Tolerant Protocol based on RBFT
  • common:
    • common and utility code
  • crypto:
    • basic crypto-related code (in particular, indy-crypto wrappers)
  • ledger:
    • Provides a simple, python-based, immutable, ordered log of transactions backed by a merkle tree.
    • This is an efficient way to generate verifiable proofs of presence and data consistency.
    • The scope of concerns here is fairly narrow; it is not a full-blown distributed ledger technology like Fabric, but simply the persistence mechanism that Plenum needs.
  • state:
    • state storage using python 3 version of Ethereum's Patricia Trie
  • stp:
    • secure transport abstraction
    • it has ZeroMQ implementations
  • storage:
    • key-value storage abstractions
    • contains leveldb implementation as the main key-valued storage used in Plenum (for ledger, state, etc.)

Dependencies

  • Plenum makes extensive use of coroutines and the async/await keywords in Python, and as such, requires Python version 3.5.0 or later.
  • Plenum also depends on libsodium, an awesome crypto library. These need to be installed separately.
  • Plenum uses ZeroMQ as a secure transport
  • indy-crypto
    • A shared crypto library
    • It's based on AMCL
    • In particular, it contains BLS multi-signature crypto needed for state proofs support in Indy.

Contact Us

  • Bugs, stories, and backlog for this codebase are managed in Hyperledger's Jira. Use project name INDY.
  • Join us on Jira's Rocket.Chat at #indy and/or #indy-node channels to discuss.

How to Contribute

How to Start Working with the Code

Please have a look at Dev Setup in indy-node repo. It contains common setup for both indy-plenum and indy-node.

Try Plenum Locally

Install from pypi

pip install indy-plenum

From here, you can play with the command-line interface (see the tutorial).

Note: For Windows, we recommended using either cmder or conemu.

plenum

...or run the tests.

git clone https://github.com/hyperledger/indy-plenum.git
cd indy-plenum
python -m plenum.test

Initializing Keys

Each Node needs to have keys initialized

  • ed25519 transport keys (used by ZMQ for Node-to-Node and Node-to-Client communication)
  • BLS keys for BLS multi-signature and state proofs support
init_plenum_keys --name Alpha --seeds 000000000000000000000000000Alpha Alpha000000000000000000000000000 --force
init_plenum_keys --name Beta --seeds 0000000000000000000000000000Beta Beta0000000000000000000000000000 --force
init_plenum_keys --name Gamma --seeds 000000000000000000000000000Gamma Gamma000000000000000000000000000 --force
init_plenum_keys --name Delta --seeds 000000000000000000000000000Delta Delta000000000000000000000000000 --force

Note: Seed can be any randomly chosen 32 byte value. It does not have to be in the format 00..<name of the node>.

Seeds used for generating clients

  1. Seed used for steward Bob's signing key pair 11111111111111111111111111111111
  2. Seed used for steward Bob's public private key pair 33333333333333333333333333333333
  3. Seed used for client Alice's signing key pair 22222222222222222222222222222222
  4. Seed used for client Alice's public private key pair 44444444444444444444444444444444

Running Node

start_plenum_node Alpha

Updating configuration

To update any configuration parameters, you need to update the indy_config.py in .plenum/YOUR_NETWORK_NAME directory inside your home directory. eg. To update the node registry to use 127.0.0.1 as host put these in your indy_config.py.

from collections import OrderedDict

nodeReg = OrderedDict([
    ('Alpha', (('127.0.0.1', 9701), '0490a246940fa636235c664b8e767f2a79e48899324c607d73241e11e558bbd7', 'ea95ae1c913b59b7470443d79a6578c1b0d6e1cad0471d10cee783dbf9fda655')),
    ('Beta', (('127.0.0.1', 9703), 'b628de8ac1198031bd1dba3ab38077690ca9a65aa18aec615865578af309b3fb', '18833482f6625d9bc788310fe390d44dd268427003f9fd91534e7c382501cd3c')),
    ('Gamma', (('127.0.0.1', 9705), '92d820f5eb394cfaa8d6e462f14708ddecbd4dbe0a388fbc7b5da1d85ce1c25a', 'b7e161743144814552e90dc3e1c11d37ee5a488f9b669de9b8617c4af69d566c')),
    ('Delta', (('127.0.0.1', 9707), '3af81a541097e3e042cacbe8761c0f9e54326049e1ceda38017c95c432312f6f', '8b112025d525c47e9df81a6de2966e1b4ee1ac239766e769f19d831175a04264'))
])

cliNodeReg = OrderedDict([
    ('AlphaC', (('127.0.0.1', 9702), '0490a246940fa636235c664b8e767f2a79e48899324c607d73241e11e558bbd7', 'ea95ae1c913b59b7470443d79a6578c1b0d6e1cad0471d10cee783dbf9fda655')),
    ('BetaC', (('127.0.0.1', 9704), 'b628de8ac1198031bd1dba3ab38077690ca9a65aa18aec615865578af309b3fb', '18833482f6625d9bc788310fe390d44dd268427003f9fd91534e7c382501cd3c')),
    ('GammaC', (('127.0.0.1', 9706), '92d820f5eb394cfaa8d6e462f14708ddecbd4dbe0a388fbc7b5da1d85ce1c25a', 'b7e161743144814552e90dc3e1c11d37ee5a488f9b669de9b8617c4af69d566c')),
    ('DeltaC', (('127.0.0.1', 9708), '3af81a541097e3e042cacbe8761c0f9e54326049e1ceda38017c95c432312f6f', '8b112025d525c47e9df81a6de2966e1b4ee1ac239766e769f19d831175a04264'))
])