Skip to Content
Foundations of Blockchain
book

Foundations of Blockchain

by Koshik Raj
January 2019
Beginner to intermediate
372 pages
11h 17m
English
Packt Publishing
Content preview from Foundations of Blockchain

Application endpoints

As mentioned earlier, the application has an HTTP interface that it uses to manage the nodes and a WebSocket interface for P2P communication between the nodes. Here are some of the endpoints that are required to manage the nodes:

  • /blocks

  • /block/<hash>

  • /mineBlock

  • /transaction/<id>

  • /sendTransaction

The sendTransaction endpoint will basically create the transaction and add it to the pool, as explained in the Transaction Management section. Unconfirmed transactions are included in the blockchain by using the /mineBlock endpoint.

The following output shows the state of the blockchain before any other transactions are performed because it contains a genesis block:

[ { "data": { "id": "baeece2d8e57aef79ef4e693df0485ca8938ad1f27fa9a0426c8788a3802f02f", ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain Basics

Blockchain Basics

Daniel Drescher
What Is Blockchain?

What Is Blockchain?

Sir John Hargrave, Evan Karnoupakis
Mastering Blockchain

Mastering Blockchain

Lorne Lantz, Daniel Cawrey

Publisher Resources

ISBN: 9781789139396Supplemental Content