Ich verwende pyethapp und web3.js , um Transaktionen in einem privaten Netzwerk durchzuführen.
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});
Alles läuft gut und die Transaktion wird von pyethapp signiert. Die Transaktion wird jedoch nicht zur Blockchain hinzugefügt. Die Ausgabe, wenn sie signiert ist, ist die folgende in der Konsole (während pyethapp ausgeführt wird):
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
Mir ist auch die Zeile aufgefallen:
mining_hash=19f3d9615f961c7a2351a2460393476f22ddbaa79bbfe3bac3acd3eedab14676
WARNING:pow mining_hash does not match
Ich bin mir nicht sicher, ob es mit der Transaktion zusammenhängt (ich habe nur eine Transaktion im privaten Netz durchgeführt). Alle Adressen haben vordefinierte Salden innerhalb der Blockchain und es ist kein Problem im Zusammenhang mit unzureichendem Gas/Ether.
Der Genesis-Block verwendet auch einen sehr niedrigen Schwierigkeitsgrad (<100), um Transaktionen schneller abzubauen.
Warum wird die Transaktion nicht zur Blockchain hinzugefügt?
Ich verwende die Funktion (von hier ), um die Blockchain nach der Adresse des Empfängers abzufragen.
Bearbeiten :
Seltsam ist, dass die Transaktion eine Quittung hat:
blockHash:"0x10b5c028b21e42104de61ba943ce14d11bcf01812ec675b10373d80316da481"
blockNumber:2
contractAddress:null
cumulativeGasUsed:21952
gasUsed:21952
logs:Array[0]
transactionHash:"0xcbd5db525f2b592d3d16f332747f22c50f1632e5629f5fe497673efc5d2b7a5a"
transactionIndex:0
Anfangs gas:90000
war zu niedrig. Nach dem Erhöhen zeigt die Quittung an, dass sich die Transaktion jetzt in der Blockchain befindet, Block Nr. 2.
eth
gas:90000
ist nicht so hoch und ich würde esgas:3000000
während des Debuggens versuchen.Sebi
Sebi
eth
gas
von Ihnen angegebene Wert niedriger als die Gasgrenze des Blocks sein.