Ethereum: How to learn to query the block chain?

Ethereum: Handmade for the Nachihovy Press Operations

As an enthusiast cryptocurrency, Ponimania, as a blockchain work, there is an important value for the consumable resolutions of infestations and projects. One of the key aspects of this is invited by blockchain, which allows you to access and analyze the data about transaction, addresses, and second compatible information. In this state, we dissatisfied with the subdivisions of the ethereum, and we will take the priests of that, how to fill out the various requests.

What is the invite for blockchain?

In the ethereum, he is invited to the conquel, which leaves the concrete data from the blockchain. Inviting the blockchain, you can refer to the presentation of your activation with the techniques, the definition of tendencies and optimization of your investment decisions.

Basic Functions Press in Ethereum

In order to start the blockchain Ethereum, you need to reap the main functions, which have been presented by the programs of vastness, used in the network. These functions allow you to allow you to make the mechanisms and the transfer of data blockchain.

Here are some of the naiblets of spreading function:

  • eth_getblockbyhash (): catch the block over his hash.

  • eth_gettransactioncount (): Returns the number of transaction in the trial block or all the blockchain.

  • eth_gettransactionscountofaddress (): Retrieve transaction for concrete address.

  • eth_getaddress (): Calves the Denings, included his balance and transaction history.

  • eth_getblockheaderbynumber (): Flowing the block of the block over his hash.

PRIMER PROVESS: PRODUCT X transaction with TECEMS

Let’s use these functions to invite the blockchain ethereum and find out, weakened with the time with the time of the transaction.

1. Forest mid -sizes of Bitcoin transaction

To find the medium sizes of the bitcoin transaction, we can invite the function eth_getblockbyhash ()

Pragma Polidy ^0.8,0;

AVEGETRANSIZE {

Uint256 Public Bitcointransactionsize;

to be understood to the general Bitkuzdress;

Cartying (Uint256 => Uint256) Public Transactioncounts;

Function __init (Address _Bitcoinaddress) PUBLIC {

Bitcoinaddress = _Bitcoinaddress;

}

Functional Query () Public Reparts (Uint256, Uint256) {

for (address _Bitcoinaddress in Bitcoinaddress) {

// invite Bitcoin -block

uint256 blockhash = tx.origin; // replace on the scoring data about transaction

// Revet a general transaction value in this block

Uint256 totalvalue = 0;

For (Uint256 I = 1; I <= 10; I ++) {// Change to reasonable transaction on the block

uint256 transactionhash = txhash (blockhash, i);

Transactioncounts [transactionhash] += tx.value * i;

Totalvalue += tx.value * I;

}

// Disperate mid -sizes transaction

Bitcointransactionsize += (Totalvalue / 10) * I;

}

}

}

`

2. Forest the number of deer with X transactions

To find the number of reserves with the help of the transaction, we can invite the function eth_getblockbyhash () for each unit in the Ethereum block and shake the residues in each block.

Pragma Polidy ^0.8.

ETHEREUM DOES ROUNDS

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top