Socket
Socket
Sign inDemoInstall

@sec-block/secjs-blockchain

Package Overview
Dependencies
8
Maintainers
7
Versions
131
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sec-block/secjs-blockchain

sec blockchain block lib


Version published
Weekly downloads
39
decreased by-60.2%
Maintainers
7
Install size
33.2 MB
Created
Weekly downloads
 

Readme

Source

SECJS-Blockchain

js-standard-style

This libary contains the definition of block and block chain model. Use this libary can get the information of the block and blockchain information. And also generate the genesis block.

API of token blockchain

new secjsTokenBlock()

Instance object of block of token chain.

  • config: the file path to save the token information
secjsTokenBlock.getBlock()

Return the block instance.

secjsTokenBlock.putGenesis(genesis, cb)

Put token chain genesis block into database.

  • genesis: json object of genesis block
  • cb: callback function

secjsTokenBlock.getBlocksWithHashFromDB(hashArray, cb)

Get blocks from array of blockhash

  • hashArray: an array of block hash
  • cb: callback function

secjsTokenBlock.putBlockToDB(block, cb)

  • block: json object of block
  • cb: callback function

secjsTokenBlock.getBlockChainFromDB(minHeight, maxHeight, cb)

  • minHeight: height of block begin to read
  • maxHeight: height of block end to read
  • cb: callback function

secjsTokenBlock.getGenesis()

Get genesis block direct from buffer

secjsTokenBlock.getLastBlock()

Get last block direct from buffer

secjsTokenBlock.verifyTransaction()

Verification the transaction.

new secjsTokenBlockChain()

  • config: Token Block chain

secjsTokenBlockChain.init(callback)

This function check the existence of the file to save the block chain information. If the file is not existed, a new file will be created. Otherwise the block chain will be loaded from the file.

  • callback: callback function with parameter tocken blockchain

secjsTokenBlockChain.getBlockChain()

Return the block chain instance

secjsTokenBlockChain.generateGenesisBlockChain()

Create the genesis blockchain

API of transaction block chain

Funcionality simlar as token blockchain and token block

License

MIT

Keywords

FAQs

Last updated on 08 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc