Book Image

Blockchain By Example

By : Bellaj Badr, Richard Horrocks, Xun (Brian) Wu
Book Image

Blockchain By Example

By: Bellaj Badr, Richard 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)

IPFS file uploader project

In the second part of this chapter, we will take a more detailed look at how we can use IPFS's HTTP API programmatically. To do so, we will create a simple HTML and JavaScript web page from which we can upload files to IPFS directly, without the need to first upload the files to a backend server.

To do this, we will use the JS-IPFS-API JavaScript library, which will allow a browser-based frontend to communicate directly with the local IPFS node that we created earlier in the chapter. Note that this API library should not be confused with JS-IPFS, which is a JavaScript implementation of the main IPFS protocol.

The aim here is not to explore the HTTP API completely, but to provide a basic example of how it can be used. To learn more about the methods made available by the API, the relevant documentation should be consulted, at https://github.com/ipfs...