Solidity
發送多筆交易而不會耗盡種子的最佳方式是什麼?
我遇到了發送單個事務但發送多個事務不起作用的問題。
我正在嘗試使用 web3.js 為我的契約播種數據,它工作正常。
mycontractinstance.foofunction(1,2,3)
但是,一旦我嘗試連續發送多個交易,它就會在某個時候耗盡氣體,一切都會恢復。
mycontractinstance.foofunction(1,2,4) mycontractinstance.foofunction(1,3,3) mycontractinstance.foofunction(4,2,3) mycontractinstance.foofunction(1,2,1)
有沒有合適的方法來做到這一點?我應該等待第一筆交易的確認發送第二筆交易嗎?等等
好的,我將為這兩種情況提供 geth 日誌:
mycontractinstance.foofunction(1,2,3)
I0212 19:37:07.399271 67496 worker.go:349] 🔨 Mined block (#1018 / 4b46bd0b). Wait 5 blocks for confirmation I0212 19:37:07.399730 67496 worker.go:570] commit new work on block 1019 with 0 txs & 0 uncles. Took 419.499µs I0212 19:37:07.400184 67496 worker.go:570] commit new work on block 1019 with 0 txs & 0 uncles. Took 390.426µs VM STAT 161 OPs PC 00000000: PUSH1 GAS: 978149 COST: 3 STACK = 0 MEM = 0 STORAGE = 0 PC 00000002: PUSH1 GAS: 978146 COST: 3 STACK = 1 0000: 0000000000000000000000000000000000000000000000000000000000000060 MEM = 0 STORAGE = 0 PC 00000004: MSTORE GAS: 978134 COST: 12 STACK = 2 0000: 0000000000000000000000000000000000000000000000000000000000000040 0001: 0000000000000000000000000000000000000000000000000000000000000060 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ STORAGE = 0 PC 00000005: CALLDATASIZE GAS: 978132 COST: 2 STACK = 0 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001269: SWAP1 GAS: 917536 COST: 3 STACK = 7 0000: 0000000000000000000000000000000000000000000000000000000000000066 0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e387 0004: 0000000000000000000000000000000000000000000000000000000000000005 0005: 00000000000000000000000000000000000000000000000000000000000000b9 0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001270: SWAP3 GAS: 917533 COST: 3 STACK = 7 0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0001: 0000000000000000000000000000000000000000000000000000000000000066 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e387 0004: 0000000000000000000000000000000000000000000000000000000000000005 0005: 00000000000000000000000000000000000000000000000000000000000000b9 0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001271: SSTORE GAS: 897533 COST: 20000 STACK = 7 0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e387 0001: 0000000000000000000000000000000000000000000000000000000000000066 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0004: 0000000000000000000000000000000000000000000000000000000000000005 0005: 00000000000000000000000000000000000000000000000000000000000000b9 0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001272: PUSH1 GAS: 897530 COST: 3 STACK = 5 0000: 0000000000000000000000000000000000000000000000000000000000000006 0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0002: 0000000000000000000000000000000000000000000000000000000000000005 0003: 00000000000000000000000000000000000000000000000000000000000000b9 0004: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001274: SWAP2 GAS: 897527 COST: 3 STACK = 6 0000: 0000000000000000000000000000000000000000000000000000000000000004 0001: 0000000000000000000000000000000000000000000000000000000000000006 0002: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0003: 0000000000000000000000000000000000000000000000000000000000000005 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001275: SWAP1 GAS: 897524 COST: 3 STACK = 6 0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0001: 0000000000000000000000000000000000000000000000000000000000000006 0002: 0000000000000000000000000000000000000000000000000000000000000004 0003: 0000000000000000000000000000000000000000000000000000000000000005 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001276: SWAP2 GAS: 897521 COST: 3 STACK = 6 0000: 0000000000000000000000000000000000000000000000000000000000000006 0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0002: 0000000000000000000000000000000000000000000000000000000000000004 0003: 0000000000000000000000000000000000000000000000000000000000000005 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001277: ADD GAS: 897518 COST: 3 STACK = 6 0000: 0000000000000000000000000000000000000000000000000000000000000004 0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: 0000000000000000000000000000000000000000000000000000000000000005 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001278: DUP1 GAS: 897515 COST: 3 STACK = 5 0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388 0001: 0000000000000000000000000000000000000000000000000000000000000006 0002: 0000000000000000000000000000000000000000000000000000000000000005 0003: 00000000000000000000000000000000000000000000000000000000000000b9 0004: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001279: SLOAD GAS: 897465 COST: 50 STACK = 6 0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388 0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: 0000000000000000000000000000000000000000000000000000000000000005 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001289: AND GAS: 25017 COST: 3 STACK = 7 0000: ffffffffffffffffffffffff0000000000000000000000000000000000000000 0001: 0000000000000000000000000000000000000000000000000000000000000000 0002: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388 0003: 0000000000000000000000000000000000000000000000000000000000000006 0004: 0000000000000000000000000000000000000000000000000000000000000005 0005: 00000000000000000000000000000000000000000000000000000000000000b9 0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001290: CALLER GAS: 25015 COST: 2 STACK = 6 0000: 0000000000000000000000000000000000000000000000000000000000000000 0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: 0000000000000000000000000000000000000000000000000000000000000005 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001291: OR GAS: 25012 COST: 3 STACK = 7 0000: 000000000000000000000000957a1a87d653ea2218742aeea5a05f637b6509c4 0001: 0000000000000000000000000000000000000000000000000000000000000000 0002: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388 0003: 0000000000000000000000000000000000000000000000000000000000000006 0004: 0000000000000000000000000000000000000000000000000000000000000005 0005: 00000000000000000000000000000000000000000000000000000000000000b9 0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001295: JUMP GAS: 1 COST: 8 STACK = 2 0000: 00000000000000000000000000000000000000000000000000000000000000b9 0001: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00000185: JUMPDEST GAS: 0 COST: 1 STACK = 1 0000: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00000186: STOP GAS: 0 COST: 0 STACK = 1 0000: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 I0212 19:37:35.228514 67496 worker.go:570] commit new work on block 1020 with 1 txs & 0 uncles. Took 35.393252ms I0212 19:37:39.911673 67496 worker.go:349] 🔨 Mined block (#1020 / 20866eb5). Wait 5 blocks for confirmation I0212 19:37:39.913851 67496 worker.go:570] commit new work on block 1021 with 0 txs & 0 uncles. Took 2.123783ms I0212 19:37:39.914405 67496 worker.go:570] commit new work on block 1021 with 0 txs & 0 uncles. Took 468.437µs
然後對於多個事務(請注意,為了解決這個問題,我現在正在做 2 批 5 個事務,中間有延遲,但它仍然失敗):
mycontractinstance.foofunction(1,2,4) mycontractinstance.foofunction(1,3,3) mycontractinstance.foofunction(4,2,3) mycontractinstance.foofunction(1,2,1)
(為了便於閱讀,我刪除了 5k 行)
I0212 19:30:10.378653 67085 worker.go:570] commit new work on block 1005 with 0 txs & 0 uncles. Took 351.149µs I0212 19:30:10.378958 67085 worker.go:570] commit new work on block 1005 with 0 txs & 0 uncles. Took 257.975µs I0212 19:30:12.600042 67085 worker.go:349] 🔨 Mined block (#1005 / 3a254ec6). Wait 5 blocks for confirmation I0212 19:30:12.600616 67085 worker.go:570] commit new work on block 1006 with 0 txs & 0 uncles. Took 505.262µs I0212 19:30:12.601124 67085 worker.go:570] commit new work on block 1006 with 0 txs & 0 uncles. Took 406.985µs I0212 19:30:23.393724 67085 xeth.go:1028] Tx(0x53f7bd7602527142ff3491e630c9f51ce0bb5ca09f067eaa94431372e25e4e40) to: 0xb910402db16bd488562ed5e40b781282b8db4e86 I0212 19:30:23.397823 67085 xeth.go:1028] Tx(0x294b9c651c258278ebb13e6d4f2d96e02a026019adb94f7f25b3114d919eb870) to: 0xb910402db16bd488562ed5e40b781282b8db4e86 I0212 19:30:23.400484 67085 xeth.go:1028] Tx(0x6af44846a0dadadfa58a68d878457a737c8e4dbae25dbd9587b30bfb814a3a50) to: 0xb910402db16bd488562ed5e40b781282b8db4e86 I0212 19:30:23.401611 67085 xeth.go:1028] Tx(0x7013b9272764a295ebce818741344bae96ad19b3922a4ed39b22807d2501d675) to: 0xb910402db16bd488562ed5e40b781282b8db4e86 I0212 19:30:23.416332 67085 xeth.go:1028] Tx(0x1d1086c3f0700a7a902772d2155c644a6ca7076d3bafc81f4ec4cddff3f54e56) to: 0xb910402db16bd488562ed5e40b781282b8db4e86 VM STAT 195 OPs PC 00000000: PUSH1 GAS: 49978597 COST: 3 STACK = 0 MEM = 0 STORAGE = 0 PC 00000002: PUSH1 GAS: 49978594 COST: 3 STACK = 1 0000: 0000000000000000000000000000000000000000000000000000000000000060 MEM = 0 STORAGE = 0 PC 00000004: MSTORE GAS: 49978582 COST: 12 STACK = 2 0000: 0000000000000000000000000000000000000000000000000000000000000040 0001: 0000000000000000000000000000000000000000000000000000000000000060 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ STORAGE = 0 PC 00000005: CALLDATASIZE GAS: 49978580 COST: 2 STACK = 0 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00000006: ISZERO GAS: 49978577 COST: 3 STACK = 1 0000: 0000000000000000000000000000000000000000000000000000000000000024 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00000007: PUSH2 GAS: 49978574 COST: 3 STACK = 1 0000: 0000000000000000000000000000000000000000000000000000000000000000 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001292: SWAP1 GAS: 17483 COST: 3 STACK = 6 0000: 000000000000000000000000957a1a87d653ea2218742aeea5a05f637b6509c4 0001: ee60d0579bcffd98e668647d59fec1ff86a7fb340ce572e844f234ae73a69193 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: 0000000000000000000000000000000000000000000000000000000000000004 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 PC 00001293: SSTORE GAS: 17483 COST: 20000 ERROR: Out of gas STACK = 6 0000: ee60d0579bcffd98e668647d59fec1ff86a7fb340ce572e844f234ae73a69193 0001: 000000000000000000000000957a1a87d653ea2218742aeea5a05f637b6509c4 0002: 0000000000000000000000000000000000000000000000000000000000000006 0003: 0000000000000000000000000000000000000000000000000000000000000004 0004: 00000000000000000000000000000000000000000000000000000000000000b9 0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5 MEM = 96 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ...............? 0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ...............? 0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 ...............` STORAGE = 0 I0212 19:31:02.514098 67085 worker.go:570] commit new work on block 1009 with 7 txs & 0 uncles. Took 245.468809ms I0212 19:31:14.965310 67085 worker.go:349] 🔨 Mined block (#1009 / b1aa94c8). Wait 5 blocks for confirmation I0212 19:31:14.965771 67085 worker.go:570] commit new work on block 1010 with 0 txs & 0 uncles. Took 419.15µs I0212 19:31:14.965810 67085 worker.go:448] 🔨 🔗 Mined 5 blocks back: block #1004 I0212 19:31:14.966183 67085 worker.go:570] commit new work on block 1010 with 0 txs & 0 uncles. Took 328.43µs I0212 19:31:29.928411 67085 worker.go:349] 🔨 Mined block (#1010 / dd0c16f4). Wait 5 blocks for confirmation I0212 19:31:29.928910 67085 worker.go:570] commit new work on block 1011 with 0 txs & 0 uncles. Took 463.605µs I0212 19:31:29.928971 67085 worker.go:448] 🔨 🔗 Mined 5 blocks back: block #1005 I0212 19:31:29.929456 67085 worker.go:570] commit new work on block 1011 with 0 txs & 0 uncles. Took 431.551µs
我想知道我做錯了什麼,因為在同一個地址的同一個契約上的同一個應用程序上的瀏覽器可靠性中,我可以發送 5 次相同的交易並且它工作得很好,但是從看 geth 看起來他是排隊交易和我的交易是一次性發送的。
要添加的另一件事是我正在連結:
FooInstance.Foofunction.sendTransaction(50,201,1, function(err, address) { if (!err) console.log(address); // });
我正在為每個電話獲取交易地址。只是什麼都沒有工作。好像沒有交易成功。
我終於發現我做錯了什麼。您實際上需要為每筆交易提供氣體,否則它不起作用。
FooInstance.Foofunction.sendTransaction(var1,var2,varx,{from: web3.eth.accounts[0], gas:1000000}); FooInstance.Foofunction.sendTransaction(var3,var4,vary,{from: web3.eth.accounts[0], gas:1000000});