- How to make an Ethereum Transaction, & check your balance?
- Checking Your Balance on the Ethereum Blockchain
- It’s easy to check your balance and transaction history on an Ethereum blockchain explorer like EthVM, Etherscan, or Ethplorer.
- EthVM
- Etherscan
- Ethplorer
- How to Query Balances for all Ethereum Addresses in BigQuery
- Calculating Trace Statuses
- Handling Irregular State Changes in DAO Fork
- Limitations
- Challenge
- How to make an Ethereum Transaction, & check your balance?
How to make an Ethereum Transaction, & check your balance?
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.
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:
The simple version for this, without any optional fields is:
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.
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.
Источник
Checking Your Balance on the Ethereum Blockchain
3 min read
It’s easy to check your balance and transaction history on an Ethereum blockchain explorer like EthVM, Etherscan, or Ethplorer.
These websites offer a full history of your activity. All you have to do is search your public Ethereum address, which is the 42 character string beginning with ‘0x’. It is not recommended to unlock your wallet on a wallet interface like MEW every time you’d like to check your balance, for the security of your information.
Be aware that when checking balances from different blockchains, like ETC, you will need to use a different blockchain explorer.
EthVM
Step 1. Head to EthVM.
Step 2. In the search bar, enter your Ethereum public address, (0x…..).
Step 3. You will be taken to a wallet overview.
- At the top, the checksummed version of your address will be displayed. Read our article about the differences between checksummed and non-checksummed addresses.
- Just below your address, you will see your total ETH balance, USD value equivalent, and the total number of different types of tokens you hold.
- In the first tab, ‘Transaction History’, you will find a list of all your recent transactions.
- In the ‘ERC20 Tokens’ tab, you can find your token balances. When looking for custom token information, this is where you can select a specific token to find its contract address, decimal count, and symbol. Check out our guide to learn more about adding custom tokens to MEW.
- The last tab, ‘NFTs’, shows all your Non-Fungible ERC721 tokens.
Etherscan
Step 1. Head to Etherscan.io.
Step 2. In the search bar, enter your Ethereum public address, (0x…..).
Step 3. You will be taken to a wallet overview.
- At the top, you will see the checksummed version of your address. Read our article about the differences between checksummed and non-checksummed addresses.
- In the ‘Overview’ section, you will see your ETH balance and value.
- Under ‘Token’, you can find your Token Balances. When looking for custom token information, this is where you can select a specific token to find its contract address, decimal count, and symbol. Check out our guide to learn more about adding custom tokens to MEW.
- The tabs at the bottom of the screen show the history of ETH, ERC20 token, and ERC721 token transactions.
Ethplorer
Step 1. Head to Ethplorer.io.
Step 2. In the search bar, enter your Ethereum public address, (0x…..).
Step 3. You will be taken to a wallet overview.
- To the left, you will see the checksummed version of your address. Read our article about the differences between checksummed and non-checksummed addresses.
- You can also find your ETH balance to the left, under ‘Address Information’.
- To the right, you can find your Token Balances. When looking for custom token information, this is where you can select a specific token to find its contract address, decimal count, and symbol. Check out our guide to learn more about adding custom tokens to MEW.
- The bottom of the screen shows the history of ETH, ERC20 token, and ERC721 token transactions. You can apply filters if you want to see just ETH or tokens, using tick marks at the top.
Источник
How to Query Balances for all Ethereum Addresses in BigQuery
Recently we announced beta availability of transaction traces (aka internal transactions) in our public Ethereum dataset in BigQuery: https://bigquery.cloud.google.com/table/bigquery-public-data:crypto_ethereum.traces. They allow querying all Ethereum addresses with their balances.
Below is the query that will give you top 10 balances:
The balances table is updated daily. In case you want live balances you can use the below query:
Here is the result, on the day of writing (as csv file):
Here is the high-level overview of the workflow we used to get this result:
- Export all traces from Parity node to BigQuery using Ethereum ETL.
- Enrich the traces with the status field which accounts for parent trace failures.
- Add genesis and daofork traces.
- Write an SQL to calculate the balances.
Along the way I had to solve a few interesting challenges, which I will uncover in the following sections.
Calculating Trace Statuses
The traceAddress field of all returned traces, gives the exact location in the call trace [index in root, index in first CALL , index in second CALL , …].
i.e. if the trace is:
then it should look something like:
Parity also provides an error string for each trace in case it failed. Unfortunately it doesn’t account for the top-level trace failures. For example, if the call to C in the example above succeeded, but the top-level call to A failed due to say out-of-gas error, then the trace for the call to C will not return any error with it. This is problematic because any state changes in the call, including Ether transfers, are reverted. We want to filter out such nested calls that look like successes in the traces but actually were reverted due to top-level trace failures.
Your first thought may be to reconstruct the call tree from the flat traces returned by Parity, for each call traverse up the tree and see if any top-level calls failed, set the status for each call accordingly.
Another solution, which I ended up using, is to first query all failed traces, then find all their child traces and mark them as failures. This is easily done in BigQuery with the following SQL: https://github.com/blockchain-etl/ethereum-etl-airflow/blob/master/dags/resources/stages/enrich/sqls/traces.sql
The status field is 0 when the trace succeeded, and 1 when it failed due to any operation that can cause the call itself or any top-level call to revert. This is consistent with the status field in transaction receipts.
Handling Irregular State Changes in DAO Fork
If you simply query balances from the traces returned by Parity, these two addresses will come up at the top:
In reality, the above addresses have only 7 Wei each, on the day of writing. If you google them you will encounter this post about the DAO fork by Vitalik Buterin https://blog.ethereum.org/2016/07/20/hard-fork-completed/. Here is the summary:
Block 1920000 contained the execution of an irregular state change which transferred
12 million ETH from the “Dark DAO” and “Whitehat DAO” contracts into the WithdrawDAO recovery contract.
These irregular state changes don’t appear in Parity traces, so I had to query them with this SQL: https://github.com/blockchain-etl/ethereum-etl-airflow/blob/master/sqls/daofork_traces.sql. The result is then hardcoded in the Ethereum ETL tool and ingested to the BigQuery dataset.
trace_type column for these irregular traces is daofork . Another special type of traces that I had to add to the table is genesis , which are the initial Ether allocations. They are not associated with any transactions and thus not returned in transactions or traces APIs.
Limitations
Johannes Pfeffer from alethio helped identify addresses for which the balances shown in the query results doesn’t match with the balances reported by the Ethereum nodes. Here is the list of the addresses:
The presumable root cause is this issue in Parity https://github.com/paritytech/parity-ethereum/issues/7765, which results in that the calls to precompiled contracts are missing from API results.
We will need to resync our Parity nodes, rerun the ETL, after which this issue will be resolved.
Challenge
It’s possible to query running Ether balances for every address on every date. Try to compose a query that will return the number of addresses with non-zero balance, and plot it over time. Post your SQL in the comments. (Solution)
Источник
How to make an Ethereum Transaction, & check your balance?
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.
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:
The simple version for this, without any optional fields is:
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.
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.
Источник