summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/android.yml159
-rw-r--r--.github/workflows/linux.yml173
-rw-r--r--README.md20
-rw-r--r--libbridge/CMakeLists.txt24
-rw-r--r--libbridge/src/main/cpp/helpers.cpp15
-rw-r--r--libbridge/src/main/cpp/helpers.hpp3
-rw-r--r--libbridge/src/main/cpp/wallet2_api.h82
-rw-r--r--libbridge/src/main/cpp/wallet2_api_c.cpp283
-rw-r--r--libbridge/src/main/cpp/wallet2_api_c.h98
-rw-r--r--renovate.json3
10 files changed, 448 insertions, 412 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 4eb16bc..b11c7b0 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -50,9 +50,9 @@ env:
# utf8proc
UTF8PROC_HASH: '1cb28a66ca79a0845e99433fd1056257456cef8b'
# (finally) monero
- MONERO_GIT_SOURCE_SIMPLE: 'github.com_monero-project_monero'
- MONERO_GIT_SOURCE: https://github.com/monero-project/monero
- MONERO_TAG: 'v0.18.3.1'
+ MONERO_GIT_SOURCE_SIMPLE: 'git.mrcyjanek.net_mrcyjanek_monero'
+ MONERO_GIT_SOURCE: https://git.mrcyjanek.net/mrcyjanek/monero.git
+ MONERO_TAG: 'release-v0.18.3.1-anonero'
jobs:
@@ -92,94 +92,8 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- - name: Download cached build artifacts
- run: |
- ${{ github.workspace }}/download_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
- ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libcrypto.a
- ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libssl.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_date_time.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_filesystem.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_program_options.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_regex.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_wserialization.a
- ${{ github.workspace }}/download_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/common/libcommon.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device/libdevice.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/libversion.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/net/libnet.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/wallet/libwallet-crypto.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a
- - name: Create skip flag based on cache
- run: |
- if [[ -f "${{ github.workspace }}/prefix/lib/libsodium.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libcrypto.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libssl.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_chrono.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_date_time.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_filesystem.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_program_options.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_regex.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_serialization.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_system.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_thread.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_wserialization.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libunbound.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet_api.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/common/libcommon.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/device/libdevice.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/libversion.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/net/libnet.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a" ]]; \
- then \
- echo "Cache exist, creating /tmp/skip_deps"; \
- touch /tmp/skip_deps; \
- else \
- echo "Cache missing, this will be a looooong build."; \
- fi
- name: Download monero
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& rm -rf monero && git clone ${MONERO_GIT_SOURCE} --depth=1 --branch ${MONERO_TAG} monero \
&& cd monero \
@@ -194,15 +108,13 @@ jobs:
&& rm -f /usr/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz
- name: Download Boost
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
- && curl -L -o boost_${BOOST_VERSION}.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
+ && curl -L -o boost_${BOOST_VERSION}.tar.bz2 https://archives.boost.io/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
&& tar -xf boost_${BOOST_VERSION}.tar.bz2 \
&& rm -f boost_${BOOST_VERSION}.tar.bz2
- name: Download iconv
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& curl -O http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz \
&& echo "${ICONV_HASH} libiconv-${ICONV_VERSION}.tar.gz" | sha256sum -c \
@@ -210,7 +122,6 @@ jobs:
&& rm -f libiconv-${ICONV_VERSION}.tar.gz
- name: Download zlib
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& curl -O https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz \
&& echo "${ZLIB_HASH} zlib-${ZLIB_VERSION}.tar.gz" | sha256sum -c \
@@ -219,7 +130,6 @@ jobs:
&& mv zlib-${ZLIB_VERSION} zlib
- name: Download OpenSSL
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& curl -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
@@ -227,42 +137,36 @@ jobs:
&& rm openssl-${OPENSSL_VERSION}.tar.gz
- name: Download ZMQ
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} --depth=1 \
&& cd libzmq \
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1
- name: Download libsodium
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} --depth=1 \
&& cd libsodium \
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1
- name: Download libexpat
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/libexpat/libexpat.git -b ${LIBEXPAT_VERSION} --depth=1 \
&& cd libexpat/expat \
&& test `git rev-parse HEAD` = ${LIBEXPAT_HASH} || exit 1 \
- name: Download libunbound
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/NLnetLabs/unbound.git -b ${LIBUNBOUND_VERSION} --depth=1 \
&& cd unbound \
&& test `git rev-parse HEAD` = ${LIBUNBOUND_HASH} || exit 1
- name: Download polyseed
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/tevador/polyseed.git \
&& cd polyseed \
&& git reset --hard ${POLYSEED_HASH}
- name: Download utf8proc
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/JuliaStrings/utf8proc -b v2.8.0 --depth=1 \
&& cd utf8proc \
@@ -281,7 +185,6 @@ jobs:
# TODO(mrcyjanek): x86_64-linux-gnu <- get this dynamically.
- name: Build iconv (for boost)
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libiconv-${ICONV_VERSION} \
&& CC=clang CXX=clang++ ./configure --build=x86_64-linux-gnu --host=${{ matrix.host_triplet }} --prefix=${PREFIX} --disable-rpath \
@@ -289,20 +192,17 @@ jobs:
&& make install
- name: Build boost (2/2)
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd boost_${BOOST_VERSION} \
&& ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=android --stagedir=android toolset=clang threading=multi threadapi=pthread target-os=android -sICONV_PATH=${PREFIX} install -j${NPROC} &>/tmp/boost_log.txt || cat /tmp/boost_log.txt
- name: Build zlib
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd zlib \
&& CC=clang CXX=clang++ ./configure --static \
&& make -j${NPROC}
- name: Build OpenSSL
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd openssl-${OPENSSL_VERSION} \
&& export PATH=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH \
@@ -311,7 +211,6 @@ jobs:
&& make install_sw &>/tmp/openssl_log_2.txt || cat /tmp/openssl_log_2.txt
- name: Build ZMQ
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libzmq \
&& ./autogen.sh \
@@ -320,7 +219,6 @@ jobs:
&& make install
- name: Build Sodium
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libsodium \
&& ./autogen.sh \
@@ -329,7 +227,6 @@ jobs:
&& make install
- name: Build libexpat
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libexpat/expat \
&& ./buildconf.sh \
@@ -338,7 +235,6 @@ jobs:
&& make install
- name: Build libunbound
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd unbound \
&& CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${{ matrix.host_triplet }} --enable-static --disable-shared --disable-flto --with-ssl=${PREFIX} --with-libexpat=${PREFIX} \
@@ -346,7 +242,6 @@ jobs:
&& make install
- name: Build polyseed
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd polyseed \
&& CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} . \
@@ -354,7 +249,6 @@ jobs:
&& make install
- name: Build utf8proc
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd utf8proc \
&& mkdir build \
@@ -365,7 +259,6 @@ jobs:
&& make install
- name: Build monero (1/2) configure
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd monero \
&& export CMAKE_INCLUDE_PATH="${PREFIX}/include" \
@@ -380,7 +273,6 @@ jobs:
&& env CC=clang CXX=clang++ cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="${{ matrix.monero_arch }}" -D STATIC=ON -D BUILD_64="${{ matrix.monero_build64 }}" -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D BUILD_TAG="${{ matrix.monero_buildtag }}" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI="${{ matrix.full_arch }}" ../.. ; fi
- name: Build monero (2/2) build
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd monero \
&& cd build/release \
@@ -392,7 +284,6 @@ jobs:
&& make wallet_api -j${NPROC}
- name: Copy prefix from $PREFIX to local
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cp -a /opt/android/prefix ${{ github.workspace }}/prefix
- name: Build libbridge (1/2) configure
@@ -430,44 +321,4 @@ jobs:
files: |-
${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.xz
${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.sha256
- ${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.xz.sha256
- - name: Create cache entries
- run: |
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libcrypto.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libssl.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_date_time.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_filesystem.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_program_options.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_regex.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_wserialization.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/common/libcommon.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device/libdevice.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/libversion.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/net/libnet.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/wallet/libwallet-crypto.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a \ No newline at end of file
+ ${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.xz.sha256 \ No newline at end of file
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 06e9823..dfd1ea7 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -1,7 +1,9 @@
name: Linux Release
run-name: Building monero_c for linux
-on: push
-
+on:
+ push:
+ tags:
+ - '*'
# cat envs.txt | sed 's/ //g' | sed 's/: /=/g' | grep -v '#' > .env
# export $(cat .env | xargs)
env:
@@ -42,9 +44,9 @@ env:
# utf8proc
UTF8PROC_HASH: '1cb28a66ca79a0845e99433fd1056257456cef8b'
# (finally) monero
- MONERO_GIT_SOURCE_SIMPLE: 'github.com_monero-project_monero'
- MONERO_GIT_SOURCE: https://github.com/monero-project/monero
- MONERO_TAG: 'v0.18.3.1'
+ MONERO_GIT_SOURCE_SIMPLE: 'git.mrcyjanek.net_mrcyjanek_monero'
+ MONERO_GIT_SOURCE: https://git.mrcyjanek.net/mrcyjanek/monero.git
+ MONERO_TAG: 'release-v0.18.3.1-anonero'
jobs:
@@ -65,94 +67,8 @@ jobs:
run: apt update && apt install -y pkg-config m4 libtool automake autoconf bison checkinstall
- name: Checkout repository code
uses: actions/checkout@v3
- - name: Download cached build artifacts
- run: |
- ${{ github.workspace }}/download_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
- ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libcrypto.a
- ${{ github.workspace }}/download_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libssl.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_date_time.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_filesystem.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_program_options.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_regex.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
- ${{ github.workspace }}/download_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_wserialization.a
- ${{ github.workspace }}/download_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/common/libcommon.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device/libdevice.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/libversion.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/net/libnet.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/wallet/libwallet-crypto.a
- ${{ github.workspace }}/download_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a
- - name: Create skip flag based on cache
- run: |
- if [[ -f "${{ github.workspace }}/prefix/lib/libsodium.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libcrypto.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libssl.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_chrono.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_date_time.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_filesystem.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_program_options.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_regex.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_serialization.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_system.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_thread.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libboost_wserialization.a" ]] \
- && [[ -f "${{ github.workspace }}/prefix/lib/libunbound.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet_api.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/lib/libwallet.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/common/libcommon.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/device/libdevice.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/libversion.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/net/libnet.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a" ]] \
- && [[ -f "${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a" ]]; \
- then \
- echo "Cache exist, creating /tmp/skip_deps"; \
- touch /tmp/skip_deps; \
- else \
- echo "Cache missing, this will be a looooong build."; \
- fi
- name: Download monero
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& rm -rf monero && git clone ${MONERO_GIT_SOURCE} --depth=1 --branch ${MONERO_TAG} monero \
&& cd monero \
@@ -167,15 +83,13 @@ jobs:
&& rm -f /usr/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz
- name: Download Boost
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
- && curl -L -o boost_${BOOST_VERSION}.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
+ && curl -L -o boost_${BOOST_VERSION}.tar.bz2 https://archives.boost.io/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
&& tar -xf boost_${BOOST_VERSION}.tar.bz2 \
&& rm -f boost_${BOOST_VERSION}.tar.bz2
- name: Download iconv
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& curl -O http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz \
&& echo "${ICONV_HASH} libiconv-${ICONV_VERSION}.tar.gz" | sha256sum -c \
@@ -183,7 +97,6 @@ jobs:
&& rm -f libiconv-${ICONV_VERSION}.tar.gz
- name: Download zlib
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& curl -O https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz \
&& echo "${ZLIB_HASH} zlib-${ZLIB_VERSION}.tar.gz" | sha256sum -c \
@@ -192,7 +105,6 @@ jobs:
&& mv zlib-${ZLIB_VERSION} zlib
- name: Download OpenSSL
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& curl -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
@@ -200,49 +112,42 @@ jobs:
&& rm openssl-${OPENSSL_VERSION}.tar.gz
- name: Download ZMQ
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} --depth=1 \
&& cd libzmq \
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1
- name: Download libsodium
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} --depth=1 \
&& cd libsodium \
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1
- name: Download libexpat
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/libexpat/libexpat.git -b ${LIBEXPAT_VERSION} --depth=1 \
&& cd libexpat/expat \
&& test `git rev-parse HEAD` = ${LIBEXPAT_HASH} || exit 1 \
- name: Download libunbound
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/NLnetLabs/unbound.git -b ${LIBUNBOUND_VERSION} --depth=1 \
&& cd unbound \
&& test `git rev-parse HEAD` = ${LIBUNBOUND_HASH} || exit 1
- name: Download polyseed
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/tevador/polyseed.git \
&& cd polyseed \
&& git reset --hard ${POLYSEED_HASH}
- name: Download utf8proc
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& git clone https://github.com/JuliaStrings/utf8proc -b v2.8.0 --depth=1 \
&& cd utf8proc \
&& git reset --hard ${UTF8PROC_HASH}
- name: Build boost (1/2)
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd boost_${BOOST_VERSION} \
&& ./bootstrap.sh --prefix=${PREFIX}
@@ -250,7 +155,6 @@ jobs:
# TODO(mrcyjanek): x86_64-linux-gnu <- get this dynamically.
- name: Build iconv (for boost)
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libiconv-${ICONV_VERSION} \
&& ./configure --build=x86_64-linux-gnu --host=${{ matrix.host_triplet }} --prefix=${PREFIX} --disable-rpath \
@@ -258,21 +162,18 @@ jobs:
&& make install
- name: Build boost (2/2)
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd boost_${BOOST_VERSION} \
&& echo -n -e '\n#undef PTHREAD_STACK_MIN\n#define PTHREAD_STACK_MIN 16384\n' | cat - ./boost/thread/pthread/thread_data.hpp > temp && mv temp ./boost/thread/pthread/thread_data.hpp \
&& ./b2 cxxflags=-fPIC cflags=-fPIC --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=linux --stagedir=linux toolset=gcc threading=multi threadapi=pthread -sICONV_PATH=${PREFIX} install -j${NPROC} &>/tmp/boost_log.txt || cat /tmp/boost_log.txt
- name: Build zlib
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd zlib \
&& ./configure --static \
&& make -j${NPROC}
- name: Build OpenSSL
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd openssl-${OPENSSL_VERSION} \
&& ./Configure -static no-shared no-tests --with-zlib-include=${{ github.workspace }}/zlib/include --with-zlib-lib=${{ github.workspace }}/zlib/lib --prefix=${PREFIX} --openssldir=${PREFIX} -fpic \
@@ -280,7 +181,6 @@ jobs:
&& make install_sw &>/tmp/openssl_log_2.txt || cat /tmp/openssl_log_2.txt
- name: Build ZMQ
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libzmq \
&& ./autogen.sh \
@@ -290,16 +190,14 @@ jobs:
&& make install
- name: Build Sodium
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libsodium \
&& ./autogen.sh \
- && ./configure --prefix=${PREFIX} --host=${{ matrix.host_triplet }} --enable-static --disable-shared \
+ && ./configure --prefix=${PREFIX} --host=${{ matrix.host_triplet }} --enable-static --disable-shared --with-pic \
&& make -j${NPROC} \
&& make install
- name: Build libexpat
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd libexpat/expat \
&& ./buildconf.sh \
@@ -308,11 +206,9 @@ jobs:
&& make install
- name: Fix paths
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cp /opt/linux/prefix/lib64/* /opt/linux/prefix/lib -r
- name: Build libunbound
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd unbound \
&& ./configure -with-pic --prefix=${PREFIX} --enable-static --disable-shared --disable-flto --with-libexpat=${PREFIX} --with-ssl=${PREFIX} \
@@ -320,7 +216,6 @@ jobs:
&& make install
- name: Build polyseed
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd polyseed \
&& cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} . \
@@ -328,7 +223,6 @@ jobs:
&& make install
- name: Build utf8proc
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd utf8proc \
&& mkdir build \
@@ -339,7 +233,6 @@ jobs:
&& make install
- name: Build monero (1/2) configure
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd monero \
&& export CMAKE_INCLUDE_PATH="${PREFIX}/include" \
@@ -350,7 +243,6 @@ jobs:
&& env cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="${{ matrix.monero_arch }}" -D STATIC=ON -D BUILD_64="${{ matrix.monero_build64 }}" -D CMAKE_BUILD_TYPE=release -D ANDROID=false -D BUILD_TAG="${{ matrix.monero_buildtag }}" -D CMAKE_SYSTEM_NAME="Linux" ../..
- name: Build monero (2/2) build
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cd monero \
&& cd build/release \
@@ -361,7 +253,6 @@ jobs:
&& make wallet_api -j${NPROC}
- name: Copy prefix from $PREFIX to local
run: |
- [[ -f "/tmp/skip_deps" ]] && exit 0; \
cd ${{ github.workspace }} \
&& cp -a /opt/linux/prefix/lib64/* /opt/linux/prefix/lib \
&& cp -a /opt/linux/prefix ${{ github.workspace }}/prefix
@@ -388,13 +279,15 @@ jobs:
- name: Publish .deb
run: |
cd ${{ github.workspace }} \
- && checkinstall --type=debian --pkgname="libwallet2-api-c" --pkgversion="$(git describe --tags | sed 's/v//')" --nodoc --strip=no --stripso=no --maintainer=cyjan@mrcyjanek.net --install=no -y \
- ; curl --user mrcyjanek:$PAT_SECRET_PACKAGE --upload-file libwallet2-api-c*.deb https://git.mrcyjanek.net/api/packages/mrcyjanek/debian/pool/no-distro/main/upload
+ && LD_PRELOAD=/usr/lib/checkinstall/installwatch.so checkinstall --type=debian --pkgname="libwallet2-api-c" --pkgversion="$(git describe --tags | sed 's/v//')" --nodoc --strip=no --stripso=no --maintainer=cyjan@mrcyjanek.net --install=no -y \
+ ; ls -lah *.deb \
+ ; curl --user mrcyjanek:$PAT_SECRET_PACKAGE --upload-file $(echo *.deb) https://git.mrcyjanek.net/api/packages/mrcyjanek/debian/pool/no-distro/main/upload
# - name: act - copy workspace to /opt/wspace
# if: ${{ env.ACT }}
# run: cp -a ${{ github.workspace }} /opt/wspace
- name: Create release
uses: https://gitea.com/akkuman/gitea-release-action@v1
+ continue-on-error: true
with:
body: |
This is a **preview** release to be used by testers.
@@ -406,43 +299,3 @@ jobs:
${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.xz
${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.sha256
${{ github.workspace }}/libbridge/build/${{ matrix.host_triplet }}_libwallet2_api_c.so.xz.sha256
- - name: Create cache entries
- run: |
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh libsodium "${SODIUM_VERSION}-${{ matrix.host_triplet }}-${SODIUM_HASH}" ${{ github.workspace }}/prefix/lib/libsodium.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libcrypto.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh openssl "${OPENSSL_VERSION}-${{ matrix.host_triplet }}-${OPENSSL_HASH}" ${{ github.workspace }}/prefix/lib/libssl.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_chrono.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_date_time.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_filesystem.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_program_options.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_regex.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_serialization.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_system.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_thread.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh boost "${BOOST_VERSION_DOT}-${{ matrix.host_triplet }}-${BOOST_HASH}" ${{ github.workspace }}/prefix/lib/libboost_wserialization.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh libunbound "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/prefix/lib/libunbound.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet_api.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/lib/libwallet.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_core/libcryptonote_core.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_basic.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/mnemonics/libmnemonics.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/common/libcommon.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/libcncrypto.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/ringct/libringct_basic.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blockchain_db/libblockchain_db.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/db_drivers/liblmdb/liblmdb.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/easylogging++/libeasylogging.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/contrib/epee/src/libepee.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/blocks/libblocks.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/checkpoints/libcheckpoints.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device/libdevice.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/device_trezor/libdevice_trezor.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/multisig/libmultisig.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/libversion.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/net/libnet.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/hardforks/libhardforks.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/external/randomx/librandomx.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/rpc/librpc_base.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/crypto/wallet/libwallet-crypto.a
- PAT_SECRET_PACKAGE=${{ secrets.PAT_SECRET_PACKAGE }} ${{ github.workspace }}/save_artifact.sh monero "${MONERO_TAG}-${{ matrix.host_triplet }}-${MONERO_GIT_SOURCE_SIMPLE}" ${{ github.workspace }}/monero/build/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a \ No newline at end of file
diff --git a/README.md b/README.md
index 689d807..29254da 100644
--- a/README.md
+++ b/README.md
@@ -10,33 +10,33 @@ 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 \
--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/CMakeLists.txt b/libbridge/CMakeLists.txt
index 4729bb1..23e1f5e 100644
--- a/libbridge/CMakeLists.txt
+++ b/libbridge/CMakeLists.txt
@@ -72,6 +72,26 @@ set_target_properties(boost_wserialization PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/prefix/lib/libboost_wserialization.a)
#############
+# Polyseed
+#############
+
+add_library(polyseed STATIC IMPORTED)
+set_target_properties(polyseed PROPERTIES IMPORTED_LOCATION
+ ${EXTERNAL_LIBS_DIR}/prefix/lib/libpolyseed.a)
+
+add_library(polyseed-wrapper STATIC IMPORTED)
+set_target_properties(polyseed-wrapper PROPERTIES IMPORTED_LOCATION
+ ${EXTERNAL_LIBS_DIR}/monero/build/release/src/polyseed/libpolyseed_wrapper.a)
+
+#############
+# Utf8proc
+#############
+
+add_library(utf8proc STATIC IMPORTED)
+set_target_properties(utf8proc PROPERTIES IMPORTED_LOCATION
+ ${EXTERNAL_LIBS_DIR}/prefix/lib/libutf8proc.a)
+
+#############
# Monero
#############
@@ -237,6 +257,10 @@ target_link_libraries( wallet2_api_c
boost_thread
boost_wserialization
+ polyseed
+ polyseed-wrapper
+ utf8proc
+
ssl
crypto
diff --git a/libbridge/src/main/cpp/helpers.cpp b/libbridge/src/main/cpp/helpers.cpp
index 064ce36..04befc6 100644
--- a/libbridge/src/main/cpp/helpers.cpp
+++ b/libbridge/src/main/cpp/helpers.cpp
@@ -143,3 +143,18 @@ const char* vectorToString(const std::set<uint32_t>& intSet, const std::string s
memcpy(buffer, str.c_str(), size + 1);
return buffer;
}
+
+std::set<std::string> splitString(const std::string& str, const std::string& delim) {
+ std::set<std::string> tokens;
+ if (str.empty()) return tokens;
+ size_t pos = 0;
+ std::string token;
+ std::string content = str; // Copy of str so we can safely erase content
+ while ((pos = content.find(delim)) != std::string::npos) {
+ token = content.substr(0, pos);
+ tokens.insert(token);
+ content.erase(0, pos + delim.length());
+ }
+ tokens.insert(content); // Inserting the last token
+ return tokens;
+} \ No newline at end of file
diff --git a/libbridge/src/main/cpp/helpers.hpp b/libbridge/src/main/cpp/helpers.hpp
index 5d9b4a4..45fa624 100644
--- a/libbridge/src/main/cpp/helpers.hpp
+++ b/libbridge/src/main/cpp/helpers.hpp
@@ -7,4 +7,5 @@ const char* vectorToString(const std::vector<std::string>& vec, const std::strin
const char* vectorToString(const std::vector<uint32_t>& vec, const std::string separator);
const char* vectorToString(const std::vector<uint64_t>& vec, const std::string separator);
const char* vectorToString(const std::vector<std::set<uint32_t>>& vec, const std::string separator);
-const char* vectorToString(const std::set<uint32_t>& intSet, const std::string separator); \ No newline at end of file
+const char* vectorToString(const std::set<uint32_t>& intSet, const std::string separator);
+std::set<std::string> splitString(const std::string& str, const std::string& delim); \ No newline at end of file
diff --git a/libbridge/src/main/cpp/wallet2_api.h b/libbridge/src/main/cpp/wallet2_api.h
index 646e585..5612c66 100644
--- a/libbridge/src/main/cpp/wallet2_api.h
+++ b/libbridge/src/main/cpp/wallet2_api.h
@@ -38,6 +38,7 @@
#include <ctime>
#include <iostream>
#include <stdexcept>
+#include <cstdint>
// Public interface for libwallet library
namespace Monero {
@@ -287,6 +288,7 @@ struct CoinsInfo
virtual bool unlocked() const = 0;
virtual std::string pubKey() const = 0;
virtual bool coinbase() const = 0;
+ virtual std::string description() const = 0;
};
struct Coins
@@ -296,9 +298,12 @@ struct Coins
virtual CoinsInfo * coin(int index) const = 0;
virtual std::vector<CoinsInfo*> getAll() const = 0;
virtual void refresh() = 0;
+ virtual void setFrozen(std::string public_key) = 0;
virtual void setFrozen(int index) = 0;
+ virtual void thaw(std::string public_key) = 0;
virtual void thaw(int index) = 0;
virtual bool isTransferUnlocked(uint64_t unlockTime, uint64_t blockHeight) = 0;
+ virtual void setDescription(const std::string &public_key, const std::string &description) = 0;
};
struct SubaddressRow {
@@ -485,6 +490,12 @@ struct Wallet
ConnectionStatus_WrongVersion
};
+ enum BackgroundSyncType {
+ BackgroundSync_Off = 0,
+ BackgroundSync_ReusePassword = 1,
+ BackgroundSync_CustomPassword = 2
+ };
+
virtual ~Wallet() = 0;
virtual std::string seed(const std::string& seed_offset = "") const = 0;
virtual std::string getSeedLanguage() const = 0;
@@ -660,6 +671,7 @@ struct Wallet
result += unlockedBalance(i);
return result;
}
+ virtual uint64_t viewOnlyBalance(uint32_t accountIndex, const std::vector<std::string> &key_images = {}) const = 0;
/**
* @brief watchOnly - checks if wallet is watch only
@@ -740,6 +752,10 @@ struct Wallet
static void warning(const std::string &category, const std::string &str);
static void error(const std::string &category, const std::string &str);
+ virtual bool getPolyseed(std::string &seed, std::string &passphrase) const = 0;
+ static bool createPolyseed(std::string &seed_words, std::string &err, const std::string &language = "English");
+ static std::vector<std::pair<std::string, std::string>> getPolyseedLanguages();
+
/**
* @brief StartRefresh - Start/resume refresh thread (refresh every 10 seconds)
*/
@@ -883,7 +899,8 @@ struct Wallet
optional<std::vector<uint64_t>> amount, uint32_t mixin_count,
PendingTransaction::Priority = PendingTransaction::Priority_Low,
uint32_t subaddr_account = 0,
- std::set<uint32_t> subaddr_indices = {}) = 0;
+ std::set<uint32_t> subaddr_indices = {},
+ const std::set<std::string> &preferred_inputs = {}) = 0;
/*!
* \brief createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored
@@ -902,7 +919,8 @@ struct Wallet
optional<uint64_t> amount, uint32_t mixin_count,
PendingTransaction::Priority = PendingTransaction::Priority_Low,
uint32_t subaddr_account = 0,
- std::set<uint32_t> subaddr_indices = {}) = 0;
+ std::set<uint32_t> subaddr_indices = {},
+ const std::set<std::string> &preferred_inputs = {}) = 0;
/*!
* \brief createSweepUnmixableTransaction creates transaction with unmixable outputs.
@@ -940,6 +958,8 @@ struct Wallet
virtual uint64_t estimateTransactionFee(const std::vector<std::pair<std::string, uint64_t>> &destinations,
PendingTransaction::Priority priority) const = 0;
+ virtual bool hasUnknownKeyImages() const = 0;
+
/*!
* \brief exportKeyImages - exports key images to file
* \param filename
@@ -976,6 +996,43 @@ struct Wallet
*/
virtual bool scanTransactions(const std::vector<std::string> &txids) = 0;
+ /*!
+ * \brief setupBackgroundSync - setup background sync mode with just a view key
+ * \param background_sync_type - the mode the wallet background syncs in
+ * \param wallet_password
+ * \param background_cache_password - custom password to encrypt background cache, only needed for custom password background sync type
+ * \return - true on success
+ */
+ virtual bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password) = 0;
+
+ /*!
+ * \brief getBackgroundSyncType - get mode the wallet background syncs in
+ * \return - the type, or off if type is unknown
+ */
+ virtual BackgroundSyncType getBackgroundSyncType() const = 0;
+
+ /**
+ * @brief startBackgroundSync - sync the chain in the background with just view key
+ */
+ virtual bool startBackgroundSync() = 0;
+
+ /**
+ * @brief stopBackgroundSync - bring back spend key and process background synced txs
+ * \param wallet_password
+ */
+ virtual bool stopBackgroundSync(const std::string &wallet_password) = 0;
+
+ /**
+ * @brief isBackgroundSyncing - returns true if the wallet is background syncing
+ */
+ virtual bool isBackgroundSyncing() const = 0;
+
+ /**
+ * @brief isBackgroundWallet - returns true if the wallet is a background wallet
+ */
+ virtual bool isBackgroundWallet() const = 0;
+
+
virtual TransactionHistory * history() = 0;
virtual AddressBook * addressBook() = 0;
virtual Coins * coins() = 0;
@@ -1298,6 +1355,27 @@ struct WalletManager
WalletListener * listener = nullptr) = 0;
/*!
+ * \brief creates a wallet from a polyseed mnemonic phrase
+ * \param path Name of the wallet file to be created
+ * \param password Password of wallet file
+ * \param nettype Network type
+ * \param mnemonic Polyseed mnemonic
+ * \param passphrase Optional seed offset passphrase
+ * \param newWallet Whether it is a new wallet
+ * \param restoreHeight Override the embedded restore height
+ * \param kdf_rounds Number of rounds for key derivation function
+ * @return
+ */
+ virtual Wallet * createWalletFromPolyseed(const std::string &path,
+ const std::string &password,
+ NetworkType nettype,
+ const std::string &mnemonic,
+ const std::string &passphrase = "",
+ bool newWallet = true,
+ uint64_t restore_height = 0,
+ uint64_t kdf_rounds = 1) = 0;
+
+ /*!
* \brief Closes wallet. In case operation succeeded, wallet object deleted. in case operation failed, wallet object not deleted
* \param wallet previously opened / created wallet instance
* \return None
diff --git a/libbridge/src/main/cpp/wallet2_api_c.cpp b/libbridge/src/main/cpp/wallet2_api_c.cpp
index ce9c210..5659bb4 100644
--- a/libbridge/src/main/cpp/wallet2_api_c.cpp
+++ b/libbridge/src/main/cpp/wallet2_api_c.cpp
@@ -475,6 +475,15 @@ bool MONERO_CoinsInfo_coinbase(void* coinsInfo_ptr) {
Monero::CoinsInfo *coinsInfo = reinterpret_cast<Monero::CoinsInfo*>(coinsInfo_ptr);
return coinsInfo->internalOutputIndex();
}
+// virtual std::string description() const = 0;
+const char* MONERO_CoinsInfo_description(void* coinsInfo_ptr) {
+ Monero::CoinsInfo *coinsInfo = reinterpret_cast<Monero::CoinsInfo*>(coinsInfo_ptr);
+ std::string str = coinsInfo->description();
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
+}
// coins
@@ -490,12 +499,27 @@ void* MONERO_Coins_coin(void* coins_ptr, int index) {
Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
return coins->coin(index);
}
+
+int MONERO_Coins_getAll_size(void* coins_ptr) {
+ Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
+ return coins->getAll().size();
+}
+void* MONERO_Coins_getAll_byIndex(void* coins_ptr, int index) {
+ Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
+ return coins->getAll()[index];
+}
+
// virtual std::vector<CoinsInfo*> getAll() const = 0;
// virtual void refresh() = 0;
void MONERO_Coins_refresh(void* coins_ptr) {
Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
return coins->refresh();
}
+// virtual void setFrozen(std::string public_key) = 0;
+void MONERO_Coins_setFrozenByPublicKey(void* coins_ptr, const char* public_key) {
+ Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
+ return coins->setFrozen(std::string(public_key));
+}
// virtual void setFrozen(int index) = 0;
void MONERO_Coins_setFrozen(void* coins_ptr, int index) {
Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
@@ -506,11 +530,21 @@ void MONERO_Coins_thaw(void* coins_ptr, int index) {
Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
return coins->thaw(index);
}
+// virtual void thaw(std::string public_key) = 0;
+void MONERO_Coins_thawByPublicKey(void* coins_ptr, const char* public_key) {
+ Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
+ return coins->thaw(std::string(public_key));
+}
// virtual bool isTransferUnlocked(uint64_t unlockTime, uint64_t blockHeight) = 0;
bool MONERO_Coins_isTransferUnlocked(void* coins_ptr, uint64_t unlockTime, uint64_t blockHeight) {
Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
return coins->isTransferUnlocked(unlockTime, blockHeight);
}
+// virtual void setDescription(const std::string &public_key, const std::string &description) = 0;
+void MONERO_Coins_setDescription(void* coins_ptr, const char* public_key, const char* description) {
+ Monero::Coins *coins = reinterpret_cast<Monero::Coins*>(coins_ptr);
+ coins->setDescription(std::string(public_key), std::string(description));
+}
// SubaddressRow
@@ -923,6 +957,11 @@ uint64_t MONERO_Wallet_unlockedBalance(void* wallet_ptr, uint32_t accountIndex)
return wallet->unlockedBalance(accountIndex);
}
+uint64_t MONERO_Wallet_viewOnlyBalance(void* wallet_ptr, uint32_t accountIndex) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->viewOnlyBalance(accountIndex);
+}
+
// TODO
bool MONERO_Wallet_watchOnly(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
@@ -955,30 +994,17 @@ uint64_t MONERO_Wallet_daemonBlockChainHeight_cached(void* wallet_ptr) {
return daemonBlockChainHeight_cached;
}
-uint64_t daemonBlockChainHeight_cahceSleepTime = 1;
-bool daemonBlockChainHeight_cahceIsEnabled = false;
+bool daemonBlockChainHeight_cacheIsEnabled = false;
-void MONERO_Wallet_daemonBlockChainHeight_runThread(void* wallet_ptr) {
+void MONERO_Wallet_daemonBlockChainHeight_runThread(void* wallet_ptr, int seconds) {
while (true) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
daemonBlockChainHeight_cached = wallet->daemonBlockChainHeight();
- sleep(daemonBlockChainHeight_cahceSleepTime);
- std::cout << "MONERO: TICK: MONERO_Wallet_daemonBlockChainHeight_runThread: " << daemonBlockChainHeight_cached << std::endl;
+ sleep(seconds);
+ std::cout << "MONERO: TICK: MONERO_Wallet_daemonBlockChainHeight_runThread(" << seconds << "): " << daemonBlockChainHeight_cached << std::endl;
}
}
-bool MONERO_Wallet_daemonBlockChainHeight_enableRefresh(void* wallet_ptr, int seconds) {
- if (seconds < 1) {
- seconds = 1;
- }
- daemonBlockChainHeight_cahceSleepTime = seconds;
- if (daemonBlockChainHeight_cahceIsEnabled == true) {
- return true;
- }
- daemonBlockChainHeight_cahceIsEnabled = true;
- std::thread t1(MONERO_Wallet_daemonBlockChainHeight_runThread, wallet_ptr);
- return true;
-}
uint64_t MONERO_Wallet_daemonBlockChainTargetHeight(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->daemonBlockChainTargetHeight();
@@ -1048,6 +1074,29 @@ void MONERO_Wallet_init3(void* wallet_ptr, const char* argv0, const char* defaul
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->init(argv0, default_log_base_name, log_path, console);
}
+const char* MONERO_Wallet_getPolyseed(void* wallet_ptr, const char* passphrase) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ std::string seed = "";
+ std::string _passphrase = std::string(passphrase);
+ wallet->getPolyseed(seed, _passphrase);
+ std::string str = seed;
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
+}
+// static bool createPolyseed(std::string &seed_words, std::string &err, const std::string &language = "English");
+const char* MONERO_Wallet_createPolyseed() {
+ std::string seed_words = "";
+ std::string err;
+ Monero::Wallet::createPolyseed(seed_words, err);
+ std::string str = seed_words;
+ const std::string::size_type size = str.size();
+ char *buffer = new char[size + 1]; //we need extra char for NUL
+ memcpy(buffer, str.c_str(), size + 1);
+ return buffer;
+}
+
void MONERO_Wallet_startRefresh(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->startRefresh();
@@ -1120,12 +1169,24 @@ const char* MONERO_Wallet_getMultisigInfo(void* wallet_ptr) {
void* MONERO_Wallet_createTransaction(void* wallet_ptr, const char* dst_addr, const char* payment_id,
uint64_t amount, uint32_t mixin_count,
int pendingTransactionPriority,
- uint32_t subaddr_account) {
+ uint32_t subaddr_account,
+ const char* preferredInputs, const char* separator) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ Monero::optional<uint64_t> optAmount;
+ if (amount != 0) {
+ optAmount = amount;
+ }
+ std::set<uint32_t> subaddr_indices = {};
+ std::set<std::string> preferred_inputs = splitString(std::string(preferredInputs), std::string(separator));
+ wallet->info("MONERO_C", "TEST");
+ wallet->info("MONERO_C", preferredInputs);
+ wallet->info("MONERO_C", std::to_string(preferred_inputs.size()));
+ auto oneInput = *(preferred_inputs.begin());
+ wallet->info("MONERO_C", oneInput);
return wallet->createTransaction(std::string(dst_addr), std::string(payment_id),
- amount, mixin_count,
+ optAmount, mixin_count,
Monero::PendingTransaction::Priority_Low,
- subaddr_account /*, subaddr_indices */);
+ subaddr_account, subaddr_indices, preferred_inputs);
}
void* MONERO_Wallet_loadUnsignedTx(void* wallet_ptr, const char* fileName) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
@@ -1135,6 +1196,10 @@ bool MONERO_Wallet_submitTransaction(void* wallet_ptr, const char* fileName) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->submitTransaction(std::string(fileName));
}
+bool MONERO_Wallet_hasUnknownKeyImages(void* wallet_ptr) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->hasUnknownKeyImages();
+}
bool MONERO_Wallet_exportKeyImages(void* wallet_ptr, const char* filename, bool all) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->exportKeyImages(std::string(filename), all);
@@ -1151,6 +1216,36 @@ bool MONERO_Wallet_importOutputs(void* wallet_ptr, const char* filename) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->importOutputs(std::string(filename));
}
+// virtual bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password) = 0;
+bool MONERO_Wallet_setupBackgroundSync(void* wallet_ptr, int background_sync_type, const char* wallet_password, const char* background_cache_password) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->setupBackgroundSync(Monero::Wallet::BackgroundSyncType::BackgroundSync_CustomPassword, std::string(wallet_password), std::string(background_cache_password));
+}
+// virtual BackgroundSyncType getBackgroundSyncType() const = 0;
+int MONERO_Wallet_getBackgroundSyncType(void* wallet_ptr) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->getBackgroundSyncType();
+}
+// virtual bool startBackgroundSync() = 0;
+bool MONERO_Wallet_startBackgroundSync(void* wallet_ptr) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->startBackgroundSync();
+}
+// virtual bool stopBackgroundSync(const std::string &wallet_password) = 0;
+bool MONERO_Wallet_stopBackgroundSync(void* wallet_ptr, const char* wallet_password) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->stopBackgroundSync(std::string(wallet_password));
+}
+// virtual bool isBackgroundSyncing() const = 0;
+bool MONERO_Wallet_isBackgroundSyncing(void* wallet_ptr) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->hasUnknownKeyImages();
+}
+// virtual bool isBackgroundWallet() const = 0;
+bool MONERO_Wallet_isBackgroundWallet(void* wallet_ptr) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->isBackgroundWallet();
+}
void* MONERO_Wallet_history(void* wallet_ptr) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->history();
@@ -1300,9 +1395,10 @@ uint64_t MONERO_Wallet_getBytesSent(void* wallet_ptr) {
return wallet->getBytesSent();
}
-void* MONERO_WalletManager_createWallet(const char* path, const char* password, const char* language, int networkType) {
- Monero::Wallet *wallet =
- Monero::WalletManagerFactory::getWalletManager()->createWallet(
+
+void* MONERO_WalletManager_createWallet(void* wm_ptr, const char* path, const char* password, const char* language, int networkType) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ Monero::Wallet *wallet = wm->createWallet(
std::string(path),
std::string(password),
std::string(language),
@@ -1310,20 +1406,20 @@ void* MONERO_WalletManager_createWallet(const char* path, const char* password,
return reinterpret_cast<void*>(wallet);
}
-void* MONERO_WalletManager_openWallet(const char* path, const char* password, int networkType) {
- Monero::Wallet *wallet =
- Monero::WalletManagerFactory::getWalletManager()->openWallet(
+void* MONERO_WalletManager_openWallet(void* wm_ptr, const char* path, const char* password, int networkType) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ Monero::Wallet *wallet = wm->openWallet(
std::string(path),
std::string(password),
static_cast<Monero::NetworkType>(networkType));
return reinterpret_cast<void*>(wallet);
}
-void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password, const char* mnemonic, int networkType, uint64_t restoreHeight, uint64_t kdfRounds, const char* seedOffset) {
+void* MONERO_WalletManager_recoveryWallet(void* wm_ptr, const char* path, const char* password, const char* mnemonic, int networkType, uint64_t restoreHeight, uint64_t kdfRounds, const char* seedOffset) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
// (const std::string &path, const std::string &password, const std::string &mnemonic,
// NetworkType nettype = MAINNET, uint64_t restoreHeight = 0, uint64_t kdf_rounds = 1,
// const std::string &seed_offset = {})
- Monero::Wallet *wallet =
- Monero::WalletManagerFactory::getWalletManager()->recoveryWallet(
+ Monero::Wallet *wallet = wm->recoveryWallet(
std::string(path),
std::string(password),
std::string(mnemonic),
@@ -1333,85 +1429,136 @@ void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password
std::string(seedOffset));
return reinterpret_cast<void*>(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(void* wm_ptr, 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::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ Monero::Wallet *wallet = wm->createWalletFromKeys(
+ std::string(path),
+ std::string(password),
+ std::string(language),
+ static_cast<Monero::NetworkType>(nettype),
+ restoreHeight,
+ std::string(addressString),
+ std::string(viewKeyString),
+ std::string(spendKeyString));
+ return reinterpret_cast<void*>(wallet);
+}
-bool MONERO_WalletManager_closeWallet(void* wallet_ptr, bool store) {
+void* MONERO_WalletManager_createWalletFromPolyseed(void* wm_ptr, const char* path, const char* password,
+ int nettype, const char* mnemonic, const char* passphrase,
+ bool newWallet, uint64_t restore_height, uint64_t kdf_rounds) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->createWalletFromPolyseed(std::string(path),
+ std::string(password),
+ static_cast<Monero::NetworkType>(nettype),
+ std::string(mnemonic),
+ std::string(passphrase),
+ newWallet,
+ restore_height,
+ kdf_rounds);
+}
+
+
+bool MONERO_WalletManager_closeWallet(void* wm_ptr, void* wallet_ptr, bool store) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
- return Monero::WalletManagerFactory::getWalletManager()->closeWallet(
- wallet,
- store);
+ return wm->closeWallet(wallet, store);
}
-bool MONERO_WalletManager_walletExists(const char* path) {
- return Monero::WalletManagerFactory::getWalletManager()->walletExists(std::string(path));
+bool MONERO_WalletManager_walletExists(void* wm_ptr, const char* path) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->walletExists(std::string(path));
}
// virtual bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, bool no_spend_key, uint64_t kdf_rounds = 1) const = 0;
-bool MONERO_WalletManager_verifyWalletPassword(const char* keys_file_name, const char* password, bool no_spend_key, uint64_t kdf_rounds) {
- return Monero::WalletManagerFactory::getWalletManager()->verifyWalletPassword(std::string(keys_file_name), std::string(password), no_spend_key, kdf_rounds);
+bool MONERO_WalletManager_verifyWalletPassword(void* wm_ptr, const char* keys_file_name, const char* password, bool no_spend_key, uint64_t kdf_rounds) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->verifyWalletPassword(std::string(keys_file_name), std::string(password), no_spend_key, kdf_rounds);
}
// virtual bool queryWalletDevice(Wallet::Device& device_type, const std::string &keys_file_name, const std::string &password, uint64_t kdf_rounds = 1) const = 0;
// bool MONERO_WalletManager_queryWalletDevice(int device_type, const char* keys_file_name, const char* password, uint64_t kdf_rounds) {
// return Monero::WalletManagerFactory::getWalletManager()->queryWalletDevice(device_type, std::string(keys_file_name), std::string(password), kdf_rounds);
//}
// virtual std::vector<std::string> findWallets(const std::string &path) = 0;
-const char* MONERO_WalletManager_findWallets(const char* path, const char* separator) {
- return vectorToString(Monero::WalletManagerFactory::getWalletManager()->findWallets(std::string(path)), std::string(separator));
+const char* MONERO_WalletManager_findWallets(void* wm_ptr, const char* path, const char* separator) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return vectorToString(wm->findWallets(std::string(path)), std::string(separator));
}
-const char* MONERO_WalletManager_errorString() {
- std::string str = Monero::WalletManagerFactory::getWalletManager()->errorString();
+const char* MONERO_WalletManager_errorString(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ std::string str = wm->errorString();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
}
-void MONERO_WalletManager_setDaemonAddress(const char* address) {
- return Monero::WalletManagerFactory::getWalletManager()->setDaemonAddress(std::string(address));
+void MONERO_WalletManager_setDaemonAddress(void* wm_ptr, const char* address) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->setDaemonAddress(std::string(address));
}
-bool MONERO_WalletManager_setProxy(const char* address) {
- return Monero::WalletManagerFactory::getWalletManager()->setProxy(std::string(address));
+bool MONERO_WalletManager_setProxy(void* wm_ptr, const char* address) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->setProxy(std::string(address));
}
// virtual bool connected(uint32_t *version = NULL) = 0;
// virtual uint64_t blockchainHeight() = 0;
-uint64_t MONERO_WalletManager_blockchainHeight() {
- return Monero::WalletManagerFactory::getWalletManager()->blockchainHeight();
+uint64_t MONERO_WalletManager_blockchainHeight(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->blockchainHeight();
}
// virtual uint64_t blockchainTargetHeight() = 0;
-uint64_t MONERO_WalletManager_blockchainTargetHeight() {
- return Monero::WalletManagerFactory::getWalletManager()->blockchainTargetHeight();
+uint64_t MONERO_WalletManager_blockchainTargetHeight(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->blockchainTargetHeight();
}
// virtual uint64_t networkDifficulty() = 0;
-uint64_t MONERO_WalletManager_networkDifficulty() {
- return Monero::WalletManagerFactory::getWalletManager()->networkDifficulty();
+uint64_t MONERO_WalletManager_networkDifficulty(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->networkDifficulty();
}
// virtual double miningHashRate() = 0;
-double MONERO_WalletManager_miningHashRate() {
- return Monero::WalletManagerFactory::getWalletManager()->miningHashRate();
+double MONERO_WalletManager_miningHashRate(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->miningHashRate();
}
// virtual uint64_t blockTarget() = 0;
-uint64_t MONERO_WalletManager_blockTarget() {
- return Monero::WalletManagerFactory::getWalletManager()->blockTarget();
+uint64_t MONERO_WalletManager_blockTarget(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->blockTarget();
}
// virtual bool isMining() = 0;
-bool MONERO_WalletManager_isMining() {
- return Monero::WalletManagerFactory::getWalletManager()->isMining();
+bool MONERO_WalletManager_isMining(void* wm_ptr) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->isMining();
}
// virtual bool startMining(const std::string &address, uint32_t threads = 1, bool background_mining = false, bool ignore_battery = true) = 0;
-bool MONERO_WalletManager_startMining(const char* address, uint32_t threads, bool backgroundMining, bool ignoreBattery) {
- return Monero::WalletManagerFactory::getWalletManager()->startMining(std::string(address), threads, backgroundMining, ignoreBattery);
+bool MONERO_WalletManager_startMining(void* wm_ptr, const char* address, uint32_t threads, bool backgroundMining, bool ignoreBattery) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->startMining(std::string(address), threads, backgroundMining, ignoreBattery);
}
// virtual bool stopMining() = 0;
-bool MONERO_WalletManager_stopMining(const char* address) {
- return Monero::WalletManagerFactory::getWalletManager()->stopMining();
+bool MONERO_WalletManager_stopMining(void* wm_ptr, const char* address) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ return wm->stopMining();
}
// virtual std::string resolveOpenAlias(const std::string &address, bool &dnssec_valid) const = 0;
-const char* MONERO_WalletManager_resolveOpenAlias(const char* address, bool dnssec_valid) {
- std::string str = Monero::WalletManagerFactory::getWalletManager()->resolveOpenAlias(std::string(address), dnssec_valid);
+const char* MONERO_WalletManager_resolveOpenAlias(void* wm_ptr, const char* address, bool dnssec_valid) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ std::string str = wm->resolveOpenAlias(std::string(address), dnssec_valid);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
@@ -1420,6 +1567,11 @@ const char* MONERO_WalletManager_resolveOpenAlias(const char* address, bool dnss
// WalletManagerFactory
+void* MONERO_WalletManagerFactory_getWalletManager() {
+ Monero::WalletManager *wm = Monero::WalletManagerFactory::getWalletManager();
+ return reinterpret_cast<void*>(wm);
+}
+
void MONERO_WalletManagerFactory_setLogLevel(int level) {
Monero::WalletManagerFactory::setLogLevel(level);
}
@@ -1466,6 +1618,11 @@ const char* MONERO_DEBUG_test5_std() {
return text2;
}
+bool MONERO_DEBUG_isPointerNull(void* wallet_ptr) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return (wallet != NULL);
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/libbridge/src/main/cpp/wallet2_api_c.h b/libbridge/src/main/cpp/wallet2_api_c.h
index e38c51b..300d3ca 100644
--- a/libbridge/src/main/cpp/wallet2_api_c.h
+++ b/libbridge/src/main/cpp/wallet2_api_c.h
@@ -293,6 +293,8 @@ bool MONERO_CoinsInfo_unlocked(void* coinsInfo_ptr);
const char* MONERO_CoinsInfo_pubKey(void* coinsInfo_ptr);
// virtual bool coinbase() const = 0;
bool MONERO_CoinsInfo_coinbase(void* coinsInfo_ptr);
+// virtual std::string description() const = 0;
+const char* MONERO_CoinsInfo_description(void* coinsInfo_ptr);
// };
// struct Coins
// {
@@ -302,14 +304,22 @@ int MONERO_Coins_count(void* coins_ptr);
// virtual CoinsInfo * coin(int index) const = 0;
void* MONERO_Coins_coin(void* coins_ptr, int index);
// virtual std::vector<CoinsInfo*> getAll() const = 0;
+int MONERO_Coins_getAll_size(void* coins_ptr);
+void* MONERO_Coins_getAll_byIndex(void* coins_ptr, int index);
// virtual void refresh() = 0;
void MONERO_Coins_refresh(void* coins_ptr);
+// virtual void setFrozen(std::string public_key) = 0;
+void MONERO_Coins_setFrozenByPublicKey(void* coins_ptr, const char* public_key);
// virtual void setFrozen(int index) = 0;
void MONERO_Coins_setFrozen(void* coins_ptr, int index);
// virtual void thaw(int index) = 0;
void MONERO_Coins_thaw(void* coins_ptr, int index);
+// virtual void thaw(std::string public_key) = 0;
+void MONERO_Coins_thawByPublicKey(void* coins_ptr, const char* public_key);
// virtual bool isTransferUnlocked(uint64_t unlockTime, uint64_t blockHeight) = 0;
bool MONERO_Coins_isTransferUnlocked(void* coins_ptr, uint64_t unlockTime, uint64_t blockHeight);
+// virtual void setDescription(const std::string &public_key, const std::string &description) = 0;
+void MONERO_Coins_setDescription(void* coins_ptr, const char* public_key, const char* description);
// };
// struct SubaddressRow {
// public:
@@ -467,6 +477,14 @@ const int WalletConnectionStatus_Connected = 1;
// ConnectionStatus_WrongVersion
const int WalletConnectionStatus_WrongVersion = 2;
// };
+// enum BackgroundSyncType {
+// BackgroundSync_Off = 0,
+const int WalletBackgroundSync_Off = 0;
+// BackgroundSync_ReusePassword = 1,
+const int WalletBackgroundSync_ReusePassword = 1;
+// BackgroundSync_CustomPassword = 2
+const int BackgroundSync_CustomPassword = 2;
+// };
// virtual ~Wallet() = 0;
// virtual std::string seed(const std::string& seed_offset = "") const = 0;
const char* MONERO_Wallet_seed(void* wallet_ptr, const char* seed_offset);
@@ -561,6 +579,8 @@ uint64_t MONERO_Wallet_unlockedBalance(void* wallet_ptr, uint32_t accountIndex);
// return result;
// }
// virtual bool watchOnly() const = 0;
+// virtual uint64_t viewOnlyBalance(uint32_t accountIndex, const std::vector<std::string> &key_images = {}) const = 0;
+uint64_t MONERO_Wallet_viewOnlyBalance(void* wallet_ptr, uint32_t accountIndex);
bool MONERO_Wallet_watchOnly(void* wallet_ptr);
// virtual bool isDeterministic() const = 0;
bool MONERO_Wallet_isDeterministic(void* wallet_ptr);
@@ -573,7 +593,7 @@ uint64_t MONERO_Wallet_estimateBlockChainHeight(void* wallet_ptr);
// virtual uint64_t daemonBlockChainHeight() const = 0;
uint64_t MONERO_Wallet_daemonBlockChainHeight(void* wallet_ptr);
uint64_t MONERO_Wallet_daemonBlockChainHeight_cached(void* wallet_ptr);
-bool MONERO_Wallet_daemonBlockChainHeight_enableRefresh(void* wallet_ptr, int seconds);
+void MONERO_Wallet_daemonBlockChainHeight_runThread(void* wallet_ptr, int seconds);
// virtual uint64_t daemonBlockChainTargetHeight() const = 0;
uint64_t MONERO_Wallet_daemonBlockChainTargetHeight(void* wallet_ptr);
// virtual bool synchronized() const = 0;
@@ -617,6 +637,10 @@ void MONERO_Wallet_init3(void* wallet_ptr, const char* argv0, const char* defaul
// static void warning(const std::string &category, const std::string &str);
// static void error(const std::string &category, const std::string &str);
// virtual void startRefresh() = 0;
+// virtual bool getPolyseed(std::string &seed, std::string &passphrase) const = 0;
+const char* MONERO_Wallet_getPolyseed(void* wallet_ptr, const char* passphrase);
+// static bool createPolyseed(std::string &seed_words, std::string &err, const std::string &language = "English");
+const char* MONERO_Wallet_createPolyseed();
void MONERO_Wallet_startRefresh(void* wallet_ptr);
// virtual void pauseRefresh() = 0;
void MONERO_Wallet_pauseRefresh(void* wallet_ptr);
@@ -662,11 +686,13 @@ const char* MONERO_Wallet_getMultisigInfo(void* wallet_ptr);
// optional<uint64_t> amount, uint32_t mixin_count,
// PendingTransaction::Priority = PendingTransaction::Priority_Low,
// uint32_t subaddr_account = 0,
-// std::set<uint32_t> subaddr_indices = {}) = 0;
+// std::set<uint32_t> subaddr_indices = {},
+// const std::set<std::string> &preferred_inputs = {) = 0;
void* MONERO_Wallet_createTransaction(void* wallet_ptr, const char* dst_addr, const char* payment_id,
uint64_t amount, uint32_t mixin_count,
int pendingTransactionPriority,
- uint32_t subaddr_account); // std::nullopt
+ uint32_t subaddr_account,
+ const char* preferredInputs, const char* separator);
// virtual PendingTransaction * createSweepUnmixableTransaction() = 0;
// virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename) = 0;
void* MONERO_Wallet_loadUnsignedTx(void* wallet_ptr, const char* unsigned_filename);
@@ -675,6 +701,8 @@ bool MONERO_Wallet_submitTransaction(void* wallet_ptr, const char* fileName);
// virtual void disposeTransaction(PendingTransaction * t) = 0;
// virtual uint64_t estimateTransactionFee(const std::vector<std::pair<std::string, uint64_t>> &destinations,
// PendingTransaction::Priority priority) const = 0;
+// virtual bool hasUnknownKeyImages() const = 0;
+bool MONERO_Wallet_hasUnknownKeyImages(void* wallet_ptr);
// virtual bool exportKeyImages(const std::string &filename, bool all = false) = 0;
bool MONERO_Wallet_exportKeyImages(void* wallet_ptr, const char* filename, bool all);
// virtual bool importKeyImages(const std::string &filename) = 0;
@@ -684,6 +712,18 @@ bool MONERO_Wallet_exportOutputs(void* wallet_ptr, const char* filename, bool al
// virtual bool importOutputs(const std::string &filename) = 0;
bool MONERO_Wallet_importOutputs(void* wallet_ptr, const char* filename);
// virtual bool scanTransactions(const std::vector<std::string> &txids) = 0;
+// virtual bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password) = 0;
+bool MONERO_Wallet_setupBackgroundSync(void* wallet_ptr, int background_sync_type, const char* wallet_password, const char* background_cache_password);
+// virtual BackgroundSyncType getBackgroundSyncType() const = 0;
+int MONERO_Wallet_getBackgroundSyncType(void* wallet_ptr);
+// virtual bool startBackgroundSync() = 0;
+bool MONERO_Wallet_startBackgroundSync(void* wallet_ptr);
+// virtual bool stopBackgroundSync(const std::string &wallet_password) = 0;
+bool MONERO_Wallet_stopBackgroundSync(void* wallet_ptr, const char* wallet_password);
+// virtual bool isBackgroundSyncing() const = 0;
+bool MONERO_Wallet_isBackgroundSyncing(void* wallet_ptr);
+// virtual bool isBackgroundWallet() const = 0;
+bool MONERO_Wallet_isBackgroundWallet(void* wallet_ptr);
// virtual TransactionHistory * history() = 0;
void* MONERO_Wallet_history(void* wallet_ptr);
// virtual AddressBook * addressBook() = 0;
@@ -766,13 +806,13 @@ uint64_t MONERO_Wallet_getBytesSent(void* wallet_ptr);
// struct WalletManager
// {
// virtual Wallet * createWallet(const std::string &path, const std::string &password, const std::string &language, NetworkType nettype, uint64_t kdf_rounds = 1) = 0;
-void* MONERO_WalletManager_createWallet(const char* path, const char* password, const char* language, int networkType);
+void* MONERO_WalletManager_createWallet(void* wm_ptr, const char* path, const char* password, const char* language, int networkType);
// Wallet * createWallet(const std::string &path, const std::string &password, const std::string &language, bool testnet = false) // deprecated
// {
// return createWallet(path, password, language, testnet ? TESTNET : MAINNET);
// }
// virtual Wallet * openWallet(const std::string &path, const std::string &password, NetworkType nettype, uint64_t kdf_rounds = 1, WalletListener * listener = nullptr) = 0;
-void* MONERO_WalletManager_openWallet(const char* path, const char* password, int networkType);
+void* MONERO_WalletManager_openWallet(void* wm_ptr, const char* path, const char* password, int networkType);
// Wallet * openWallet(const std::string &path, const std::string &password, bool testnet = false) // deprecated
// {
// return openWallet(path, password, testnet ? TESTNET : MAINNET);
@@ -780,7 +820,7 @@ void* MONERO_WalletManager_openWallet(const char* path, const char* password, in
// virtual Wallet * recoveryWallet(const std::string &path, const std::string &password, const std::string &mnemonic,
// NetworkType nettype = MAINNET, uint64_t restoreHeight = 0, uint64_t kdf_rounds = 1,
// const std::string &seed_offset = {}) = 0;
-void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password, const char* mnemonic, int networkType, uint64_t restoreHeight, uint64_t kdfRounds, const char* seedOffset);
+void* MONERO_WalletManager_recoveryWallet(void* wm_ptr, const char* path, const char* password, const char* mnemonic, int networkType, uint64_t restoreHeight, uint64_t kdfRounds, const char* seedOffset);
// Wallet * recoveryWallet(const std::string &path, const std::string &password, const std::string &mnemonic,
// bool testnet = false, uint64_t restoreHeight = 0) // deprecated
// {
@@ -800,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(void* wm_ptr, 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,
@@ -836,46 +877,57 @@ void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password
// const std::string &subaddressLookahead = "",
// uint64_t kdf_rounds = 1,
// WalletListener * listener = nullptr) = 0;
+// virtual Wallet * createWalletFromPolyseed(const std::string &path,
+// const std::string &password,
+// NetworkType nettype,
+// const std::string &mnemonic,
+// const std::string &passphrase = "",
+// bool newWallet = true,
+// uint64_t restore_height = 0,
+// uint64_t kdf_rounds = 1) = 0;
+void* MONERO_WalletManager_createWalletFromPolyseed(void* wm_ptr, const char* path, const char* password,
+ int nettype, const char* mnemonic, const char* passphrase,
+ bool newWallet, uint64_t restore_height, uint64_t kdf_rounds);
// virtual bool closeWallet(Wallet *wallet, bool store = true) = 0;
-bool MONERO_WalletManager_closeWallet(void* wallet_ptr, bool store);
+bool MONERO_WalletManager_closeWallet(void* wm_ptr, void* wallet_ptr, bool store);
// virtual bool walletExists(const std::string &path) = 0;
-bool MONERO_WalletManager_walletExists(const char* path);
+bool MONERO_WalletManager_walletExists(void* wm_ptr, const char* path);
// virtual bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, bool no_spend_key, uint64_t kdf_rounds = 1) const = 0;
-bool MONERO_WalletManager_verifyWalletPassword(const char* keys_file_name, const char* password, bool no_spend_key, uint64_t kdf_rounds);
+bool MONERO_WalletManager_verifyWalletPassword(void* wm_ptr, const char* keys_file_name, const char* password, bool no_spend_key, uint64_t kdf_rounds);
// virtual bool queryWalletDevice(Wallet::Device& device_type, const std::string &keys_file_name, const std::string &password, uint64_t kdf_rounds = 1) const = 0;
// bool MONERO_WalletManager_queryWalletDevice(int device_type, const char* keys_file_name, const char* password, uint64_t kdf_rounds);
// virtual std::vector<std::string> findWallets(const std::string &path) = 0;
-const char* MONERO_WalletManager_findWallets(const char* path, const char* separator);
+const char* MONERO_WalletManager_findWallets(void* wm_ptr, const char* path, const char* separator);
// virtual std::string errorString() const = 0;
-const char* MONERO_WalletManager_errorString();
+const char* MONERO_WalletManager_errorString(void* wm_ptr);
// virtual void setDaemonAddress(const std::string &address) = 0;
-void MONERO_WalletManager_setDaemonAddress(const char* address);
+void MONERO_WalletManager_setDaemonAddress(void* wm_ptr, const char* address);
// virtual bool connected(uint32_t *version = NULL) = 0;
// virtual uint64_t blockchainHeight() = 0;
-uint64_t MONERO_WalletManager_blockchainHeight();
+uint64_t MONERO_WalletManager_blockchainHeight(void* wm_ptr);
// virtual uint64_t blockchainTargetHeight() = 0;
-uint64_t MONERO_WalletManager_blockchainTargetHeight();
+uint64_t MONERO_WalletManager_blockchainTargetHeight(void* wm_ptr);
// virtual uint64_t networkDifficulty() = 0;
-uint64_t MONERO_WalletManager_networkDifficulty();
+uint64_t MONERO_WalletManager_networkDifficulty(void* wm_ptr);
// virtual double miningHashRate() = 0;
-double MONERO_WalletManager_miningHashRate();
+double MONERO_WalletManager_miningHashRate(void* wm_ptr);
// virtual uint64_t blockTarget() = 0;
-uint64_t MONERO_WalletManager_blockTarget();
+uint64_t MONERO_WalletManager_blockTarget(void* wm_ptr);
// virtual bool isMining() = 0;
-bool MONERO_WalletManager_isMining();
+bool MONERO_WalletManager_isMining(void* wm_ptr);
// virtual bool startMining(const std::string &address, uint32_t threads = 1, bool background_mining = false, bool ignore_battery = true) = 0;
-bool MONERO_WalletManager_startMining(const char* address, uint32_t threads, bool backgroundMining, bool ignoreBattery);
+bool MONERO_WalletManager_startMining(void* wm_ptr, const char* address, uint32_t threads, bool backgroundMining, bool ignoreBattery);
// virtual bool stopMining() = 0;
-bool MONERO_WalletManager_stopMining(const char* address);
+bool MONERO_WalletManager_stopMining(void* wm_ptr, const char* address);
// virtual std::string resolveOpenAlias(const std::string &address, bool &dnssec_valid) const = 0;
-const char* MONERO_WalletManager_resolveOpenAlias(const char* address, bool dnssec_valid);
+const char* MONERO_WalletManager_resolveOpenAlias(void* wm_ptr, const char* address, bool dnssec_valid);
// static std::tuple<bool, std::string, std::string, std::string, std::string> checkUpdates(
// const std::string &software,
// std::string subdir,
// const char *buildtag = nullptr,
// const char *current_version = nullptr);
// virtual bool setProxy(const std::string &address) = 0;
-bool MONERO_WalletManager_setProxy(const char* address);
+bool MONERO_WalletManager_setProxy(void* wm_ptr, const char* address);
// };
int LogLevel_Silent = -1;
@@ -900,6 +952,7 @@ int LogLevel_Max = 4;
// LogLevel_Max = LogLevel_4
// };
// static WalletManager * getWalletManager();
+void* MONERO_WalletManagerFactory_getWalletManager();
// static void setLogLevel(int level);
void MONERO_WalletManagerFactory_setLogLevel(int level);
// static void setLogCategories(const std::string &categories);
@@ -914,6 +967,7 @@ uint64_t MONERO_DEBUG_test3(uint64_t x);
void* MONERO_DEBUG_test4(uint64_t x);
const char* MONERO_DEBUG_test5();
const char* MONERO_DEBUG_test5_std();
+bool MONERO_DEBUG_isPointerNull(void* wallet_ptr);
#ifdef __cplusplus
}
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 0000000..7190a60
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,3 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json"
+}