How to make an Ethereum Transaction, & check your balance?

Monday, 29 Feb 2016 22:34

Once you have managed to set up an Ethereum Miner using either your GPU or your CPU – it’s time to start checking your balance and start trading. We’re going to show you how you can check your balance in Command Prompt, how to convert between all the different values of Ether, such as the base unit Wei, and how to make your first transaction! 

Once you have set up your miner via running the Geth program and Ethminer program (see our guide here on how to get started), you need to open up a third Command Prompt Window.

Step 1: This can be done by right clicking on the command prompt in the taskbar at the bottom of your screen – and then clicking on the command prompt that appears at the top of the menu. A third command prompt should now be open.
Step 2: You now need to tell this Command Prompt where to look to get up and running. Usually the command Prompt window opens looking at your user profile. If this is the case you need to tell Command Prompt to go to wherever you installed geth. In our guide we installed it straight on the C Drive – so we need to tell command prompt to get back to the C Drive – which we do by typing in “cd C:\” and pressing enter.
Step 3: You then need to tell Command Prompt what to do. In this case you need to tell it to attach to Geth. So all you type in is “geth attach” – which should look like this “C:/>geth attach” – and then press enter. You now have a console up and running – talking to geth – so you can start asking it questions – or telling it to do things. Remember for "geth attach" to work you need to have another Command Prompt Window running with "geth --rpc".

If you want to find out your address you type in “eth.coinbase”. This should look like this “C:/>eth.coinbase”. Press enter and you should see your address appear – which is a long string (set of characters and numbers – to find out how your address is generated and about private and public keys  see our guides here).

If you want to check your balance you can simply type in this command here  “eth.getBalance(eth.coinbase)” and hit enter. Make sure you capitalise the B in "balance" and also bear in mind that this gives your balance in Wei – one of the smaller denominations of Ether – just like satoshi in Bitcoin and cents in dollars.

get ethereum balance

If you want to check your balance in Ether you need to type in the following code “web3.fromWei(eth.getBalance(eth.coinbase),"ether")” and press enter – and likewise in other denominations of Ether just change the end of the sentence to include the denomination you want to convert to. So if you want to convert to finney or Shannon follow these two commands here “web3.fromWei(eth.getBalance(eth.coinbase),"finney")” or “web3.fromWei(eth.getBalance(eth.coinbase),"shannon")”. Remember to capitalise the B in the getBalance bit and if you want to learn more about the existing options, checkout out our guide on different denominations of Ether.

If you want to send a transaction from your address type in the following command:

eth.sendTransaction({from: eth.coinbase, to: "0x154230ed91d1e711e56b9c0f88b5ba5fd2b0503f", value: web3.toWei(1, "ether"),gas:22000,gasPrice:web3.toWei(45,"Shannon"),data: web3.toHex('ZeroCool')})
The simple version for this, without any optional fields is:
eth.sendTransaction({from: eth.coinbase, to: "0x154230ed91d1e711e56b9c0f88b5ba5fd2b0503f", value: web3.toWei(1, "ether")})

Send ethereum transaction

Lets break this down a bit so you can understand what each bit means:

eth.sendTransaction – means you are telling geth to send a transaction.
({from: eth.coinbase, - you are telling geth to take the ether from your address – coinbase just means your own address.
to: "0x154230ed91d1e711e56b9c0f88b5ba5fd2b0503f", - means the address you are sending the Ether to.
value: web3.toWei(1, "ether"), - is the value you are sending – you can change the value of 1 to other denominations of ether and long as you change the second part of the brackets to the denomination term you are sending in.
gas:22000,gasPrice:web3.toWei(45,"Shannon"), - OPTIONAL - this shows you how much gas you want to pay for the transaction. Gas is the pricing mechanism for a transaction – when in fact it is ultimately Ether and controlled by how many people want to use the network at that time. For a more in depth look at what gas is check out our article on gas! If you don't include gas and gasPrice it will use the current network default.
data: web3.toHex('ZeroCool')}) - OPTIONAL - is a tag to the transaction – just like you put on any bank transfer. You can put as many characters as you want, but the higher the number of characters the more gas it will cost to process the transaction. The have the cheapers transfer fee just don't include this option.

Now you have learnt how to do a transaction you can start transferring your ether to an exchange like Kraken or Poloniex to begin trading.

The easier way to do this would be by using the Ethereum Wallet Dapp but do keep in mind that this is still in beta.

Comments
CryptoCompare needs a newer browser in order to work.
Please use one of the browsers bellow: