Quick review of the build process

The first thing that we did in this endpoint is made requests to all of the other nodes in the network so that we could access the blockchain that is hosted on each of them. After we ran all of these requests, we then had access to all of the blockchains that are hosted on all of the other nodes inside of the network. We then iterate through all of the other blockchains inside of the network with the help of the forEach loop. And as we iterated through the other blockchains, and if we find a longer chain we then update the maxChainLengthnewLongestChain, and newPendingTransactions variables to reflect that. Then, when the forEach loop is complete, we'll know if there is a chain on the network longer than ...

Get Learn Blockchain Programming with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.