From bf0f5200b1d606318e8fdb6018b07c6af04ba85e Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 5 Jan 2024 14:36:33 +0100 Subject: update readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 689d807..8c3a1a1 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,24 @@ To contribute you can visit git.mrcyjanek.net/mrcyjanek/monero_c and open a PR, Builds are provided in the [release tab](https://git.mrcyjanek.net/mrcyjanek/monero_c/releases), built using Gitea Runners. Building locally is possible as well, althought it is rather a heavy task which takes ~2 hours to finish (excluding enviroment setup and some downloads). -Base image for the runner is `registry.mrcyjanek.net/androidndk:r17c`, which contains preinstalled NDK. `Dockerfile` can be obtained from [mrcyjanek/CIimages](https://git.mrcyjanek.net/mrcyjanek/CIimages/src/branch/master/Dockerfile.androidndk-r17c) repository. +Base image for the runner is `git.mrcyjanek.net/mrcyjanek/androidndk:r17c`, which contains preinstalled NDK. `Dockerfile` can be obtained from [mrcyjanek/CIimages](https://git.mrcyjanek.net/mrcyjanek/CIimages/src/branch/master/Dockerfile.androidndk-r17c) repository. Then to build `.github/workflows/*.yml` files are used. Local build? ```bash -$ act --pull=false -Pandroidndk-r17c=registry.mrcyjanek.net/androidndk:r17c +$ act --pull=false -Pandroidndk-r17c=git.mrcyjanek.net/mrcyjanek/androidndk:r17c ``` For development? ```bash -$ timeout 5 act --pull=false -Pandroidndk-r17c=registry.mrcyjanek.net/androidndk:r17c # needed to clear cache. -$ act --pull=false -Pandroidndk-r17c=registry.mrcyjanek.net/androidndk:r17c --reuse +$ timeout 5 act --pull=false -Pandroidndk-r17c=git.mrcyjanek.net/mrcyjanek/androidndk:r17c # needed to clear cache. +$ act --pull=false -Pandroidndk-r17c=git.mrcyjanek.net/mrcyjanek/androidndk:r17c --reuse $ docker ps CONTAINER ID IMAGE ..................................... -d0626dcd8c5d registry.mrcyjanek.net/androidndk:r17c .... +d0626dcd8c5d git.mrcyjanek.net/mrcyjanek/androidndk:r17c .... $ docker commit d0626dcd8c5d monero_c:dev $ docker run --rm -it \ -v $PWD/libbridge:/opt/wspace/libbridge_up \ -- cgit v1.2.3 From 74d93461682559a36eecb4b7b0e5728cd7f5389f Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sun, 7 Jan 2024 14:38:45 +0100 Subject: view-only support --- README.md | 10 +++++----- libbridge/src/main/cpp/wallet2_api_c.cpp | 22 ++++++++++++++++++++++ libbridge/src/main/cpp/wallet2_api_c.h | 1 + 3 files changed, 28 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8c3a1a1..29254da 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,10 @@ $ docker run --rm -it \ -v $PWD/libbridge:/opt/wspace/libbridge_up \ --entrypoint /bin/bash \ monero_c:dev -[docker] $ export 'PATH=/usr/cmake-3.14.6-Linux-x86_64/bin:/opt/android/toolchain/aarch64-linux-android/bin:/opt/android/toolchain/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' -[docker] $ cd /opt/wspace/libbridge_up -[docker] $ rm -rf build && mkdir build && cd build -[docker] $ env CC=clang CXX=clang++ cmake -DANDROID_ABI=-arm64-v8a .. -[docker] $ make +[docker] $ export 'PATH=/usr/cmake-3.14.6-Linux-x86_64/bin:/opt/android/toolchain/aarch64-linux-android/bin:/opt/android/toolchain/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \ + && cd /opt/wspace/libbridge_up \ + && rm -rf build && mkdir build && cd build \ + && env CC=clang CXX=clang++ cmake -DANDROID_ABI=-arm64-v8a .. \ + && make # Resulting file will be available in the current directory. ``` diff --git a/libbridge/src/main/cpp/wallet2_api_c.cpp b/libbridge/src/main/cpp/wallet2_api_c.cpp index 31f3bd4..95931fc 100644 --- a/libbridge/src/main/cpp/wallet2_api_c.cpp +++ b/libbridge/src/main/cpp/wallet2_api_c.cpp @@ -1428,6 +1428,28 @@ void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password std::string(seedOffset)); return reinterpret_cast(wallet); } +// virtual Wallet * createWalletFromKeys(const std::string &path, +// const std::string &password, +// const std::string &language, +// NetworkType nettype, +// uint64_t restoreHeight, +// const std::string &addressString, +// const std::string &viewKeyString, +// const std::string &spendKeyString = "", +// uint64_t kdf_rounds = 1) = 0; +void* MONERO_WalletManager_createWalletFromKeys(const char* path, const char* password, const char* language, int nettype, uint64_t restoreHeight, const char* addressString, const char* viewKeyString, const char* spendKeyString, uint64_t kdf_rounds) { + Monero::Wallet *wallet = + Monero::WalletManagerFactory::getWalletManager()->createWalletFromKeys( + std::string(path), + std::string(password), + std::string(language), + static_cast(nettype), + restoreHeight, + std::string(addressString), + std::string(viewKeyString), + std::string(spendKeyString)); + return reinterpret_cast(wallet); +} void* MONERO_WalletManager_createWalletFromPolyseed(const char* path, const char* password, int nettype, const char* mnemonic, const char* passphrase, diff --git a/libbridge/src/main/cpp/wallet2_api_c.h b/libbridge/src/main/cpp/wallet2_api_c.h index 27aa2e3..0f993c3 100644 --- a/libbridge/src/main/cpp/wallet2_api_c.h +++ b/libbridge/src/main/cpp/wallet2_api_c.h @@ -840,6 +840,7 @@ void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password // const std::string &viewKeyString, // const std::string &spendKeyString = "", // uint64_t kdf_rounds = 1) = 0; +void* MONERO_WalletManager_createWalletFromKeys(const char* path, const char* password, const char* language, int nettype, uint64_t restoreHeight, const char* addressString, const char* viewKeyString, const char* spendKeyString, uint64_t kdf_rounds); // Wallet * createWalletFromKeys(const std::string &path, // const std::string &password, // const std::string &language, -- cgit v1.2.3