Skip to content

Commit

Permalink
Merge branch 'master' into remove-deprecated-utcfromtimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Jun 3, 2024
2 parents f108522 + e554492 commit c411200
Show file tree
Hide file tree
Showing 91 changed files with 11,165 additions and 4,981 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/unittests-mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Bitcoinlib Tests Ubuntu - MySQL
on: [push]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
- name: Set up MySQL
env:
DB_DATABASE: bitcoinlib_test
DB_USER: root
DB_PASSWORD: root
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Install dependencies
run: |
python -m pip install .[dev]
- name: Test with coverage
env:
BCL_CONFIG_FILE: ${{ github.workspace }}/tests/config.ini.unittest
UNITTEST_DATABASE: mysql
run: coverage run --source=bitcoinlib -m unittest -v
9 changes: 4 additions & 5 deletions .github/workflows/unittests-noscrypt.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bitcoinlib Unittests Coveralls Ubuntu - No scrypt
name: Bitcoinlib Tests Ubuntu - No scrypt
on: [push]

jobs:
Expand All @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
Expand All @@ -19,7 +19,6 @@ jobs:
pip uninstall -y scrypt
- name: Test with coverage
env:
BCL_CONFIG_FILE: config_encryption.ini.unittest
UNITTESTS_FULL_DATABASE_TEST: False
BCL_CONFIG_FILE: ${{ github.workspace }}/tests/config_encryption.ini.unittest
DB_FIELD_ENCRYPTION_KEY: 11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff
run: coverage run --source=bitcoinlib -m unittest -v
40 changes: 40 additions & 0 deletions .github/workflows/unittests-postgresql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bitcoinlib Tests Ubuntu - PostgreSQL
on: [push]

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres

env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: bitcoinlib_test

options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install .[dev]
- name: Test with coverage
env:
BCL_CONFIG_FILE: ${{ github.workspace }}/tests/config.ini.unittest
UNITTEST_DATABASE: postgresql
DB_FIELD_ENCRYPTION_PASSWORD: verybadpassword
run: coverage run --source=bitcoinlib -m unittest -v
11 changes: 5 additions & 6 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bitcoinlib Unittests Coveralls Ubuntu
name: Bitcoinlib Tests Ubuntu
on: [push]

jobs:
Expand All @@ -7,12 +7,12 @@ jobs:

strategy:
matrix:
python: ["3.8", "3.10", "3.11"]
python: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
Expand All @@ -21,8 +21,7 @@ jobs:
python -m pip install .[dev]
- name: Test with coverage
env:
BCL_CONFIG_FILE: config.ini.unittest
UNITTESTS_FULL_DATABASE_TEST: False
BCL_CONFIG_FILE: ${{ github.workspace }}/tests/config.ini.unittest
run: coverage run --source=bitcoinlib -m unittest -v

- name: Coveralls
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/unittests_windows.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bitcoinlib Windows Unittests
name: Bitcoinlib Tests Windows
on: [push]

jobs:
Expand All @@ -7,9 +7,9 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: 'x64'
Expand All @@ -18,7 +18,6 @@ jobs:
python -m pip install .[dev]
- name: Test with coverage
env:
BCL_CONFIG_FILE: config.ini.unittest
UNITTESTS_FULL_DATABASE_TEST: False
BCL_CONFIG_FILE: ${{ github.workspace }}/tests/config.ini.unittest
PYTHONUTF8: 1
run: coverage run --source=bitcoinlib -m unittest -v
6 changes: 3 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ version: 2
formats: all

build:
image: latest
os: ubuntu-22.04
tools:
python: "3.11"

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.10
install:
- requirements: docs/requirements.txt
# - requirements: requirements.txt
15 changes: 15 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
RELEASE 0.6.15 - Small bugfixes, documentation updates
======================================================
* Some small bugfixes
* New properties for WalletKey class for multisig wallets
* Add Bcoin documentation, add FAQ, update other documentation
* Add dockerfile for Linux Mint

RELEASE 0.6.14 - Update installation instruction, docker & bugfixes
===================================================================
* Update installation instructions
* Add Docker files for testing and installation testing
* Fix Bitcoind constructors
* Fix issue with hexadecimal passwords for Mnemonics
* Fix regtest address prefix

RELEASE 0.6.13 - Update config & fix some bugs
==============================================
* Rewrite configuration files for easier installation
Expand Down
37 changes: 23 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ Python Bitcoin Library
Bitcoin cryptocurrency Library writen in Python.

