Skip to content

An advanced library to implement, deploy and use blockchains in NodeJS.

License

Notifications You must be signed in to change notification settings

arjundashrath/BlockJSchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlockJSchain

An advanced library to implement, deploy and use blockchains in NodeJS.

Installation

Using npm

npm i blockjschain

Supported Methods and Usage

Import the class by

var blk = require('blockjschain')

Initialize by creating an object of the class by

var bjsc = new blk()

Alter the mining difficulty of the blocks by providing the preceeding zeros during the object initialization. If parameter is left blank, default value of '0000' is selected

eg. var bjsc = new blk('00000')

Call a method with the created object

eg. bjsc.mine_block('Data')

Methods Syntax Usage
mine_block mine_block(optional parameter) Mine blocks by passing optional data as parameter
check_chain_integrity check_chain_integrity() Returns a boolean value: True if the chain is valid, False if the chain has been tampered with
get_chain get_chain() Returns the entire chain, the chain returned can be accessed like an array using indexes
chain_csv chain_csv(filename.csv) Exports the data of the blockchain to a csv file
chain_length chain_length() Returns count of blocks in the blockchain

Contributions are always welcomed Github

Reach out to me [email protected]

About

An advanced library to implement, deploy and use blockchains in NodeJS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published