Exemplo n.º 1
0
def blockchain():
    bc = BlockChain()

    blocks = bc.print_blockchain()

    blocks = sorted(blocks, key=lambda s: s['Data'])

    return json.dumps(blocks)
Exemplo n.º 2
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
This Document is Created by  At 2018/7/9 
"""

from core.blockchain.blockchain import BlockChain

if __name__ == '__main__':
    bc = BlockChain()

    for i in range(10):
        bc.add_block("Magic Test %d" % i)

    bc.print_blockchain()