Foreign Function interface for the Tari Android and Tari iOS Wallets.
This crate is part of the Tari Cryptocurrency project.
Install Brew
Shell Script
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run the following to install the needed bottles
Shell Script
brew install pkgconfig
brew install git
brew install make
brew install cmake
brew install autoconf
brew install automake
brew install libtool
Install XCode and then the XCode Command Line Tools with the following command
Shell Script
xcode-select --install
For macOS Mojave additional headers need to be installed, run
Shell Script
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
and follow the prompts
Download the Android NDK Bundle
Run the following to show hidden files and folders
Shell Script
defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder
Clone the following git repositories 1. Tari 2. Wallet-Android 3. Wallet-iOS
Afterwards cd
into the Tari repository and run the following
Shell Script
git submodule init
git config submodule.recurse true
git submodule update --recursive --remote
Install Rust
Install the following tools and system images
Shell Script
rustup toolchain add nightly-2019-10-04
rustup default nightly-2019-10-04
rustup component add rustfmt --toolchain nightly
rustup component add clippy
To configure the build, cd
to the Tari repository and then
Shell Script
cd base_layer/wallet_ffi
open build.sample.config
Which will present you with the file contents as follows ```text BUILDANDROID=1 BUILDIOS=1 SQLITESOURCE=https://www.sqlite.org/snapshot/sqlite-snapshot-201911192122.tar.gz NDKPATH=/Users/user/Desktop/android-ndk-r20 PKG_PATH=/usr/local/Cellar/zeromq/4.3.2/lib/pkgconfig
ANDROIDWALLETPATH=/Users/user/Desktop/wallet-android
IOSWALLETPATH=/Users/user/Desktop/wallet-ios
TARIREPOPATH=/Users/user/Desktop/tari-main
The following changes need to be made to the file
1.
NDKPATHneeds to be changed to the directory of the Android NDK Bundle.
2.
ANDROIDWALLETneeds to be changed to the path of the Android-Wallet repository
3.
IOSWALLETPATHneeds to be changed to the path of the Wallet-iOS repository
4.
TARIREPOPATHneeds to be changed to the path of the Tari repository
5.
BUILDANDROIDcan be set to
0to disable Android library build
6.
BUILDIOScan be set to
0``` to disable iOS library build
Save the file and rename it to build.config
To build the libraries, cd
to the Tari repository and then
Shell Script
cd base_layer/wallet_ffi
sh mobile_build.sh
The relevant libraries will then be built and placed in the appropriate directories of the Wallet-iOS and Wallet-Android repositories.