Skip to content

Commit

Permalink
Merge branch 'master' into ledger
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/full_check.yaml
#	impls/monero.dart/lib/monero.dart
#	impls/monero.dart/pubspec.yaml
#	patches/monero/0016-add-dummy-device-for-ledger.patch
  • Loading branch information
konstantinullrich committed Oct 7, 2024
2 parents 04b29d8 + 67f4baa commit 98272ee
Show file tree
Hide file tree
Showing 58 changed files with 2,125 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/cirruslabs/flutter:3.24.1
FROM ghcr.io/cirruslabs/flutter:3.24.3
# FROM debian:bookworm

# Install dependencies
Expand Down
213 changes: 165 additions & 48 deletions .github/workflows/full_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
coin: [monero, wownero]
runs-on: ubuntu-latest
container:
image: debian:bookworm
image: debian:bullseye
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -631,6 +631,12 @@ jobs:
echo "const nanoNowNodesApiKey = '';" >> cw_nano/lib/.secrets.g.dart
echo "const tronGridApiKey = '';" >> cw_tron/lib/.secrets.g.dart
echo "const tronNowNodesApiKey = '';" >> cw_tron/lib/.secrets.g.dart
echo "const stealthExBearerToken = '';" >> lib/.secrets.g.dart
echo "const stealthExAdditionalFeePercent = '';" >> lib/.secrets.g.dart
echo "const letsExchangeBearerToken = '';" >> lib/.secrets.g.dart
echo "const letsExchangeAffiliateId = '';" >> lib/.secrets.g.dart
echo "const etherScanApiKey = '';" >> lib/.secrets.g.dart
echo "const polygonScanApiKey = '';" >> lib/.secrets.g.dart
- name: Rename app
run: |
Expand All @@ -654,68 +660,179 @@ jobs:
rm -rf wownero/contrib/depends/built/*/android_ndk
rm -rf wownero/contrib/depends/sources/android-ndk-r26d-linux.zip
wallet_xmruw_android:
needs: [ lib_android ]
strategy:
matrix:
coin: [monero, wownero]
#wallet_xmruw_android:
# needs: [ lib_android ]
# strategy:
# matrix:
# coin: [monero, wownero]
# runs-on: ubuntu-latest
# steps:
# - name: Install dependencies
# run: |
# sudo apt update
# sudo apt install -y build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf unzip python-is-python3 jq
# - uses: actions/download-artifact@v4
# with:
# name: android ${{ matrix.coin }}
# path: release/${{ matrix.coin }}
# - name: clone xmruw
# run: |
# git clone https://github.com/mrcyjanek/unnamed_monero_wallet
# cd unnamed_monero_wallet
# cp -a .fvm* ..
# - uses: kuhnroyal/flutter-fvm-config-action@v2
# id: fvm-config-action
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
# channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
# - uses: actions/setup-java@v4
# with:
# distribution: 'zulu'
# java-version: '17'
# - name: build xmruw (${{ matrix.coin }})
# run: |
# cd unnamed_monero_wallet
# if [[ "${{ matrix.coin }}" == "monero" ]]; then ./codegen.sh -DCOIN_MONERO -DLIBSTEALTH_DISABLED; fi
# if [[ "${{ matrix.coin }}" == "wownero" ]]; then ./codegen.sh -DCOIN_WOWNERO -DLIBSTEALTH_DISABLED; fi
# flutter pub get
# make version
# ./build_changelog.sh
# cp ../release/${{ matrix.coin }}/aarch64-linux-android_libwallet2_api_c.so.xz android/app/src/main/jniLibs/arm64-v8a/lib${{ matrix.coin }}_libwallet2_api_c.so.xz
# cp ../release/${{ matrix.coin }}/x86_64-linux-android_libwallet2_api_c.so.xz android/app/src/main/jniLibs/x86_64/lib${{ matrix.coin }}_libwallet2_api_c.so.xz
# cp ../release/${{ matrix.coin }}/armv7a-linux-androideabi_libwallet2_api_c.so.xz android/app/src/main/jniLibs/armeabi-v7a/lib${{ matrix.coin }}_libwallet2_api_c.so.xz
# unxz -f android/app/src/main/jniLibs/*/*.xz
# flutter build apk --release --flavor clean_${{ matrix.coin }}
# - name: Upload APK
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.coin }} xmruw apk
# path: unnamed_monero_wallet/build/app/outputs/flutter-apk/*.apk
bulk_lib_release:
name: create single release file
runs-on: ubuntu-latest
needs: [
lib_mingw, lib_android, lib_linux, lib_sailfishos_aarch64, lib_sailfishos_i486, lib_darwin, lib_macos, lib_ios
]
steps:
- uses: actions/download-artifact@v4
with:
name: android monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: android wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: darwin monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: darwin wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: ios monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: ios wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: linux monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: linux wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: macos monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: macos wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: mingw monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: mingw wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: sfos aarch64 monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: sfos aarch64 wownero
path: release/wownero
- uses: actions/download-artifact@v4
with:
name: sfos_i486 monero
path: release/monero
- uses: actions/download-artifact@v4
with:
name: sfos_i486 wownero
path: release/wownero
- name: zip release dir
run: zip -r release-bundle.zip release
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-bundle.zip
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Upload lib
uses: actions/upload-artifact@v4
with:
name: release-bulk
path: release
deno_monerots_test_linux:
name: test ts library
runs-on: ubuntu-24.04
needs: [
lib_linux
]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf unzip python-is-python3 jq
- uses: actions/download-artifact@v4
with:
name: android ${{ matrix.coin }}
path: release/${{ matrix.coin }}
- name: clone xmruw
name: linux monero
path: release/monero
- name: unpack and move monero_c
run: |
git clone https://github.com/mrcyjanek/unnamed_monero_wallet
cd unnamed_monero_wallet
cp -a .fvm* ..
- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: build xmruw (${{ matrix.coin }})
run: |
main_dir=$PWD
cd unnamed_monero_wallet
if [[ "${{ matrix.coin }}" == "monero" ]]; then ./codegen.sh -DCOIN_MONERO -DLIBSTEALTH_DISABLED; fi
if [[ "${{ matrix.coin }}" == "wownero" ]]; then ./codegen.sh -DCOIN_WOWNERO -DLIBSTEALTH_DISABLED; fi
sed -i '/ monero:/,/path:/c\ monero:\n path: '"$main_dir/impls/monero.dart" pubspec.yaml
flutter pub get
make version
./build_changelog.sh
cp ../release/${{ matrix.coin }}/aarch64-linux-android_libwallet2_api_c.so.xz android/app/src/main/jniLibs/arm64-v8a/lib${{ matrix.coin }}_libwallet2_api_c.so.xz
cp ../release/${{ matrix.coin }}/x86_64-linux-android_libwallet2_api_c.so.xz android/app/src/main/jniLibs/x86_64/lib${{ matrix.coin }}_libwallet2_api_c.so.xz
cp ../release/${{ matrix.coin }}/armv7a-linux-androideabi_libwallet2_api_c.so.xz android/app/src/main/jniLibs/armeabi-v7a/lib${{ matrix.coin }}_libwallet2_api_c.so.xz
unxz -f android/app/src/main/jniLibs/*/*.xz
flutter build apk --release --flavor clean_${{ matrix.coin }}
- name: Upload APK
uses: actions/upload-artifact@v4
unxz -f -k release/*/*.xz
- uses: denoland/setup-deno@v1
with:
name: ${{ matrix.coin }} xmruw apk
path: unnamed_monero_wallet/build/app/outputs/flutter-apk/*.apk
deno-version: vx.x.x
- name: Create symlink
run: |
cd impls/monero.ts
mkdir lib
cd lib
ln -s ../../../release/monero/x86_64-linux-gnu_libwallet2_api_c.so
mv x86_64-linux-gnu_libwallet2_api_c.so monero_libwallet2_api_c.so
cd ..
- name: Run tests
run: |
cd impls/monero.ts
deno run --unstable-ffi --allow-ffi checksum.ts
comment_pr:
name: comment on pr
runs-on: ubuntu-latest
needs: [
lib_mingw, lib_android, lib_linux, lib_sailfishos_aarch64, lib_sailfishos_i486, lib_darwin, lib_macos, lib_ios,
wallet_cake_android,
wallet_xmruw_android
wallet_cake_android #,
#wallet_xmruw_android
]
steps:
- uses: actions/github-script@v7
Expand Down Expand Up @@ -762,4 +879,4 @@ jobs:
with:
issue-number: ${{steps.get_issue_number.outputs.result}}
body: |
[download artifacts #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push)
[download artifacts #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push)
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
branch = build
[submodule "external/OpenSSL-for-iPhone"]
path = external/OpenSSL-for-iPhone
url = https://github.com/x2on/OpenSSL-for-iPhone.git
url = https://github.com/MrCyjaneK/OpenSSL-for-iPhone.git
[submodule "external/libsodium"]
path = external/libsodium
url = https://github.com/jedisct1/libsodium.git
branch = stable
[submodule "external/unbound"]
path = external/unbound
url = https://github.com/NLnetLabs/unbound.git
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deno.enable": true
}
2 changes: 1 addition & 1 deletion apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

set -e
cd $repo
git am -3 ../patches/$repo/*.patch
git am -3 --whitespace=fix --reject ../patches/$repo/*.patch
if [[ "$repo" == "wownero" ]];
then
pushd external/randomwow
Expand Down
2 changes: 1 addition & 1 deletion external/OpenSSL-for-iPhone
4 changes: 3 additions & 1 deletion external/ios/libsodium_apple-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ build_ios() {

mkdir -p "${PREFIX}/tmp"

echo "Building for iOS..."
echo "Building for iOS... ($LOG_FILE)"
./autogen.sh
./configure
build_ios >"$LOG_FILE" 2>&1 || exit 1

echo "Adding the Clibsodium module map for Swift..."
Expand Down
2 changes: 1 addition & 1 deletion external/libexpat
Submodule libexpat updated 139 files
2 changes: 1 addition & 1 deletion external/libsodium
Submodule libsodium updated 99 files
+12 −14 .github/workflows/ci.yml
+1 −1 .github/workflows/codeql-analysis.yml
+93 −119 .github/workflows/dotnet-core.yml
+1 −0 .gitignore
+33 −1 ChangeLog
+1 −1 LICENSE
+3 −0 Makefile.am
+31 −16 Makefile.in
+289 −132 aclocal.m4
+1 −1 appveyor.yml
+2 −2 azure-pipelines.yml
+7 −4 build-aux/compile
+672 −213 build-aux/config.sub
+8 −7 build-aux/depcomp
+7 −7 build-aux/install-sh
+48 −27 build-aux/missing
+11 −4 build-aux/test-driver
+175 −199 build.zig
+2 −0 builds/Makefile.am
+17 −4 builds/Makefile.in
+3 −3 builds/msvc/resource.rc
+2 −2 builds/msvc/version.h
+1 −0 builds/msvc/vs2010/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters
+1 −0 builds/msvc/vs2012/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters
+1 −0 builds/msvc/vs2013/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters
+1 −0 builds/msvc/vs2015/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters
+1 −0 builds/msvc/vs2017/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters
+1 −0 builds/msvc/vs2019/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters
+1 −0 builds/msvc/vs2022/libsodium/libsodium.vcxproj
+3 −0 builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters
+1 −0 ci/appveyor/libsodium.vcxproj
+3 −0 ci/appveyor/libsodium.vcxproj.filters
+2 −2 ci/appveyor/msvc-scripts/process.bat
+2,712 −1,891 configure
+21 −15 configure.ac
+15 −4 contrib/Makefile.in
+2 −5 dist-build/Makefile.am
+17 −9 dist-build/Makefile.in
+1 −1 dist-build/android-aar.sh
+0 −4 dist-build/android-arm.sh
+1 −1 dist-build/android-build.sh
+0 −4 dist-build/android-mips32.sh
+0 −4 dist-build/android-mips64.sh
+158 −175 dist-build/apple-xcframework.sh
+21 −21 dist-build/emscripten-symbols.def
+3 −3 dist-build/emscripten.sh
+6 −6 dist-build/generate-emscripten-symbols.sh
+0 −135 dist-build/ios.sh
+1 −1 dist-build/macos.sh
+7 −7 dist-build/msys2-win32.sh
+7 −7 dist-build/msys2-win64.sh
+1 −1 dist-build/wasm32-wasi.sh
+0 −114 dist-build/watchos.sh
+7 −2 packaging/dotnet-core/libsodium.pkgproj
+1 −1 packaging/nuget/package.config
+15 −4 src/Makefile.in
+2 −2 src/libsodium/Makefile.am
+368 −362 src/libsodium/Makefile.in
+8 −5 src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
+21 −2 src/libsodium/crypto_aead/aegis128l/aegis128l_common.h
+8 −5 src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
+19 −2 src/libsodium/crypto_aead/aegis256/aegis256_common.h
+9 −3 src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c
+6 −6 src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
+8 −5 src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c
+8 −4 src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c
+8 −3 src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c
+5 −0 src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c
+7 −1 src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c
+9 −5 src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c
+13 −6 src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c
+9 −3 src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c
+10 −4 src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
+1 −0 src/libsodium/crypto_sign/ed25519/ref10/keypair.c
+8 −5 src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c
+8 −3 src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c
+13 −10 src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c
+7 −1 src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c
+0 −3 src/libsodium/crypto_verify/verify.c
+18 −8 src/libsodium/include/Makefile.in
+2 −0 src/libsodium/include/sodium.h
+7 −7 src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h
+1 −1 src/libsodium/include/sodium/crypto_pwhash.h
+19 −5 src/libsodium/include/sodium/private/common.h
+1 −1 src/libsodium/include/sodium/private/sse2_64_32.h
+11 −1 src/libsodium/randombytes/internal/randombytes_internal_random.c
+1 −2 src/libsodium/sodium/runtime.c
+15 −4 test/Makefile.in
+3 −1 test/constcheck.sh
+67 −31 test/default/Makefile.in
+2 −2 test/default/box_seal.c
+2 −0 test/default/kdf_hkdf.c
+1 −1 test/default/pwhash_argon2id.c
2 changes: 1 addition & 1 deletion external/libzmq
17 changes: 14 additions & 3 deletions generate_checksum.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/bash
cd "$(realpath $(dirname $0))"

if [[ "$(uname)" == "Darwin" ]];
then
function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
fi

for coin in monero wownero;
do
submodule_hash=$(git ls-tree HEAD ${coin} | xargs | awk '{ print $3 }')
COIN=$(echo "$coin" | tr a-z A-Z)
COIN_wallet2_api_c_h_sha256=$(sha256sum ${coin}_libwallet2_api_c/src/main/cpp/wallet2_api_c.h | xargs | awk '{ print $1 }')
COIN_wallet2_api_c_cpp_sha256=$(sha256sum ${coin}_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp | xargs | awk '{ print $1 }')
COIN_wallet2_api_c_cpp_sha256=$(sha256sum ${coin}_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp | xargs | awk '{ print $1 }')-${submodule_hash}
COIN_wallet2_api_c_exp_sha256=$(sha256sum ${coin}_libwallet2_api_c/${coin}_libwallet2_api_c.exp | xargs | awk '{ print $1 }')
COIN_libwallet2_api_c_version=$(git log --exclude=${coin}_checksum.h --oneline -- ${coin}_libwallet2_api_c | wc -l)
COIN_libwallet2_api_c_date=$(git log --exclude=${coin}_checksum.h -1 --format=%ai -- ${coin}_libwallet2_api_c)

cat > ${coin}_libwallet2_api_c/src/main/cpp/${coin}_checksum.h << EOF
#ifndef MONEROC_CHECKSUMS
Expand All @@ -23,6 +27,13 @@ EOF
const String wallet2_api_c_h_sha256 = "${COIN_wallet2_api_c_h_sha256}";
const String wallet2_api_c_cpp_sha256 = "${COIN_wallet2_api_c_cpp_sha256}";
const String wallet2_api_c_exp_sha256 = "${COIN_wallet2_api_c_exp_sha256}";
EOF
cat > impls/monero.ts/checksum_${coin}.ts << EOF
export const ${coin}Checksum = {
wallet2_api_c_h_sha256: "${COIN_wallet2_api_c_h_sha256}",
wallet2_api_c_cpp_sha256: "${COIN_wallet2_api_c_cpp_sha256}",
wallet2_api_c_exp_sha256: "${COIN_wallet2_api_c_exp_sha256}",
}
EOF
done

7 changes: 7 additions & 0 deletions impls/monero.c#/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# monero.c#

> C# port for monero
This is not a ready-to-use package (as opposed to monero.dart and monero.ts), but it works. You can check the `monero_wrapper.cs`.

Currently C# code is optimized to be used in Godot.., if you are not planning to use it there - simply do not extend Node class and remove Godot import, if you are planning to use it in production, please let me know - we can work on a better approach to using monero with proper package code in here.
Loading

0 comments on commit 98272ee

Please sign in to comment.