| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
GDK is a cross-platform, cross-language library for Blockstream Green wallets.
Read the API documentation at https://gdk.readthedocs.io/en/latest/
If you want to target Android you will need to download the NDK and set the ANDROID_NDK env variable to the directory you uncompress it to, for example export ANDROID_NDK=$HOME/Downloads/ndk or you can add it to your bash profile ~/.bash_profile
Install rustup: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install default rust toolchain: rustup install 1.85.0
Install additional rust targets for cross-building: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android x86_64-pc-windows-gnu aarch64-apple-ios x86_64-apple-ios
For Debian Bullseye:
sudo ./docker/debian/install_deps.sh
For Mac OSX:
Install Xcode and brew if not installed, then
brew update && brew install cmake automake autoconf libtool gnu-sed python3 pkg-config swig gnu-getopt (optional) gnu-tar xcode-select --install
IMPORTANT: Since the build scripts require GNU-style getopt rather than the macOS BSD-style version, ensure that gnu-getopt is installed and added to your PATH right before running the build script:
$ PATH="$(brew --prefix gnu-getopt)/bin:$PATH" ./tools/build.sh ...You may also need to change your PATH environment variable to add $HOME/Library/Python/3.X/bin
Using the tool in tools you can build in one go all the required dependencies for gdk
$ ./tools/builddeps.sh <options> --prefix <absolute-destination-path><options> are:
$ ./tools/builddeps.sh --clang --prefix $HOME/prebuilt/clangdownloads, builds and installs all dependencies using clang compiler under $HOME/prebuild/clang folder
A script located in tools is enough to cover most common build use cases
$ tools/build.sh <options><options> are:
tools/build.sh --clang --external-deps-dir $HOME/prefix/clangBuild output is placed in build-<target>, e.g. build-clang, build-gcc sub-directories.
* Cmake introduces the concept of COMPONENTs .GDK install is now split into two components: gdk-runtime includes only the dynamic library (with symbol files) and the python-wheel (if built and available); gdk-dev includes static library libgreenaddress-full.a, header files and all the header files for languages bindings like java and swift. CI as well as tools/build.sh --install <path> will always install everything.
This doesn't require any of the previous steps but requires docker installed; it will build the project
docker build -t greenaddress_sdk -f ./tools/Dockerfile . docker run -v $PWD:/root/gdk -it greenaddress_sdk
This will open a bash shell into the container, where you can then launch builds for any platform. The docker container provided by GreenAddress comes with dependencies already built under the /prebuid folder
root@bab682a071e6:~/gdk# ./tools/build.sh --gcc --external-deps-dir /prebuid/gcc
root@bab682a071e6:~/gdk# ./tools/build.sh --clang --external-deps-dir /prebuid/clangBy default the build type is release. A debug build can specified as
tools/build.sh --buildtype=debug --clang
or
tools/build.sh --buildtype=debugoptimized --clang
for a debug optimized build.
Java and Python wrappers are available if SWIG is installed.
If JAVA_HOME is set while the library is built, a Java wrapper is built exposing the API.
Similarly, if --python-version is passed to tools/build.sh a Python wrapper is built, for example:
./tools/build.sh --install $PWD --gcc --python-version 3.9
A swift wrapper is available at GreenAddress.swift.
| Back | FazBrowse Home | New Git URL |