1.0.4 • Published 3 years ago

blockjschain v1.0.4

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

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')

MethodsSyntaxUsage
mine_blockmine_block(optional parameter)Mine blocks by passing optional data as parameter
check_chain_integritycheck_chain_integrity()Returns a boolean value: True if the chain is valid, False if the chain has been tampered with
get_chainget_chain()Returns the entire chain, the chain returned can be accessed like an array using indexes
chain_csvchain_csv(filename.csv)Exports the data of the blockchain to a csv file
chain_lengthchain_length()Returns count of blocks in the blockchain

Contributions are always welcomed Github

Reach out to me arjundashrath@gmail.com

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago