当前位置: 首页>>代码示例>>Python>>正文


Python Bigchain.get_owned_ids方法代码示例

本文整理汇总了Python中bigchaindb.Bigchain.get_owned_ids方法的典型用法代码示例。如果您正苦于以下问题:Python Bigchain.get_owned_ids方法的具体用法?Python Bigchain.get_owned_ids怎么用?Python Bigchain.get_owned_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bigchaindb.Bigchain的用法示例。


在下文中一共展示了Bigchain.get_owned_ids方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: print

# 需要导入模块: from bigchaindb import Bigchain [as 别名]
# 或者: from bigchaindb.Bigchain import get_owned_ids [as 别名]
print(json.dumps(tx_retrieved, sort_keys=True, indent=4, separators=(',', ':')))

print(testuser1_pub)
print(b.me)

print(tx_retrieved['id'])

"""
Transfer the Digital Asset
"""

# create a second testuser
testuser2_priv, testuser2_pub = crypto.generate_key_pair()

# retrieve the transaction with condition id
tx_retrieved_id = b.get_owned_ids(testuser1_pub).pop()
print(json.dumps(tx_retrieved_id, sort_keys=True, indent=4, separators=(',', ':')))

# create a transfer transaction
tx_transfer = b.create_transaction(testuser1_pub, testuser2_pub, tx_retrieved_id, 'TRANSFER')

# sign the transaction
tx_transfer_signed = b.sign_transaction(tx_transfer, testuser1_priv)


b.validate_transaction(tx_transfer_signed)
# write the transaction
b.write_transaction(tx_transfer_signed)

sleep(8)
开发者ID:dangerousbeans,项目名称:bigchaindb,代码行数:32,代码来源:run_doc_python_server_api_examples.py

示例2: print

# 需要导入模块: from bigchaindb import Bigchain [as 别名]
# 或者: from bigchaindb.Bigchain import get_owned_ids [as 别名]
__author__ = 'PC-LiNing'

from bigchaindb import Bigchain

b=Bigchain()

testuser1_pub='3EQyWna5Gniok73MXdT8m9kgSx6DuRYWUbmehCe4cmXU'
testuser1_priv='EZYk1RJtMkySRwNtpiY7AeGQyYLaeu5XsrJHzzVBL3wn'
testuser2_pub='9ooi6zKXdLVmM2ZyUZjRTWcW3TXt2CtnHSbVZnXLxHJM'
testuser2_priv='AZQ1Y4odynAuYEkSQhVKGqNKU4Zp5QidoLwmkfZCjYqL'

tx_retrieved_id1=b.get_owned_ids(testuser1_pub)
print(tx_retrieved_id1)
print("pop:")
print(tx_retrieved_id1.pop())
print('####')
tx_retrieved_id2=b.get_owned_ids(testuser2_pub)
print(tx_retrieved_id2)
print("pop:")
print(tx_retrieved_id2.pop())
开发者ID:CsterKuroi,项目名称:Charitychain,代码行数:22,代码来源:stack.py

示例3:

# 需要导入模块: from bigchaindb import Bigchain [as 别名]
# 或者: from bigchaindb.Bigchain import get_owned_ids [as 别名]
__author__ = 'PC-LiNing'

from bigchaindb import Bigchain

b=Bigchain()

testuser1_pub='3EQyWna5Gniok73MXdT8m9kgSx6DuRYWUbmehCe4cmXU'
testuser1_priv='EZYk1RJtMkySRwNtpiY7AeGQyYLaeu5XsrJHzzVBL3wn'
testuser2_pub='9ooi6zKXdLVmM2ZyUZjRTWcW3TXt2CtnHSbVZnXLxHJM'
testuser2_priv='AZQ1Y4odynAuYEkSQhVKGqNKU4Zp5QidoLwmkfZCjYqL'

# node create transaction for A,-50

testuser1_last=b.get_owned_ids(testuser1_pub).pop()

payload_A = {
            "msg" : "node send -50 to A,is -50",
            "issue" : "cost",
            "category" : "currency",
            "amount" : 50,
            "asset":"",
            # final owner 's account
            "account":300,
            "previous":testuser1_last['txid'],
            "trader":testuser2_pub
          }

tx_create= b.create_transaction(b.me, testuser1_pub, None, 'CREATE', payload=payload_A)
tx_create_signed = b.sign_transaction(tx_create, b.me_private)
if b.is_valid_transaction(tx_create_signed):
    b.write_transaction(tx_create_signed)
开发者ID:CsterKuroi,项目名称:Charitychain,代码行数:33,代码来源:transfer.py


注:本文中的bigchaindb.Bigchain.get_owned_ids方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。