Comments (9)
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.
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.
will add this in a moment
from python-bitcointx.
Please check e34a847
from python-bitcointx.
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.
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.
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.
please check set_custom_secp256k1_path()
added in 7933310
from python-bitcointx.
I also added path option to load_bitcoinconsensus_library()
in 84a4c11
from python-bitcointx.
Related Issues (20)
- Can DeserializationValueBoundsError be triggered by a valid tx? HOT 6
- Taproot support HOT 18
- BIP32 test vector 5 should be added to tests and checked HOT 5
- How to handle libsecp256k1 ABI non-guarantees of stability HOT 5
- CPubKey class and invalid pubkeys - should the API be changed ?
- Potential problem with RIPEMD160 removal from newer OpenSSL versions by default HOT 2
- On MacOS-latest, openssl import fails (openssl is used for non-strict sig verification) HOT 1
- Consider adding scriptWitness to CTxIn
- sign-psbt.py example does not support electrum's testnet xpub encoding for p2wsh HOT 3
- Adding bech32 spending example HOT 4
- libbitcoinconsensus undefined symbol HOT 4
- Use libsecp256k1 v0.2.0? HOT 11
- Incompatibility with OpenSSL 3 HOT 9
- psbt.sign not support pubkey type witness_v1_taproot HOT 1
- CScript.witness_version() returns 0x51 instead of 1 for taproot HOT 13
- Iibbitcoinconsensus is deprecated by Core
- secp256k1 library not found HOT 2
- Consider OP_1NEGATE handling in CScriptOp (as per linked issue from Core) HOT 1
- Issues with configure bitcointx to work with libsecp256k1 HOT 2
- tapInternalKey issue while creating the transaction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bitcointx.