GeniusVentures / GeniusWallet

MIT License
9 stars 2 forks source link

FFI bridge to wallet-core on all OS #36

Closed henriqueaklein closed 6 months ago

henriqueaklein commented 8 months ago

Description

Checked the FFI bridge interface. The previous code was just compiling a POC source file with no link to the actual FFI file while translated the functions from wallet-core to dart accessible methods. The work on this branch was to link the part that has the bridge with the part that translates the C functions to dart methods. Since the libraries will be static the project needed to link to static libraries preferably without any additional code. Since the GeniusWallet is supposed to run in multiple OSs each of them required different changes to integrate the static libraries. The changes and features were done in a way to reduce as much as possible duplicating code, so for "cmake" build systems most common code was unified in one place, meanwhile for iOS and macOS their respectives Xcode projects were changed.

How to test

The expected "thirdparty" repository path is in the same level as the GeniusWallet cloned path. One should compile at least "wallet-core" for the desired architecture. Alter building the expected libraries are libTrustWallet.a, libwallet_core_rs.a and libTrezorCrypto.a (or TrustWallet.lib, wallet_core_rs.lib and TrezorCrypto.lib in case of "Windows"). Also the grpc's libprotobuf.a (or libprotobuf.lib) will be needed. Their paths will be in "${PRJ_NAME}/lib" folders in the build directory.

Changes

Known issues