{"id":19724774,"url":"https://github.com/bigchaindb/bigchaindb-shared","last_synced_at":"2025-04-29T23:30:32.574Z","repository":{"id":57414955,"uuid":"95867163","full_name":"bigchaindb/bigchaindb-shared","owner":"bigchaindb","description":"Precompiled client side tools for BigchainDB with various language frontends","archived":false,"fork":false,"pushed_at":"2020-10-13T03:27:18.000Z","size":14323,"stargazers_count":2,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T04:03:36.747Z","etag":null,"topics":["bigchaindb","client","side","tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigchaindb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-30T08:29:38.000Z","updated_at":"2020-06-15T20:09:13.000Z","dependencies_parsed_at":"2022-08-30T05:41:34.310Z","dependency_job_id":null,"html_url":"https://github.com/bigchaindb/bigchaindb-shared","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigchaindb%2Fbigchaindb-shared","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigchaindb%2Fbigchaindb-shared/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigchaindb%2Fbigchaindb-shared/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigchaindb%2Fbigchaindb-shared/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigchaindb","download_url":"https://codeload.github.com/bigchaindb/bigchaindb-shared/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251599654,"owners_count":21615563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigchaindb","client","side","tools"],"created_at":"2024-11-11T23:27:02.357Z","updated_at":"2025-04-29T23:30:27.561Z","avatar_url":"https://github.com/bigchaindb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bigchaindb-shared\n\nBigchainDB Shared is a client library for creating and signing BigchainDB transactions.\n\nIt is disributed as a pre-built set of **.so** shared objects built on Ubuntu 16.04 x64. It may work on other platforms that also have a compatable version of libc installed (try it out and let us know).\n\nAlready provided language frontends are **Python**, **Java**, plus a **CLI**.\n\n## Quickstart\n\n```shell\ngit clone --recursive https://github.com/bigchaindb/bigchaindb-shared/\ncd bigchaindb-shared\npython -m bigchaindb_shared createTx '\n{\n    \"creator\":\"5UY9Ev2BT2yvSxzuwCrEouqpB1F7ofjhevbTujVaSk2w\",\n    \"outputs\":[[\"1\",\"(1 of 5UY9Ev2BT2yvSxzuwCrEouqpB1F7ofjhevbTujVaSk2w, 3339Ev2BT2yvSxzuwCrEouqpB1F7ofjhevbTujVaSk2w)\"]]\n}\n'\n```\n\n## Building\n\n```shell\nmake build-image\nmake build\n```\n\n## Features\n\n* Easy to use JSON api\n* Simple FFI interface - easy to integrate with your language\n* High performance binary (x86/64, Debian 8, Ubuntu 16.04 etc)\n\n## FFI\n\nBigchainDB Shared is designed to be trivial to interoperate with other langauges that provide an FFI interface to call `.so` methods. All methods are exposed via a single function called 'jsonRPC'. See `bigchaindb_shared/api.py` for an example. Once this interface is implemented, all functions are exposed via a simple JSON protocol.\n\n## CLI\n\nBigchainDB Shared also has a CLI interface, depending only on Python and no additional libraries.\n\n## Methods\n\n### genKeyPair\n\nGenerates a key pair using system entropy.\n\nExample: \n\n```python:\nalice = api.generateKeyPair({})\nbob = api.generateKeyPair({})\n```\n\n### createTx\n\nMake a transaction to create an asset.\n\nArguments:\n\n* **asset** (optional): JSON payload of asset\n* **creator**: Ed25519 public key\n* **outputs**: List of amounts and condition specifications\n* **metadata** (optional): JSON payload of metadata\n\nExample:\n\n```python\ntx_create = api.createTx({\n    \"asset\": {\"data\": \"my first asset\"}\n    \"creator\": alice.public_key,\n    \"outputs\": [[\"30\", bob.public_key],[\"20\", alice.public_key]],\n    \"metadata\": {\"msg\": \"hello world\"},\n})\n```\n\n### transferTx\n\nMake a transaction to transfer an asset.\n\nArguments:\n\n* **spends**: List of transactions to use as inputs\n* **links** (optional): List of outputs to use\n* **outputs**: List of amounts and condition specifications\n* **metadata** (optional): JSON payload of metadata\n\nExample:\n\n```python\ntx_transfer = api.transferTx({\n    \"spends\": [tx_create],\n    \"links\": [{\"transaction_id\": \"\u003cID of tx in `spends`\u003e\", \"output_index\": 1}],\n    \"outputs\": [[\"11\", alice.public_key]],\n    \"metadata\": {\"msg\": \"thanks\"}\n})\n```\n\n### signTx\n\nSign a transaction\n\nArguments:\n\n* **tx**: Transaction to be signed\n* **key**: Private key\n* **check** (default=True): Return an error if not fully signed\n\nExample:\n\n```python\ntx_create_signed = api.signTx({\n    \"tx\": create_tx,\n    \"key\": alice.secret_key\n})\n```\n\n### validateTx\n\nValidate that a transaction is structurally correct\n\nArguments:\n\n* **tx**: Transaction to check\n\nExample:\n\n```python\napi.validateTx({\n    \"tx\": create_tx_signed\n})\n```\n\n### parseConditionDSL\n\nParse a condition signing spec (DSL) into an `output.condition`.\n\nA signing spec can represent a simple ed25519 condition or a complex multi-party condition, eg:\n\n`(1 of \u003ckey1\u003e, (2 of \u003ckey2, \u003ckey3\u003e))`.\n\nArguments:\n\n* **expr**: Expression to parse\n\nExample:\n```python\napi.parseConditionDSL({\n    \"expr\": alice.public_key\n})\n\nspec = \"(2 of \" + alice.public_key + \", \" + bob.public_key)\"\napi.parseConditionDSL({\n    \"expr\": spec\n})\n```\n\n### httpGetTx\n\nGET a transaction from bigchaindb server.\n\nArguments:\n\n* **server**: Base URL of server http interface.\n* **txid**: 64 character ID of the transaction to fetch.\n\nExample:\n```python\ntx = api.httpGetTx({\n    \"server\": \"http://localhost:9984/\",\n    \"txid\": tx_create.id\n})\n```\n\n### httpGetPath\n\nGET any path from bigchaindb server.\n\nArguments:\n\n* **server**: Base URL of server http interface.\n* **path**: Path of the resource to fetch.\n\nExample:\n```python\nindex = api.httpGetPath({\n    \"server\": \"http://localhost:9984/\",\n    \"path\": \"/\"\n})\n```\n\n### httpPostTx\n\nPOST a transaction to the server.\n\nArguments:\n\n* **server**: Base URL of server http interface.\n* **tx**: Signed transaction to send.\n\nExample:\n```python\napi.httpPostTx({\n    \"server\": \"http://localhost:9984/\",\n    \"tx\": tx_create_signed\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigchaindb%2Fbigchaindb-shared","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigchaindb%2Fbigchaindb-shared","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigchaindb%2Fbigchaindb-shared/lists"}