-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking to a locally installed secp256k1 (instead of system) #31
Comments
I expected that OS-dependent way would be used, that I agree that an option to give the path to |
will add this in a moment |
Please check e34a847 |
Although this is probably not what you need (still useful option though), as the library is imported in |
What I see as an option is adding some function like
before importing anything else from bitcointx. that will set How is the same task is handled in coincurve ? |
Yes, that was along the lines of what seemed the most reasonable solution to me.
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 |
please check |
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 ( |
I also added path option to |
Hi,
Thought I'd ask this as I'm struggling with this and it's possible you'll have a good idea about it @dgpv .
In joinmarket we currently use the binding coincurve which uses cffi and then either (a) links to an existing system libsecp256k1 if it's available (can be disabled) or (b) uses a "local" build by sourcing a tar archive from the secp256k1 repo; this generates during setup a *.so file in the coincurve directory (so e.g. in my virtualenv i have the file
/path/to/venv/lib/python3.6/site-packages/coincurve/_libsecp256k1.cpython-36m-x86_64-linux-gnu.so
) and then cffi uses that.I want to do the following: have
python-bitcointx
use a locally built libsecp256k1 instance so as to not overwrite any existing system installation and not to requiresudo
usage in installation. Building libsecp as part of the Joinmarket installation is fine, generally, as we require the same for libsodium anyway, so it's an easy add-on (I've already done it), just adding a--prefix
to the./configure
arguments. But what I don't know is how I can getpython-bitcointx
to recognize a local installation (or, anywhere apart from system, i.e./usr/local/lib
,/usr/lib
etc.); all I understand is that there is aload_secp256k1_library
which callsctypes.util.find_library
, but from examining that code I can't see how there would be any configuration that could tell it to recognize a shared library in a different location. (LD_LIBRARY_PATH can do it, but that's hacky and not portable, I believe).Do you have either (a) a thought on how I could achieve this as-is or (b) think it's possible to add a patch to make this feasible in
python-bitcointx
? Thanks.The text was updated successfully, but these errors were encountered: