Is there a way to distinguish or calculate the total amount of ether which any account has received from mining and from the transfers (I mean the amount of ether transferred from other accounts)?
-
Are you referring to a technical solution to determine wether it was mined or recieved? – q9f Jun 13 '16 at 08:40
-
I mean how to determine it through the api. Suppose a node has 100 ethers - out of which 20 was sent to the node from other nodes, rest 80 were mined by the node itself. How to get these numbers? – Aman C Jun 13 '16 at 10:28
-
@RichardHorrocks So how do I trace back as we don't have any list transactions for an account api? – Aman C Jun 14 '16 at 05:56
-
Note that there is no such thing as "a node has 100 ethers". Ether is at an address on the blockchain. The same address can be used by several nodes, and the same node can use several addresses. – Distic Nov 24 '17 at 09:39
3 Answers
In principal all necessary data are on the blockchain. However - to practically get them you will need the help of a blockchain explorer.
Etherchain for example shows the mined blocks for each account. So this is an easy way to figure out how much of the Ether on this account was mined.
- 7,616
- 8
- 36
- 48
-
My question is can we use etherchain for a private setup as well? If not, what can be used to get the same results? – Aman C Jun 17 '16 at 07:57
As @mKoeppelmann suggests, etherchain will have the data. Here is a link to their API documentation - etherchain.org - API Documentation.
You can also use EtherScan.io's APIs.
For this, you will have to register and get a APIKeyToken, but the APIs of interest for you are:
Get Ether Balance for a single Account
Get a list of Account Transactions
Get list of Blocks Mined by a Specific Account - MINED Blocks
Get list of Blocks Mined by a Specific Account - UNCLE Blocks
- 40,274
- 14
- 123
- 193
-
-
-
The script is a way of pulling information from the blockchain, is there something available like an event which can trigger my daemon process which can then pull this information from the chain? – Aman C Jun 17 '16 at 04:50
Technically speaking tokens can be "minted" not mined. Mining is the process to create anew block in the chain with a reward in ether which are "mined" with the block. But tokens are just created as data in a smart contract not really mined.
At least for token based on MintableToken.sol by Open Zeppelin you can easily see that a fresh minted token comes from a 0x000.. address. Here an example of some token minted and sent to users:
https://etherscan.io/token/0xd3822b2aef3b7781aab63a24c2318be2fb0259b8
- 896
- 1
- 9
- 22