Tools for experimenting with Bitcoin Core
Project description
verystable
(Because it's not very stable.)
This project contains a number of useful Python bindings for interaction with bitcoin.
Eventually it will contain a gallery of examples for doing useful things like interacting with the P2P network and building interesting scripts.
[!WARNING] This project is not maintained with use of real (mainnet) funds in mind. The bulk of the code comes from a test framework that is intended for use with regtest only. You might lose money using this!
Notably, this project copies the Bitcoin Core functional test framework in its entirety for use, which contains a number of helpful utilities.
This gives us good utilities for interacting with the P2P layer
(p2p.P2PInterface) as well as handling process-level bitcoind invocation
(test_node.TestNode).
This module could help with a variety of tasks:
- experimenting with script,
- demonstrating proposals,
- building a local relay which adapts the user's choice of protocol to bitcoin P2P messages,
- monitoring via the P2P network,
- programmatic management of bitcoind instances,
- general utilities related to bitcoin,
- and more.
Installation
pip install verystable
or from source:
$ git clone https://github.com/jamesob/verystable.git
$ cd verystable
$ pip install -e .
Bitcoin Core test utilities (among other things) are then importable:
$ python
>>> import verystable
>>> verystable.core.p2p.MAGIC_BYTES
{'mainnet': b'\xf9\xbe\xb4\xd9',
'testnet3': b'\x0b\x11\t\x07',
'regtest': b'\xfa\xbf\xb5\xda',
'signet': b'\n\x03\xcf@'}
Examples
Examples are contained in examples/.
- jamesob/opvault-demo: a wallet using
verystableto demonstrate an end-to-end use of the BIP-345 (OP_VAULT) proposal
Running tests
# with docker
make docker-pull
make test
# without docker
pip installe -e .[tests]
pytest verystable
ruff verystable
Adding tests
Just add a function prefixed with pytest in any file and it will be collected by the
py.test runner.
Pulling from upstream
To update the imported Bitcoin Core functional test framework code,
- run
./pull-from-upstream.sh <bitcoin-core-repo-path> - examine/commit the diff
- bump the
pyproject.tomlversion number if needed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file verystable-28.1.0.dev0.tar.gz.
File metadata
- Download URL: verystable-28.1.0.dev0.tar.gz
- Upload date:
- Size: 132.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc7a1508a387840d85544f5fbe7a0696adbccb0be81640e72921106e37696fa5
|
|
| MD5 |
34d88da0786ba7c6c500e9635823274b
|
|
| BLAKE2b-256 |
125502a1ed1859ae97090a97aa8e867885f6adc96eaeb705bafde5b574cb44e6
|
File details
Details for the file verystable-28.1.0.dev0-py3-none-any.whl.
File metadata
- Download URL: verystable-28.1.0.dev0-py3-none-any.whl
- Upload date:
- Size: 148.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3e8e3cd44bcc3b686fc74462a5b77e6bda344f8b94ef5fe805a9f8e243e6a6d
|
|
| MD5 |
07c8876ae3f96e62962020d257b05ccd
|
|
| BLAKE2b-256 |
0cd6fbba1192ce44f19c61f40eddfc00a4c1e77eebfc7c3b912852cdb9b05b1e
|