bigchaindb / bigchaindb/bigchaindb-driver

Problem: no easy ORM for CRUD/CRAB

Open
#455 2 comments 2 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

proposal topic: UX docs cmd api driver
Dominant language
Python
Stars
106
Forks
99
PR merge metrics
No merged PRs in 30d

Description

  • bigchaindb-driver version: 0.5.0
  • bigchaindb server version (bigchaindb -v):
  • Python version: 3
  • Operating System: linux
Description

Simple operations like

  • create
  • retrieve
  • update
  • burn

create and retrieve are quite easy to use, but update/transfer is very convoluted.
From the docs:

txid = fulfilled_creation_tx['id']

asset_id = txid

transfer_asset = {
    'id': asset_id
}

output_index = 0
output = fulfilled_creation_tx['outputs'][output_index]

transfer_input = {
    'fulfillment': output['condition']['details'],
    'fulfills': {
        'output_index': output_index,
        'transaction_id': fulfilled_creation_tx['id']
    },
    'owners_before': output['public_keys']
}

prepared_transfer_tx = bdb.transactions.prepare(
    operation='TRANSFER',
    asset=transfer_asset,
    inputs=transfer_input,
    recipients=bob.public_key,
)

fulfilled_transfer_tx = bdb.transactions.fulfill(
    prepared_transfer_tx,
    private_keys=alice.private_key,
)

sent_transfer_tx = bdb.transactions.send_commit(fulfilled_transfer_tx)

There are many moving parts where things can go wrong. I would expect a simple ORM syntax will drive adoption.

The js-driver-orm is a good starting point for this...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.