Description
- bigchaindb-driver version: 0.6.2
- bigchaindb server version (
bigchaindb -v
): 1.3.0 - Python version:3.6.7
- Operating System: Ubuntu 18.04
Description
I have successfully installed the bigchaindb and its running in the http://localhost:9984/ I can see the welcome json. I am trying to do my first transaction on which I am getting an error
My python script is :
`from bigchaindb_driver import BigchainDB
bdb_root_url = 'http://localhost: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)
print(fulfilled_token_tx)
bdb.transactions.send_commit(fulfilled_token_tx)`
In send_commit I am getting an error :
{'inputs': [{'owners_before': ['ZmVkNrqgMZUnXcXwoKRfXAQnvxGu2gcyh1CSqjpvdq2'], 'fulfills': None, 'fulfillment': 'pGSAIAhk5bSEJPVfzb6eu_eHz81xTguBvUpLfpmMAgV96S3pgUAHfLVHjqXvSYSFGf1k4fe_kA9-EnufjWojyZhWtkKZnptCWYmrXYLtlPjwi0LSKP7PGL2NK9GHvhpjPPDajkYA'}], 'outputs': [{'public_keys': ['3ePfKBgYWiZev8U8zMUkkoT3bNNUgEa17cVQTuk6Yvdf'], 'condition': {'details': {'type': 'ed25519-sha-256', 'public_key': '3ePfKBgYWiZev8U8zMUkkoT3bNNUgEa17cVQTuk6Yvdf'}, 'uri': 'ni:///sha-256;SE7SFxLL_aMud6haTniv4VxhUBtG52lsQfyKihTEomQ?fpt=ed25519-sha-256&cost=131072'}, 'amount': '10'}], 'operation': 'CREATE', 'metadata': None, 'asset': {'data': {'token_for': {'game_boy': {'serial_number': 'LR35902'}}, 'description': 'Time share token. Each token equals one hour of usage.'}}, 'version': '2.0', 'id': '8f1a51ea1a78285ae8223af31607781a99c09098991ba618b6ef1746da40b907'}
Traceback (most recent call last):
File "Desktop/blockchain_bc/index.py", line 35, in
bdb.transactions.send_commit(fulfilled_token_tx)
File "/home/piyush/.local/lib/python3.6/site-packages/bigchaindb_driver/driver.py", line 375, in send_commit
headers=headers)
File "/home/piyush/.local/lib/python3.6/site-packages/bigchaindb_driver/transport.py", line 82, in forward_request
backoff_cap=backoff_cap,
File "/home/piyush/.local/lib/python3.6/site-packages/bigchaindb_driver/connection.py", line 91, in request
**kwargs,
File "/home/piyush/.local/lib/python3.6/site-packages/bigchaindb_driver/connection.py", line 128, in _request
raise exc_cls(response.status_code, text, json, kwargs['url'])
bigchaindb_driver.exceptions.BadRequest: (400, '{"message":"Invalid transaction schema: '2.0' does not match '^1\\\\.0$'","status":400}\n', {'message': "Invalid transaction schema: '2.0' does not match '^1\\.0$'", 'status': 400}, 'http://localhost:9984/api/v1/transactions/')
I would like to point few things :
- I have installed in bigchaindb in my localsystem and there is no other node connected.
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.