Sending my first transaction - HELP!

haroldharold Member Posts: 10
Hi guys,
All happy and fine in etherland. All synced up and exploring java console.

I dont know if web3.eth.sendTransaction is what I should be using to send ETH to an exchange. Could somebody please give me the simplest example of a send command in geth solely for the purpose of moving coin.

Thanks!

Answers

  • _javi__javi_ Member Posts: 24
    +1
    After knowing you can send ether to valhalla (0x000..0) with a typo in command, i´m afraid of loosing the coin.

    Please let us know the proper and safer way to make a tx.

    thanks in advance
  • haroldharold Member Posts: 10
    edited August 2015
    Anybody? I found this from https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console

    Is this OK for a send of 10 ETH and do I need to set gas price? If I dont is 1000 the default?

    Looking here http://ether.fund/tool/converter#v=10&u=szabo if a gas unit costs 10 szabo tehn 1000 gasprice will mean 0.1 ETH?

    eth.sendTransaction({from: eth.accounts[0], to: "...", value: "10", gasPrice: "1000"})


    EDIT: SEE BELOW



    Post edited by harold on
  • haroldharold Member Posts: 10
    edited August 2015
    SEE THIS https://github.com/ethereum/go-ethereum/wiki/Sending-ether

    So to send 10 ETH from your primary address to account number ending 007 you'd enter the following? I'll wait 30 mins and give it a go if nobody comments :)

    eth.sendTransaction({from:eth.accounts[0], to:"0x…007", value: web3.toWei(10, "ether")})


    Maybe I don't have to worry about gas price then? Help to clarify please
    ALSO do I need web3.toWei? see https://github.com/ethereum/wiki/wiki/JavaScript-API

    update: It worked! B)
    Post edited by harold on
  • _javi__javi_ Member Posts: 24
    i cant paste that line with my data at a "geth attach" instance.
    the screen gets flooded with text. (???)

    i tried too..

    var sender = eth.accounts[0];
    var receiver = "0x..my account...";
    var amount = web3.toWei(10, "ether");
    eth.sendTransaction({from:sender, to:receiver, value: amount})

    i get...

    could not unlock signer account
    at InvalidResponse (:-60926:-63)
    at send (:-124886:-63)
    at sendTransaction (:-113803:-63)
    at :1:1


    moving coins cant be that difficult.. what did i miss???




  • haroldharold Member Posts: 10
    edited August 2015
    i opened a java console with:

    geth console 2>> /dev/null

    and then:

    eth.sendTransaction({from:eth.accounts[0], to:"0x…007", value: web3.toWei(10, "ether")})


    Note: You need to specify a password in your command for non-interactive use, see documentation (i remember reading about it). otherwise just do as I did (keep it simple) and communicate interactively with the console which'll prompt you for a password.
    Post edited by harold on
  • _javi__javi_ Member Posts: 24
    edited August 2015
    geth console 2>> /dev/null

    ...does nothing here as i´m on win7

    still lost :(

    my problem is the paste.
    when i paste the eth.sendTransaction line, the screen is flooded with that line, repeated many times.
  • haroldharold Member Posts: 10
    ah sorry - my instructions for OSX/Linux
  • _javi__javi_ Member Posts: 24
    personal.unlockAccount(eth.accounts[0], "my pwd here")
    var sender = eth.accounts[0];
    var receiver = "0x.....my accnt here....";
    var amount = web3.toWei(10, "ether");
    eth.sendTransaction({from:sender, to:receiver, value: amount})

    and then geth answered with tx id...
    0x22d90.......
    bingo! now the wait begins...

    thanks for the help!

    there´s def a problem with the pasting on geth for that long line.
    worked with the short ones, pasted one by one.
  • dreqzackdreqzack Member Posts: 2
    Hi!

    In my case, there seemed to be a problem with the "auto unlocking" of the sending account.
    The interactive password prompt didn't show up, instead there was the error message (could not unlock signer account). After unlocking the account via

    geth --unlock "0x00xxx"

    I was able to send my coin.


  • 2xPress2xPress Member Posts: 16
    after eth.sendTransaction({from:eth.coinbase, to:0x7c9943A3C97099dBD6b1D6040d19D1Df4aB91de4, value: web3.toWei(0.40, "ether")})

    invalid address
    at web3.js:3887:15
  • a_ea_e Member Posts: 2
    edited July 2016
    2xPress said:

    after eth.sendTransaction({from:eth.coinbase, to:0x7c9943A3C97099dBD6b1D6040d19D1Df4aB91de4, value: web3.toWei(0.40, "ether")})

    invalid address
    at web3.js:3887:15

    2xPress: you need the " " quotes around the address like "0x7c9943A3C97099dBD6b1D6040d19D1Df4aB91de4"

    If you have already defined it, such as var receiver = "0x...e4"; then just put receiver without the " " quotes.
Sign In or Register to comment.