Leo-Blockchain
Easy & Simple implementation of blockchian
Hello World here is my blockchain implementation which you can use anywhere without more effort whether it be a simple wallet project or a transaction project. I have made use of Crypto Library of NodeJS to generate "SHA256" for the blocks.
// Import the module
const blockchain = require("leo-blockchain");
Following are the functionality provided by the module.
(1) Perform Transaction
blockchain.addTransaction(data); // datatype of "data" ---> JSON
(2) Search Transaction by transactionId
blockchain.searchTransaction(transactionId); // datatype of "transactionId" ---> Number
(3) Set Difficulty
blockchain.addTransaction(difficulty); // datatype of "difficulty" ---> Number
(4) Export your Chain
blockchain.exportBlocks("fileName.xyz");
(5) Import your Chain
blockchain.importBlocks("fileName.xyz");
This blockchain is not meant for professional use. There may be loophole. By no means I assure you that it will work like a charm. But I have tried my best to discover and fix all the loopholes