Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Ethereum Cookbook

You're reading from   Ethereum Cookbook Over 100 recipes covering Ethereum-based tokens, games, wallets, smart contracts, protocols, and Dapps

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789133998
Length 404 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Manoj P R Manoj P R
Author Profile Icon Manoj P R
Manoj P R
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started 2. Smart Contract Development FREE CHAPTER 3. Interacting with the Contract 4. The Truffle Suite 5. Tokens and ICOs 6. Games and DAOs 7. Advanced Solidity 8. Smart Contract Security 9. Design Decisions 10. Other Protocols and Applications 11. Miscellaneous 12. Other Books You May Enjoy

Using block explorer

There are many ways to read data from a transaction or a block in Ethereum. Etherscan is one block explorer and analytics platform for Ethereum. In this recipe, you will learn about the platform and how you can make use of it.

How to do it...

  1. Go to https://etherscan.io/ to access the block explorer. You will see a dashboard that displays the network state:
  1. On the top left, you can see a card that displays the current Ethereum market share along with the exchange rate. You can also see a transaction history chart for the last 14 days.
  2. Search for a block number or select it from the recent blocks list to view the contents of the block. You can see details such as time, miner, hash, transactions, size, gas, and so on:
  1. By searching a transaction, you can view transaction details such as from address, to address, the value transferred, gas, and other details.
  2. Etherscan also offers a details page for both Externally Owned Addresses (EOA) and contract addresses. To see the balance, list of transactions, and even tokens owned by that address, navigate to the EOA details page.
  3. The contract page also shows the balance, transactions, and even a contract code if it is a verified contract. To interact with verified contracts through Etherscan, use this page.
  4. The platform also offers charts for analytics. Use the charts to get an idea about the currency, network, mining, blocks, transactions, and other general information.
  5. Click the MISC tab to use tools such as the mining calculator, bytecode converter, and transaction broadcaster.
  6. Etherscan also has a free to use API for reading data from Ethereum. Sign up to Etherscan to use the API and use the free API key that can be generated from the portal itself. Make sure that you are not making more than five requests per second. You will be blocked if this is exceeded.
  1. Signing up with Etherscan will allow you to watch specific addresses and create email alerts. You can even add a private note for each transaction.

There's more...

Eth-netstats is a visual interface for tracking an Ethereum network status. To access the public status page, go to https://ethstats.net/. Note that the portal does not represent the entire state of the Ethereum main net. This is because of the voluntary listing of nodes in the portal.

You can use netstats to visualize your private Ethereum network:

  1. Download the source code from the repository. Make sure to verify the license:
git clone https://github.com/cubedro/eth-netstats
  1. Install the dependencies:
sudo npm install -g grunt-cli
cd eth-netstats
npm install
  1. Build the project using grunt and use npm to run it:
grunt
npm start
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime