Go to file
KORuL f1d2e82258
Merge pull request #6 from poanetwork/new_design_and_features
New design and features
2019-03-11 04:29:41 -07:00
nodejs_hydra Automatic connectify with push FCM Firebase 2019-02-19 13:57:16 -08:00
sample * SwipeLayout for dialog list 2019-03-11 14:27:30 +03:00
.gitignore Automatic connectify with push FCM Firebase 2019-02-19 13:57:16 -08:00
LICENSE New Api 2018-11-01 14:52:27 -07:00
README.md Update README.md 2018-11-13 01:45:04 +03:00
cargo-config.toml Fundamental changes in the project structure 2018-11-12 14:36:29 -08:00
cargo-config.toml.template Fundamental changes in the project structure 2018-11-12 14:36:29 -08:00
create-ndk-standalone.sh Peer discovery through signal server 2018-11-13 15:08:09 -08:00

README.md

Hydrabadger

An experimental peer-to-peer client using the Honey Badger Byzantine Fault Tolerant consensus algorithm and Mobile messenger based on hbbft consensus

Usage

Setup


  1. git clone git@github.com:poanetwork/hydrabadger-android.git

  2. Download Android studio, NDK, rust etc..

  3. set needs environments

export ANDROID_HOME=/Users/$USER/Library/Android/sdk export NDK_HOME=$ANDROID_HOME/ndk-bundle

and etc

  1. Download rustup. We will use this to setup Rust for cross-compiling.

    curl https://sh.rustup.rs -sSf | sh
    
  2. Download targets for Android.

    # Android.
    rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
    

Compile


  1. Create the standalone NDKs.

    ./create-ndk-standalone.sh
    
  2. Copy the content of cargo-config.toml (consists of linker information of the Android targets) to ~/.cargo/config

    cp cargo-config.toml ~/.cargo/config
    

Creating the libraries


You use the sample/ project as an example.

  1. Build the libraries.

    #!/bin/sh
    
    #set -euo pipefail
    
    # Build the rust project.
    cd cargo
    cargo clean
    #cargo test
    
    # cargo lipo --release
    $PWD/compile.sh
    $PWD/move.sh
    

    or

    run in sample/ directory

    build.sh
    

Android project


cd sample/android

Run this project in Android Studio, this project uses the compiled Hydrabadger.

Current State


Network initialization node addition, transaction generation, consensus, and batch outputs are all generally working. Batch outputs for each epoch are printed to the log.

Overall the client is fragile and doesn't handle deviation from simple usage very well yet.

Unimplemented


  • Many edge cases and exceptions: disconnects, reconnects, etc.
    • Connecting to a network which is in the process of key generation causes the entire network to fail. For now, wait until the network starts outputting batches before connecting additional peer nodes.
  • Error handling is atrocious, most errors are simply printed to the log.
  • Usage as a library is still a work in progress as the API settles.
  • Much, much more...

License


License: LGPL v3.0

This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE file for details.