How do I force a transaction to execute on a certain future block #? (Ethereum, JS API) -
i'm trying send transaction , have execute on block. appears possible according js api:
https://github.com/ethereum/wiki/wiki/javascript-api#web3ethsendtransaction
see parameter #2, unless i'm misunderstanding it.
but every time try this, fails "invalid address":
incrementer.increment.sendtransaction({from:eth.coinbase}, 28410, function(err, address) { if (!err) console.log("no err " + address); else console.log("err " + address); });
...whereas removing block parameter 28410...
incrementer.increment.sendtransaction({from:eth.coinbase}, function(err, address) { if (!err) console.log("no err " + address); else console.log("err " + address); });
...succeeds fine.
anybody know going on this? i'm trying possible?
the web3.eth.sendtransaction(transactionobject [,callback])
function has indeed 2 parameters.
(see here: https://github.com/ethereum/web3.js/blob/master/lib/web3/methods/eth.js#l177, optional callback implicit).
the text in wiki copy & past mistake. fixed now, please don't blame not having read documentation :)
nb. don't see why wish target special block transaction inclusion. can never sure transaction included in block since decided miner , not transaction submitter. if have deferred execution, need use contract.
edit: add reply comment below it's general information.
"transaction" , "contract" 2 things @ different levels. when speaking of "contract", 1 speaks (in context of ethereum) of application code defining logic executed either totally or not @ (ensured blockchain, no need 3rd trusted party, "smart contract"). code "lives" on blockchain, ie. code stored there , has state/memory there.
a transaction "do" on blockchain. when want deploy contract, place (the code) in transaction object , send without destination address (to blockchain speak). deployment executed miner , contract inserted in blockchain. deployment operation transaction.
executing ether transfer transaction (basically invoking simple internal value transfer contract). invoking , executing complex "user"-contract transaction, executed miner, , result/outcome stored on blockchain (as part of mined block). basic transaction execution has costs (send value, deploy), executing complex contracts (cf gas etc.).
(it's bit difficult explain all in 2 words. each time, re-read text, add new sentences ;) hope helps.)
Comments
Post a Comment