Author Topic: howto signature the transaction from python?  (Read 1769 times)

0 Members and 1 Guest are viewing this topic.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
it's very hard to understand these code, after a hard try,  I have to give up ....
BTW, can you upload python-graphine to the Python Package Index?
then I can add your package as dependency.
https://pypi.python.org/pypi
Just did so .. the package should be called "graphenelib". Please tell me if you find anything not ok. Never used Pypi for distribution ..

Gonna work more on the transaction signing next year
it's available now, thanks

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
it's very hard to understand these code, after a hard try,  I have to give up ....
BTW, can you upload python-graphine to the Python Package Index?
then I can add your package as dependency.
https://pypi.python.org/pypi
Just did so .. the package should be called "graphenelib". Please tell me if you find anything not ok. Never used Pypi for distribution ..

Gonna work more on the transaction signing next year

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Transaction signing is currently only implemented in C++ (cli_wallet) and javascript/coffee script for the Web wallet ..
it's very hard to understand these code, after a hard try,  I have to give up ....
BTW, can you upload python-graphine to the Python Package Index?
then I can add your package as dependency.
https://pypi.python.org/pypi

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Transaction signing is currently only implemented in C++ (cli_wallet) and javascript/coffee script for the Web wallet ..

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
I'm  tring to write an application run without cli_wallet

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
That script is NOT OPERATIONAL yet ..
Hopefully I can complete it in Q1 2016 .. but at the current stage it does not yet do what it should ..

I would recommend you use the transaction builder of the cli_wallet as described here:
http://docs.bitshares.eu/bitshares/tutorials/construct-transaction.html

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
If I got a transaction like this:
Code: [Select]
{'expiration': '2015-12-21T09:33:30',
 'extensions': [],
 'operations': [[1,
                 {'amount_to_sell': {'amount': 900000000,
                                     'asset_id': '1.3.0'},
                  'expiration': '1969-12-31T23:59:59',
                  'extensions': [],
                  'fee': {'amount': 500000, 'asset_id': '1.3.0'},
                  'fill_or_kill': False,
                  'min_to_receive': {'amount': 1900000,
                                     'asset_id': '1.3.1'},
                  'seller': '1.2.18'}],
                [1,
                 {'amount_to_sell': {'amount': 2000000,
                                     'asset_id': '1.3.1'},
                  'expiration': '1969-12-31T23:59:59',
                  'extensions': [],
                  'fee': {'amount': 500000, 'asset_id': '1.3.0'},
                  'fill_or_kill': False,
                  'min_to_receive': {'amount': 1100000000,
                                     'asset_id': '1.3.0'},
                  'seller': '1.2.18'}]],
 'ref_block_num': 30631,
 'ref_block_prefix': 2405814624,
 'signatures': []}
how to signature it with a private key from python? thanks

#edit: seems xeroc have provid this tools, but don't know how to use it
https://github.com/xeroc/python-graphenelib/blob/master/graphenebase/transactions.py
« Last Edit: December 21, 2015, 10:31:16 am by alt »