bigchaindb / bigchaindb-driver

Official Python driver for BigchainDB
https://www.bigchaindb.com
Apache License 2.0
105 stars 104 forks source link

Invalid transaction schema: '1.0' with bigchaindb 1.0.0 #311

Closed keks799 closed 7 years ago

keks799 commented 7 years ago

Description

Trying to create transaction with Basic Usage Example tutorial here https://docs.bigchaindb.com/projects/py-driver/en/latest/usage.html works good until i do transactions.send it returns

bigchaindb_driver.exceptions.BadRequest: (400, '{\n "message": "Invalid transaction schema: \'1.0\' does not match \'^0\\\\.\'", \n "status": 400\n}\n', {'status': 400, 'message': "Invalid transaction schema: '1.0' does not match '^0\\.'"})

What I Did

so, here is the traceback

Traceback (most recent call last):
  File "bigchain_python_driver.py", line 36, in <module>
    sent_creation_tx = bdb.transactions.send(fulfilled_creation_tx)
  File "/home/ilya/bigchain/venv/lib/python3.5/site-packages/bigchaindb_driver-0.4.0-py3.5.egg/bigchaindb_driver/driver.py", line 319, in send
    method='POST', path=self.path, json=transaction, headers=headers)
  File "/home/ilya/bigchain/venv/lib/python3.5/site-packages/bigchaindb_driver-0.4.0-py3.5.egg/bigchaindb_driver/transport.py", line 58, in forward_request
    headers=headers,
  File "/home/ilya/bigchain/venv/lib/python3.5/site-packages/bigchaindb_driver-0.4.0-py3.5.egg/bigchaindb_driver/connection.py", line 57, in request
    raise exc_cls(response.status_code, text, json)
bigchaindb_driver.exceptions.BadRequest: (400, '{\n  "message": "Invalid transaction schema: \'1.0\' does not match \'^0\\\\\\\\.\'", \n  "status": 400\n}\n', {'status': 400, 'message': "Invalid transaction schema: '1.0' does not match '^0\\\\.'"})

this is prepared creation transaction

{  
   'outputs':[  
      {  
         'public_keys':[  
            'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
         ],
         'amount':'1',
         'condition':{  
            'details':{  
               'type':'ed25519-sha-256',
               'public_key':'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
            },
            'uri':'ni:///sha-256;AhMLhMGG6mVg0H4nSoVzShvxi3oxDk3Mu5pPzkvTUIY?fpt=ed25519-sha-256&cost=131072'
         }
      }
   ],
   'version':'1.0',
   'asset':{  
      'data':{  
         'bicycle':{  
            'serial_number':'abcd1234',
            'manufacturer':'bkfab'
         }
      }
   },
   'inputs':[  
      {  
         'owners_before':[  
            'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
         ],
         'fulfills':None,
         'fulfillment':{  
            'type':'ed25519-sha-256',
            'public_key':'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
         }
      }
   ],
   'id':'f1ef9c526a1a55818bc849c0130c6946d4a2a4e58696535876a3ae66f5546eae',
   'operation':'CREATE',
   'metadata':None
}

this is fulfilled creation tx

{  
   'outputs':[  
      {  
         'public_keys':[  
            'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
         ],
         'amount':'1',
         'condition':{  
            'details':{  
               'type':'ed25519-sha-256',
               'public_key':'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
            },
            'uri':'ni:///sha-256;AhMLhMGG6mVg0H4nSoVzShvxi3oxDk3Mu5pPzkvTUIY?fpt=ed25519-sha-256&cost=131072'
         }
      }
   ],
   'version':'1.0',
   'asset':{  
      'data':{  
         'bicycle':{  
            'serial_number':'abcd1234',
            'manufacturer':'bkfab'
         }
      }
   },
   'inputs':[  
      {  
         'owners_before':[  
            'BUj5C2ukvX68GfEpcYAnvXWUtJChFqqV8HGoVVzbTU7m'
         ],
         'fulfills':None,
         'fulfillment':'pGSAIJuvH1Iw1Craiwaa3k01jKSR1mC-czLQQbuUwZ4ePLokgUB0I9zth8-Xr6HbeiGAmLOyd4GscV2bLdzHaJyNBRtLE0vYDDmB3McQZOKtLmynIR3y7_2o5wIf_zdaVyWlBDwG'
      }
   ],
   'id':'f1ef9c526a1a55818bc849c0130c6946d4a2a4e58696535876a3ae66f5546eae',
   'operation':'CREATE',
   'metadata':None
}
ttmc commented 7 years ago

@keks799 The error message is what I'd expect from BigchainDB Server 0.10.x. Can you verify that you're running BigchainDB Server 1.0.0? Can you show me the output of:

$ bigchaindb --version
keks799 commented 7 years ago

@ttmc so sorry. Got mess up with venvs