peercoin / coinlib

The most feature-complete *coin library in the entire Dart/Flutter ecosystem.
BSD 3-Clause "New" or "Revised" License
5 stars 8 forks source link

libsecp256k1 requirement on Ubuntu? #20

Closed sneurlax closed 10 months ago

sneurlax commented 10 months ago

When I attempt to use coinlib as in

 coinlib.ECPublicKey ecPublicKey =
        coinlib.ECPublicKey.fromHex(hex.encode(Uint8List.fromList(publicKey!)));

I get the error flutter: Exception: Invalid argument(s): Failed to load dynamic library 'libsecp256k1.so': libsecp256k1.so: cannot open shared object file: No such file or directory or, with libsecp256k1-dev instealled, [libsecp256k1] illegal argument: secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx).

~$ flutter doctor -v
[!] Flutter (Channel unknown, 3.10.6, on Ubuntu 20.04.6 LTS 5.15.0-84-generic,
    locale en_US.UTF-8)
    ! Flutter version 3.10.6 on channel unknown at
      /home/user/development/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an
      official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions
      at https://flutter.dev/docs/get-started/install.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at
      https://flutter.dev/docs/get-started/install.
    • Framework revision f468f3366c (3 months ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/user/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at:
      /home/user/development/android-studio-2022.2.1.20-linux/android-studio/jbr
      /bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2022.3)
    • Android Studio at
      /home/user/development/android-studio-2022.2.1.20-linux/android-studio
    • Flutter plugin version 75.1.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.6 LTS
      5.15.0-84-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 115.0.5790.102

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
willyfromtheblock commented 10 months ago

Please advise if you have built the library accordingly: https://github.com/peercoin/coinlib/tree/master/coinlib#building-for-linux

sneurlax commented 10 months ago

I built bitcoin-core's secp256k1 repo from source and came back to say that resolved my issue, but following those instructions likely would have worked even better :) sorry for not RTFM