金币网论坛

QQ登录

只需一步,快速开始

查看: 66|回复: 8

点点币会不会演化 成一个昂贵的云储存办事 ?

[复制链接]
发表于 2017-1-12 16:42:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
TO STORE SOME DATA IN THE BLOCKCHAIN USING OP_RETURNs
On the command line:


  • python op_return.py -store <data>

    <data> is a hex string or raw string containing the data to be stored       (auto-detection: treated as a hex string if it is a valid one)-testnet use the peercoin testnet
  • Outputs an error if one occurred or if successful, the txids that were used to store the data and a short reference that can be used to retrieve it using this library.

    Examples:

    python op_return.py -store 'This example stores 47 bytes in the blockchain.'python op_return.py -store -testnet 'This example stores 44 bytes in the testnet.'

As a library:


  • op_return.store(ppc_node, data)

    <data> is the string of raw bytes to be stored-testnet is whether to use the peercoin testnet network (False if omitted)
  • Returns: {'error': ''} or: {'txids': ['<1st txid>', '<2nd txid>', ...], 'ref': ''}

    Examples:

    op_return.store(ppc_node, 'This example stores 47 bytes in the blockchain.')

TO RETRIEVE SOME DATA FROM OP_RETURNs IN THE BLOCKCHAIN
On the command line:


  • python op_return.py -retrieve <ref>

    <ref> is the reference that was returned by a previous storage operation-testnet use the peercoin testnet
  • Outputs an error if one occurred or if successful, the retrieved data in hexadecimal and ASCII format, a list of the txids used to store the data, a list of the blocks in which the data is stored, and (if available) the best ref for retrieving the data quickly in future. This may or may not be different from the ref you provided.

    Examples:

    python op_return.py -retrieve 356115-052075python op_return.py -testnet -retrieve 396381-059737

As a library:


  • retrieve(ppc_node, ref, max_results=1)

    <ref> is the reference that was returned by a previous storage operation<max_results> is the maximum number of results to retrieve (in general, omit for 1)-testnet is whether to use the peercoin testnet network (False if omitted)
  • Returns: {'error': ''} or: {'data': '', 'txids': ['<1st txid>', '<2nd txid>', ...], 'heights': [, , ...], 'ref': '', 'error': ''}

       A value of 0 in the 'heights' array means some data is still in the mempool.   The 'ref' and 'error' elements are only present if appropriate.
    Examples:

    op_return.retrieve(ppc_node, '356115-052075')op_return.retrieve(ppc_node, '396381-059737', 1)



金币网btc53.com:乐不可极,极乐成哀;欲不可纵,纵欲成灾。——吴兢《贞观政要刑法》
发表于 2017-1-12 17:43:15 | 显示全部楼层
<div class="quote">
宜州人的马甲 颁发于 2016-12-3 23:11
人家PPC已经实现了。你们还在谈概念。
发表于 2017-1-12 17:47:58 | 显示全部楼层
这个科技太暗中了。。。其它的币有这个功效么?
发表于 2017-1-12 18:38:01 | 显示全部楼层
<div class="quote">
发表于 2017-1-12 19:30:25 | 显示全部楼层
<div class="quote">
发表于 2017-1-12 19:40:31 | 显示全部楼层
<div class="quote">
发表于 2017-1-12 19:46:56 | 显示全部楼层
<div class="quote">
Decred 颁发于 2016-12-3 22:41
良多币都有储存概念啊
发表于 2017-1-12 20:30:14 | 显示全部楼层
<div class="quote">
发表于 2017-1-12 21:30:17 | 显示全部楼层
<div class="quote">
宜州人的马甲 颁发于 2016-12-4 14:01
我已经举报你了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|金币网 ( 闽ICP备16037271号   金币网客服

GMT+8, 2017-3-25 06:00 , Processed in 0.140704 second(s), 43 queries , Gzip On.

Powered by Discuz! X3.3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表