Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Blockchain By Example
  • Table Of Contents Toc
Blockchain By Example

Blockchain By Example

By : Badr, Horrocks, Xun (Brian) Wu
4 (2)
close
close
Blockchain By Example

Blockchain By Example

4 (2)
By: Badr, Horrocks, Xun (Brian) Wu

Overview of this book

The Blockchain is a revolution promising a new world without middlemen. Technically, it is an immutable and tamper-proof distributed ledger of all transactions across a peer-to-peer network. With this book, you will get to grips with the blockchain ecosystem to build real-world projects. This book will walk you through the process of building multiple blockchain projects with different complexity levels and hurdles. Each project will teach you just enough about the field's leading technologies, Bitcoin, Ethereum, Quorum, and Hyperledger in order to be productive from the outset. As you make your way through the chapters, you will cover the major challenges that are associated with blockchain ecosystems such as scalability, integration, and distributed file management. In the concluding chapters, you’ll learn to build blockchain projects for business, run your ICO, and even create your own cryptocurrency. Blockchain by Example also covers a range of projects such as Bitcoin payment systems, supply chains on Hyperledger, and developing a Tontine Bank Every is using Ethereum. By the end of this book, you will not only be able to tackle common issues in the blockchain ecosystem, but also design and build reliable and scalable distributed systems.
Table of Contents (13 chapters)
close
close

Testing the code

The next step in our implementation is to test the code. We could do this by manually calling the functions in our contracts and checking for the expected outcome, but the better way is to write tests using Truffle's test framework, thereby allowing us to automate the testing process.

Note that we could have developed our contracts in a test-driven way, by first defining the expected behavior of our contracts, writing an initially-failing test to test that behavior, and then writing code to allow the test to pass. In our case, we haven't done this, but Test-Driven Development (TDD) is a popular option for developers using the Truffle framework.

Truffle allows tests to be written in both JavaScript and Solidity. For our implementation, we'll use JavaScript, which, under Truffle, uses the Mocha testing framework and Chai assertion library. If you...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Blockchain By Example
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon