f1d2e82258
New design and features |
||
---|---|---|
nodejs_hydra | ||
sample | ||
.gitignore | ||
LICENSE | ||
README.md | ||
cargo-config.toml | ||
cargo-config.toml.template | ||
create-ndk-standalone.sh |
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
-
git clone git@github.com:poanetwork/hydrabadger-android.git
-
Download Android studio, NDK, rust etc..
-
set needs environments
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export NDK_HOME=$ANDROID_HOME/ndk-bundle
and etc
-
Download rustup. We will use this to setup Rust for cross-compiling.
curl https://sh.rustup.rs -sSf | sh
-
Download targets for Android.
# Android. rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
Compile
-
Create the standalone NDKs.
./create-ndk-standalone.sh
-
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.
-
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/
directorybuild.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
This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE file for details.