Giter Club home page Giter Club logo

Comments (9)

AdamISZ avatar AdamISZ commented on August 16, 2024 1

Confirmed 7933310 working by test: installed libsecp256k1.so in a custom location on a clean VM (Ubuntu1804),using --prefix argument to configure, then did a pip install of this package (pip3 install . in main dir of pbtx, inside a virtualenv), then ran python command prompt in the venv and did import bitcointx followed by bitcointx.set_custom_secp256k1_path('/path/to/.so') followed by import bitcointx.core, confirmed it loads OK, and confirmed it doesn't load OK with out the path setting function.
Thanks a lot!

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

I expected that OS-dependent way would be used, that ctypes.util.find_library() implements, so this scenario was not considered.

I agree that an option to give the path to load_secp256k1_library() is needed.

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

will add this in a moment

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

Please check e34a847

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

Although this is probably not what you need (still useful option though), as the library is imported in secp256k1.py with default path, and will give ImportError. Need some thought how this can be handled.

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

What I see as an option is adding some function like set_custom_secp256k1_path() to bitcointx/__init__.py so that you can do

import bitcointx

bitcointx.set_custom_secp256k1_path('/your/path')

before importing anything else from bitcointx.

that will set bitcointx.util._secp256k1_library_path global var, that bitcointx.core.secp256k1 will be able to access

How is the same task is handled in coincurve ?

from python-bitcointx.

AdamISZ avatar AdamISZ commented on August 16, 2024

What I see as an option

Yes, that was along the lines of what seemed the most reasonable solution to me.

How is the same task is handled in coincurve ?

I have not yet figured out. It uses cffi, and the setup.py uses distutils to build the shared object afaict. I guess this is somehow built into how the cffi package works, see e.g this module and how the member variable library_dirs there works; is it perhaps that cffi builds its own library object using something like rpath, which has a dependency on the base library? That would kinda make sense. But sorry, just spitballing here, haven't got to the bottom of it.

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

please check set_custom_secp256k1_path() added in 7933310

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

I also added path option to load_bitcoinconsensus_library() in 84a4c11

from python-bitcointx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.