Building a cryptocurrency
npm run devin the first one- Something like
HTTP_PORT=3002 P2P_PORT=5002 PEERS=ws://localhost:5001 npm run devandHTTP_PORT=3003 P2P_PORT=5003 PEERS=ws://localhost:5001,ws://localhost:5002 npm run devin tabs 1,2, etc., incrementing the port numbers and adding peers in each tab. - Use Postman to POST /mine endpoint with a data body param in whatever port instance you want.
- You can see this block in GET /blocks for the other ports
- You can also add transactions and use /mine-transactions to add a block. Try adding transactions from some of the other ports and mining on 3001 and verifying the block is added to the blockchain at /blocks.
- Have the clear transactions method only clear a subset and not the entire pool.
- Implement transaction fees that are used as part of a miner's reward.
- Make the blockchain's reward wallet inaccessible to others.
- Build a basic frontend or maybe electron desktop app for the wallet, etc.
- Make an index folder in each dir to import/export all required files.