Пример #1
0
def listtarns():
    AccountName = '66053664cae16a575ea087ce17c2b400326c366d64580818f14db15b27dbdf86'
    newBlockChain = BlockChain()
    newBlockChain.FileTo()
    tranList = AccountAllTrans(AccountName, newBlockChain)
    for tran in tranList:
        print(tran)
Пример #2
0
def listcoins():
    newBlockChain = BlockChain()
    newBlockChain.FileTo()
    AccountName = '66053664cae16a575ea087ce17c2b400326c366d64580818f14db15b27dbdf86'
    coinList = AccountAllCoins(AccountName=AccountName, BlockChain=newBlockChain)
    for coin in coinList:
        print(coin)
Пример #3
0
def miner():
    AccountName = miner[0]
    while True:
        newblockChain = BlockChain()
        newblockChain.FileTo()
        God = CreateAccount()
        God.FileTo()
        ex_mesg = ""
        newBlock = MiningOneBlock(AccountName, newblockChain, God, ex_mesg)
        newblockChain.AddBlockToChain(tx_list=[], newBlock=newBlock)
        newblockChain.ToFile()
        print('已完成')
Пример #4
0
def MingBlock(AccountName):
    blockChainObject = BlockChain()
    blockChainObject.FileTo()
    God = CreateAccount()
    God.FileTo()
    ex_mesg = ""
    global newBlock
    global flag
    flag = 1
    newBlock = MiningOneBlock(AccountName, blockChainObject, God, ex_mesg)
    print("new block succeed!!")
    flag = 0