Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Blockchain. - Second Edition

You're reading from  Mastering Blockchain. - Second Edition

Product type Book
Published in Mar 2018
Publisher Packt
ISBN-13 9781788839044
Pages 656 pages
Edition 2nd Edition
Languages
Author (1):
Imran Bashir Imran Bashir
Profile icon Imran Bashir
Toc

Table of Contents (21) Chapters close

Preface 1. Blockchain 101 2. Decentralization 3. Symmetric Cryptography 4. Public Key Cryptography 5. Introducing Bitcoin 6. Bitcoin Network and Payments 7. Bitcoin Clients and APIs 8. Alternative Coins 9. Smart Contracts 10. Ethereum 101 11. Further Ethereum 12. Ethereum Development Environment 13. Development Tools and Frameworks 14. Introducing Web3 15. Hyperledger 16. Alternative Blockchains 17. Blockchain – Outside of Currencies 18. Scalability and Other Challenges 19. Current Landscape and What's Next 20. Another Book You May Enjoy

Web3

Web3 is a JavaScript library that can be used to communicate with an Ethereum node via RPC communication. Web3 works by exposing methods that have been enabled over RPC. This allows the development of user interfaces that make use of the Web3 library in order to interact with the contracts deployed over the blockchain.

In order to expose the methods via geth, the following command can be used:

$ geth --datadir .ethereum/privatenet/ --networkid 786 --rpc --rpcapi 'web3,net,eth,debug' --rpcport 8001 --rpccorsdomain 'http://localhost:7777' 
The --rpcapi flag allows the web3, eth, net, and debug methods.

This is a powerful library and can be explored further by attaching a geth instance. Later in this section, you will be introduced to the concepts and techniques of making use of Web3 via JavaScript/HTML frontends.

The geth instance can be attached using the...

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 ₹800/month. Cancel anytime