Transactions

pyethapp 無法將交易添加到區塊鏈

  • July 12, 2016

我正在使用pyethappweb3.js在專用網路上進行交易。

var to = "1152a50b91887591a2447b233105f392dbae72ce";
var from = "4dfd7cb92bca796821d5fc4512a6a02cc98d833d";
var json_data = {"Hi!" : "Hello World!!!"};
var tx_hash = web3.eth.sendTransaction({from: from_addr, to: to_addr, value: web3.toWei(10000, 'wei'), data: web3.toHex(json_data), gas:90000});

一切順利,交易由 pyethapp 簽署。但是,交易不會添加到區塊鏈中。簽名後的輸出在控制台中如下(執行 pyethapp 時):

INFO:p2p.peermgr    waiting for bootstrap 
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=ddcb1d6ad36c172fe077f0cbf4b7e889339ba8effbcbc9472866e8ac9c4724e1
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=c32c7a78781a65cab4fa9b5d9faa6926fc58b626fa7fa88d351f629228dfb379
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=697a2cb3c9b07e97114eca5eb0077258d05ce8b6d1a6f528083f3c768d6880fc
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=7a7697bfd0416b29360a2fb675b8c760aa8b90a54dde307cbde91e4c0cd3d8e1
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=8f19ee2ee4d8814ec9c172037d274f3a7f9df28b32a7e585610969dd06c240ed
INFO:accounts   signing tx account=<Account(address=4dfd7cb92bca796821d5fc4512a6a02cc98d833d, id=None)> tx=<Transaction(7236)>
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=19f3d9615f961c7a2351a2460393476f22ddbaa79bbfe3bac3acd3eedab14676
WARNING:pow mining_hash does not match 
INFO:pow.subprocess nonce found 
INFO:pow.subprocess sending nonce 
INFO:pow    nonce found mining_hash=4daad5461707f1c29fc88c5929fd5c50b423159601181587e89d189d5f50329d

我還注意到了這一行:

mining_hash=19f3d9615f961c7a2351a2460393476f22ddbaa79bbfe3bac3acd3eedab14676
   WARNING:pow mining_hash does not match

我不確定它是否與交易有關(我在私人網上只進行了一筆交易)。所有地址在區塊鏈內都有預定義的餘額,這不是與氣體/乙太幣不足有關的問題。

創世塊也使用非常低的難度級別(<100),以便更快地探勘交易。

為什麼交易沒有加入區塊鏈?

我正在使用該功能(從此處)在區塊鏈中查詢收件人的地址。

編輯

奇怪的是,交易有收據:

blockHash:"0x10b5c028b21e42104de61ba943ce14d11bcf01812ec675b10373d80316da481"
blockNumber:2
contractAddress:null
cumulativeGasUsed:21952
gasUsed:21952
logs:Array[0]
transactionHash:"0xcbd5db525f2b592d3d16f332747f22c50f1632e5629f5fe497673efc5d2b7a5a"
transactionIndex:0

一開始gas:90000太低了。增加它後,收據表明交易現在在區塊鏈中,區塊 #2。

引用自:https://ethereum.stackexchange.com/questions/7030