This is a project dedicated towards building the basic cryptocurrency blockchain from scratch, using nothing but JS and to be precise:
- React, React-Router for the frontend
- Redis, NodeJS and Express for the backened.
- NO external packages or languages like Solidity, Truffle, Ganache are used in the project
- This webApp provides security and transaparency to its users involved within its network.
- Concepts like Proof-of-Work, Nonce, Difficulty have been implemented
- Secure transactions of demo cryptocurrency in the network is enabled.
- A publisher/subscriber methodology is implemented where the authorized users in the network will remain subcribed to the root chain of the network.
- A multi-node (Peer-to-Peer) system architecture is designed (as shown in the GIF above) where you can send crypto to other wallets as well.
In the domain of blockchain, an authorized user can only add a new block to the chain(mining), when his system demomstrates a PoW mechanism. Here, every new block containing its relevant data, will bear a hash of the data too. The PoW constraint applied is that: The hash generated should be such that the first 'difficulty' number of bits should be '0' mandatorily. And the variable 'nonce' can be manipulated accordingly to achieve this required Hash. In general, this is set to counter the mining rate of the new blocks, such it does not spam the enitre blockchain.
- Node and NPM
- Redis-Server
- PubNub (alternative to Redis)
- After cloning the project in your system, run
npm run devfor main development server. It is currently defaulting tolocalhost:3000. - All the backend endpoints refer to
localhost:3000/api/.... - In-order to run multiple peers (mutiple nodes of the BC network) simultaneously, run
npm run dev-peeras many times as the number of nodes you want. - All the peer nodes are configured to run on random ports <=4500. To figure out you peer-port, please watch the console logs in the
npm run dev-peercommand.
- This project is configured to run multiple nodes, and sync with the blockchain data with the
Root-Node-Address (RNA). On every peer's initial boot, it will first fetch the data from the Root chain. - The package.json contains multiple startup Scripts according to the different use cases like server start ups, distribution code, App deployment to public servers.