1.0.1 • Published 2 years ago

leo-blockchain v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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");