Allows you to create a fully functional Bitcoin wallet with a single line of code.
Use this library to create and manage transactions, addresses/keys, wallets, mnemonic password phrases and blocks with
simple and straightforward Python code.
Use this library to create and manage transactions, addresses/keys, wallets, mnemonic password phrases
and blocks with simple and straightforward Python code.

You can use this library at a high level and create and manage wallets from the command line or at a low level
and create your own custom made transactions, scripts, keys or wallets.

The BitcoinLib connects to various service providers automatically to update wallets, transaction and
blockchain information.
blockchain information. You can also connect to a local
`Bitcoin <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bitcoind-connection.html>`_ or
`Bcoin node <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bcoin.html>`_.


.. image:: https://github.com/1200wd/bitcoinlib/actions/workflows/unittests.yaml/badge.svg
:target: https://github.com/1200wd/bitcoinlib/actions/workflows/unittests.yaml
Expand All @@ -30,7 +33,7 @@ blockchain information.
Install
-------

Installed required packages
Install required packages on Ubuntu or related Linux systems:

.. code-block:: bash
Expand All @@ -42,8 +45,11 @@ Then install using pip
$ pip install bitcoinlib
For more detailed installation instructions, how to install on other systems or troubleshooting please read https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.install.html
Check out the `more detailed installation instructions <https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.install.html>`_ to read how to install on other systems or for
troubleshooting.

If you are using docker you can check some Dockerfiles to create images in the
`docker <https://github.com/1200wd/bitcoinlib/tree/master/docker>`_ directory.

Documentation
-------------
Expand All @@ -64,7 +70,7 @@ Example: Create wallet and generate new address (key) to receive bitcoins
>>> from bitcoinlib.wallets import Wallet
>>> w = Wallet.create('Wallet1')
>>> w.get_key().address
'1Fo7STj6LdRhUuD1AiEsHpH65pXzraGJ9j'
'bc1qk25wwkvz3am9smmm3372xct5s7cwf0hmnq8szj'
Now send a small transaction to your wallet and use the scan() method to update transactions and UTXO's

Expand All @@ -78,23 +84,27 @@ If successful a transaction ID is returned

.. code-block:: pycon
>>> t = w.send_to('1PWXhWvUH3bcDWn6Fdq3xhMRPfxRXTjAi1', '0.001 BTC', offline=False)
>>> t = w.send_to('bc1qemtr8ywkzg483g8m34ukz2l4pl3730776vzq54', '0.001 BTC', offline=False)
'b7feea5e7c79d4f6f343b5ca28fa2a1fcacfe9a2b7f44f3d2fd8d6c2d82c4078'
>>> t.info # Shows transaction information and send results
More examples
-------------

Checkout the documentation page https://bitcoinlib.readthedocs.io/en/latest/ or take a look at some
more examples at https://github.com/1200wd/bitcoinlib/tree/master/examples
You can find many more examples in the `documentation <https://bitcoinlib.readthedocs.io/en/latest/>`_
for instance about the `Wallet.create() <https://bitcoinlib.readthedocs.io/en/latest/source/bitcoinlib.wallets.html#bitcoinlib.wallets.Wallet.create>`_ method.

There are many working examples on how to create wallets, specific transactions, encrypted databases, parse the
blockchain, connect to specific service providers in the `examples directory <https://github.com/1200wd/bitcoinlib/tree/master/examples>`_ in the source code of this library.

Some more specific examples can be found on the `Coineva website <https://coineva.com/category/bitcoinlib.html>`_.

Contact
-------

If you have any questions, encounter a problem or want to share an idea, please use Github Discussions
https://github.com/1200wd/bitcoinlib/discussions
If you have any questions, encounter a problem or want to share an idea, please use `Github Discussions
<https://github.com/1200wd/bitcoinlib/discussions>`_


Implements the following Bitcoin Improvement Proposals
Expand All @@ -114,13 +124,12 @@ Implements the following Bitcoin Improvement Proposals
Future / Roadmap
----------------

- Support advanced scripts
- Fully support timelocks
- Support for lightning network
- Support Taproot and Schnorr signatures
- Support advanced scripts
- Support for Trezor wallet or other hardware wallets
- Allow to scan full blockchain
- Integrate simple SPV client
- Support Schnorr signatures


Disclaimer
Expand Down
Loading

0 comments on commit c411200

Please sign in to comment.