Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. Copyright BigchainDB GmbH and BigchainDB contributors SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) Code is Apache-2.0 and docs are CC-BY-4.0
.. image:: media/repo-banner@2x.png
.. image:: https://badges.gitter.im/bigchaindb/bigchaindb-driver.svg :alt: Join the chat at https://gitter.im/bigchaindb/bigchaindb-driver :target: https://gitter.im/bigchaindb/bigchaindb-driver?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. image:: https://img.shields.io/pypi/v/bigchaindb-driver.svg :target: https://pypi.python.org/pypi/bigchaindb-driver
.. image:: https://img.shields.io/travis/bigchaindb/bigchaindb-driver/master.svg :target: https://travis-ci.org/bigchaindb/bigchaindb-driver
.. image:: https://img.shields.io/codecov/c/github/bigchaindb/bigchaindb-driver/master.svg :target: https://codecov.io/github/bigchaindb/bigchaindb-driver?branch=master
.. image:: https://readthedocs.org/projects/bigchaindb-python-driver/badge/?version=latest :target: http://bigchaindb.readthedocs.io/projects/py-driver/en/latest/?badge=latest :alt: Documentation Status
Documentation
_.. contents:: Table of Contents
The instructions below were tested on Ubuntu 16.04 LTS. They should also work on other Linux distributions and on macOS. The driver might work on Windows as well, but we do not guarantee it. We recommend to set up (e.g. via Docker on Windows) an Ubuntu VM there.
We recommend you use a virtual environment to install and update to the latest stable version using pip
(or pip3
):
.. code-block:: text
pip install -U bigchaindb-driver
That will install the latest stable BigchainDB Python Driver. If you want to install an Alpha, Beta or RC version of the Python Driver, use something like:
.. code-block:: text
pip install -U bigchaindb_driver==0.5.0a4
The above command will install version 0.5.0a4 (Alpha 4). You can find a list of all versions in the release history page on PyPI <https://pypi.org/project/bigchaindb-driver/#history>
_.
More information on how to install the driver can be found in the Quickstart
_
BigchainDB Server Quickstart
_The Hitchhiker's Guide to BigchainDB
_HTTP API Reference
_All BigchainDB Documentation
_Example: Create a divisible asset for Alice who issues 10 token to Bob so that he can use her Game Boy. Afterwards Bob spends 3 of these tokens.
If you want to send a transaction you need to Determine the BigchainDB Root URL
_.
.. code-block:: python
# import BigchainDB and create an object
from bigchaindb_driver import BigchainDB
bdb_root_url = 'https://example.com:9984'
bdb = BigchainDB(bdb_root_url)
# generate a keypair
from bigchaindb_driver.crypto import generate_keypair
alice, bob = generate_keypair(), generate_keypair()
# create a digital asset for Alice
game_boy_token = {
'data': {
'token_for': {
'game_boy': {
'serial_number': 'LR35902'
}
},
'description': 'Time share token. Each token equals one hour of usage.',
},
}
# prepare the transaction with the digital asset and issue 10 tokens for Bob
prepared_token_tx = bdb.transactions.prepare(
operation='CREATE',
signers=alice.public_key,
recipients=[([bob.public_key], 10)],
asset=game_boy_token)
# fulfill and send the transaction
fulfilled_token_tx = bdb.transactions.fulfill(
prepared_token_tx,
private_keys=alice.private_key)
bdb.transactions.send_commit(fulfilled_token_tx)
# Use the tokens
# create the output and inout for the transaction
transfer_asset = {'id': fulfilled_token_tx['id']}
output_index = 0
output = fulfilled_token_tx['outputs'][output_index]
transfer_input = {'fulfillment': output['condition']['details'],
'fulfills': {'output_index': output_index,
'transaction_id': transfer_asset['id']},
'owners_before': output['public_keys']}
# prepare the transaction and use 3 tokens
prepared_transfer_tx = bdb.transactions.prepare(
operation='TRANSFER',
asset=transfer_asset,
inputs=transfer_input,
recipients=[([alice.public_key], 3), ([bob.public_key], 7)])
# fulfill and send the transaction
fulfilled_transfer_tx = bdb.transactions.fulfill(
prepared_transfer_tx,
private_keys=bob.private_key)
sent_transfer_tx = bdb.transactions.send_commit(fulfilled_transfer_tx)
+-----------------------+---------------------------+
| BigchainDB Server | BigchainDB Driver |
+=======================+===========================+
| >= 2.0.0b7
| 0.6.2
|
+-----------------------+---------------------------+
| >= 2.0.0b7
| 0.6.1
|
+-----------------------+---------------------------+
| >= 2.0.0b7
| 0.6.0
|
+-----------------------+---------------------------+
| >= 2.0.0b5
| 0.5.3
|
+-----------------------+---------------------------+
| >= 2.0.0b5
| 0.5.2
|
+-----------------------+---------------------------+
| >= 2.0.0b5
| 0.5.1
|
+-----------------------+---------------------------+
| >= 2.0.0b1
| 0.5.0
|
+-----------------------+---------------------------+
| >= 2.0.0a3
| 0.5.0a4
|
+-----------------------+---------------------------+
| >= 2.0.0a2
| 0.5.0a2
|
+-----------------------+---------------------------+
| >= 2.0.0a1
| 0.5.0a1
|
+-----------------------+---------------------------+
| >= 1.0.0
| 0.4.x
|
+-----------------------+---------------------------+
| == 1.0.0rc1
| 0.3.x
|
+-----------------------+---------------------------+
| >= 0.9.1
| 0.2.x
|
+-----------------------+---------------------------+
| >= 0.8.2
| >= 0.1.3
|
+-----------------------+---------------------------+
Although we do our best to keep the master branches in sync, there may be occasional delays.
licenses
_ - open source & open contentThis package was initially created using Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template. Many BigchainDB developers have contributed since then.
.. _Documentation: https://docs.bigchaindb.com/projects/py-driver/
.. _pypi history: https://pypi.org/project/bigchaindb-driver/#history
.. _Quickstart: https://docs.bigchaindb.com/projects/py-driver/en/latest/quickstart.html
.. _BigchainDB Server Quickstart: https://docs.bigchaindb.com/projects/server/en/latest/quickstart.html
.. _The Hitchhiker's Guide to BigchainDB: https://www.bigchaindb.com/developers/guide/
.. _HTTP API Reference: https://docs.bigchaindb.com/projects/server/en/latest/http-client-server-api.html
.. _All BigchainDB Documentation: https://docs.bigchaindb.com/
.. _Determine the BigchainDB Root URL: https://docs.bigchaindb.com/projects/py-driver/en/latest/connect.html
.. _licenses: https://github.com/bigchaindb/bigchaindb-driver/blob/master/LICENSES.md
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
.. Copyright BigchainDB GmbH and BigchainDB contributors SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) Code is Apache-2.0 and docs are CC-BY-4.0
Changed ^^^^^^^
Fixed ^^^^^
Changed ^^^^^^^
Removed ^^^^^^^
Known issues ^^^^^^^^^^^^
Changed ^^^^^^^
Added ^^^^^
#470 <https://github.com/bigchaindb/bigchaindb-driver/pull/470>
#472 <https://github.com/bigchaindb/bigchaindb-driver/pull/472>
Added ^^^^^
BEP 14 <https://github.com/bigchaindb/BEPs/tree/master/14>
_Added ^^^^^
Added three new methods to send/post a transaction as discussed here <https://github.com/bigchaindb/bigchaindb/issues/2307>
_:
send_commit
send_async
send_sync
Deprecated ^^^^^^^^^^
send()
under TransactionEndpoint
, and available
via BigchainDB.transactions
. Replaced by the above three methods:
send_commit()
, send_async()
, and send_sync()
.Removed dependencies from BigchainDB Server package <https://github.com/bigchaindb/bigchaindb-driver/pull/411>
_.The default mode for sending a transaction is now commit <https://github.com/bigchaindb/bigchaindb-driver/issues/386>
_.The metadata endpoint was added <https://github.com/bigchaindb/bigchaindb-driver/issues/347>
_.There were many changes between BigchainDB 1.3 and BigchainDB 2.0 Alpha, too many to list here. We wrote a series of blog posts to summarize most changes, especially those that affect end users and application developers:
Some HTTP API Changes in the Next Release <https://blog.bigchaindb.com/some-http-api-changes-in-the-next-release-49612a537b0c>
_.Three Transaction Model Changes in the Next Release <https://blog.bigchaindb.com/three-transaction-model-changes-in-the-next-release-dadbac50094a>
_.Fixed ^^^^^
Pull request #312 <https://github.com/bigchaindb/bigchaindb-driver/pull/312>
_.Pull request #316 <https://github.com/bigchaindb/bigchaindb-driver/pull/316>
_.Added ^^^^^
Added ^^^^^
/assets?search=
Added ^^^^^
GET /
and GET /api/v1
Changed ^^^^^^^
Node URLs, passed to BigchainDB()
MUST not include the api prefix
'/api/v1'
, e.g.:
http://localhost:9984/api/v1
http://localhost:9984
Added ^^^^^
Removed ^^^^^^^
create()
and transfer()
under TransactionEndpoint
, and available
via BigchainDB.transactions
. Replaced by the three "canonical"
transaction operations: prepare()
, fulfill()
, and send()
.Added ^^^^^
Support for "canonical" transaction operations:
prepare
fulfill
send
Deprecated ^^^^^^^^^^
create()
and transfer()
under TransactionEndpoint
, and available
via BigchainDB.transactions
. Replaced by the above three "canonical"
transaction operations: prepare()
, fulfill()
, and send()
.Fixed ^^^^^
BigchainDB()
default node setting on its transport class. See commit
0a80206 <https://github.com/bigchaindb/bigchaindb-driver/commit/0a80206407ef155d220d25a337dc9a4f51046e70>
_Added ^^^^^
Added ^^^^^
POST
(via create()
and transfer()
), and
GET
operations on the /transactions
endpoint.FAQs
Python driver for BigchainDB
We found that bigchaindb-driver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.