consensus-go

module
v0.0.0-...-dfb9311 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2020 License: Apache-2.0

README

Build Status Coverage Report

Aleph Consensus

aleph logo

Aleph is an asynchronous and Byzantine fault tolerant consensus protocol aimed at ordering arbitrary messages (transactions). It has been designed to operate continuously under conditions where there is no bound on message-delivery delay and under the assumption that there is a significant probability of malicious behavior, making it an excellent fit for blockchain-related applications. For more information, check the paper

This repository contains an implementation founded by Aleph Zero Foundation.

Results from experiments run on AWS

The following results come from experiments performed on 112 nodes of AWS EC2 instances distributed uniformly between 7 different regions across Europe and United States. We used the m4.4xlarge instances with 16 cores and 64 GiB memory.

load txps latency
25.6 GiB/s 89600 tx/s 416ms

Installation

The implementation requires go version 1.12 and currently supports only Linux. It requires the following packages:

go get github.com/onsi/ginkgo/ginkgo

go get github.com/onsi/gomega/...

go get -v -d -t ./... - this should be run from consensus-go directory

Unit tests

To run unit tests please use the following command: ginkgo -r -p

Experiments

There are two types of experiments that can be performed:

  1. Local: go to experiments/local/single_machine and run ./run.sh addrs True
  2. Remote using AWS EC2:
  • Create an account on AWS, set up credentials, and a default region as described here.
  • Install packages needed for orchestrating experiments: GNU parallel, zip, unzip and Python 3 packages: fabric, boto3, ipython, tqdm, matplotlib
  • Then, go to experiments/aws and run python shell.py. This opens a shell with procedures orchestrating experiments. The main procedure is run_protocol(n_processes, regions, instance_type) that runs n_processes spread uniformly across specified regions. It uses EC2 machines of instance_type.
  • Before running any experiments, it is required to create OS images in all AWS regions in which machines will be spawned. Run create_images(regions), where regions is a list of all AWS regions of interest.
  • The most basic experiment can be run with run_protocol(7, use_regions(), 't2.micro'). It spawns 7 machines in 7 different regions: 4 in US and 3 in EU. As of time of writing, AWS EC2 was providing users with a limited time of free usage of machines of type t2.micro and some quota for free storage and data transfer, so such an experiment can be conducted free of charge.
  • The parameters of the protocol are defined in the file pkg/config/config.go.
  • After the experiment is finished, the logs containing useful data of the experiment can be downloaded with get_logs procedure.

Analyzing logs

After collecting the logs, the performance can be analyzed as follows python pkg/log_analyzer/loganal.py logs.zip

License

Aleph Go implementation is released under the Apache 2.0 license. See the LICENSE.txt for details

Directories

Path Synopsis
benchmarks
cmd
pkg
config
Package config reads and writes the configuration of the program.
Package config reads and writes the configuration of the program.
creator
Package creator contains the implementation of Creator together with functions for serializing and deserializing new epoch proofs.
Package creator contains the implementation of Creator together with functions for serializing and deserializing new epoch proofs.
crypto/signing
Package signing implements unit signing using the NaCl library.
Package signing implements unit signing using the NaCl library.
dag
Package dag implements a basic dag that accepts any sequence of units.
Package dag implements a basic dag that accepts any sequence of units.
dag/check
Package check implements wrappers for dags that validate whether units respect predefined rules.
Package check implements wrappers for dags that validate whether units respect predefined rules.
forking
Package forking provides services and DAG wrappers that handle alerts raised when forks are encountered.
Package forking provides services and DAG wrappers that handle alerts raised when forks are encountered.
gomel
Package gomel defines all the interfaces representing basic components for executing the Aleph consensus protocol.
Package gomel defines all the interfaces representing basic components for executing the Aleph consensus protocol.
linear
Package linear implements the algorithm for extending partial dag order into linear order.
Package linear implements the algorithm for extending partial dag order into linear order.
logging
Package logging sets up logging for gomel.
Package logging sets up logging for gomel.
orderer
Package orderer contains the main implementation of the gomel.Orderer interface.
Package orderer contains the main implementation of the gomel.Orderer interface.
random
Package random defines data structures used by various random sources.
Package random defines data structures used by various random sources.
random/beacon
Package beacon implements the beacon random source.
Package beacon implements the beacon random source.
random/coin
Package coin implements the coin random source.
Package coin implements the coin random source.
run
Package run defines API for running the whole consensus protocol.
Package run defines API for running the whole consensus protocol.
sync/fetch
Package fetch implements a mechanism of fetching specific units with known hashes.
Package fetch implements a mechanism of fetching specific units with known hashes.
sync/gossip
Package gossip implements a protocol for synchronizing dags through gossiping.
Package gossip implements a protocol for synchronizing dags through gossiping.
sync/handshake
Package handshake implements protocols for identifying the peer.
Package handshake implements protocols for identifying the peer.
sync/multicast
Package multicast implements a multicasting service to disseminate units created by us.
Package multicast implements a multicasting service to disseminate units created by us.
sync/rmc
Package rmc implements reliable multicast protocol for disseminating units.
Package rmc implements reliable multicast protocol for disseminating units.
tests
Package tests implements a very simple and unoptimized version of the dag.
Package tests implements a very simple and unoptimized version of the dag.
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL