Читать книгу Blockchain Data Analytics For Dummies - Michael G. Solomon - Страница 71

Recording transaction data

Оглавление

Regardless of the approach used to create new blocks, blocks generally contain transactions or smart contract code. Because blockchain technology was introduced to manage cryptocurrency, it stands to reason that transaction data focuses on transferring ownership from one address to another. In this section, you look at a block to see its header information and a list of transactions.

Etherscan is a popular website that allows you to examine the live Ethereum network, mainnet. Figure 3-1 shows a portion of Etherscan’s block header view. The block we will examine is block number 8976776. Note that this block contains 95 transactions.


FIGURE 3-1: Viewing block header information in Etherscan.

To find block 8976776 in Etherscan, go to https://etherscan.io/ and enter the block number in the All Filters field. Then click or tap the search icon (magnifying glass).

Etherscan does much more than provide a way to peek at data on Ethereum’s mainnet. You can examine and retrieve data from mainnet; popular testnets including Ropsten, Kovan, Rinkeby, and Goerli; and the Energy Web Foundation (EWF) chain. If you create an account and request a free API key, you can use the key to extract blockchain data.

To see a list of transactions in block 8976776, click or tap the 95 Transactions link. Figure 3-2 shows the first 5 transactions in block 8976776. You can see that each transaction has a From account, a To account, and an amount. In simplest terms, each transaction records an amount in the Value column being transferred from one Ethereum account to another.


FIGURE 3-2: Listing transactions in a block in Etherscan.

Click or tap the fourth transaction in Figure 3-2 to open the Etherscan transaction details page shown in Figure 3-3. This initial page shows general information about the Ethereum transaction. The To field shows that the target address is Contract, which means that this transaction is the result of a call to a smart contract.


FIGURE 3-3: Examining a transaction in Etherscan.

In Ethereum, the only way you can access data stored in the blockchain is through a smart contract. You use the smart contract’s address (where the smart contract code is stored in the blockchain) to run, or invoke, one of its functions. Smart contract functions contain the instructions for accessing blockchain data.

Click or tap Click to See More, in the bottom left, to display the expanded transaction details page with additional information about the smart contract function call shown in Figure 3-4. You can see that this transaction is the result of invoking this smart contract’s cancelOrder() function. You'll learn more about smart contracts and transaction details in later chapters, but for now, be aware that blockchain technology keeps a record of every change to blockchain data, which provides a great place to get analytics data.


FIGURE 3-4: Exploring additional transaction details in Etherscan.

Blockchain Data Analytics For Dummies

Подняться наверх