@sec-block/secjs-block
sec blockchain block lib
Last updated 2 years ago by feiminhao .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @sec-block/secjs-block 
SYNC missed versions from official npm registry.

SECJS-Block

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.generateBlock(tokenPool, tokenBlockChain)

Get the block information from transaction pool and write the information to block object.

  • tokenPool: Instance of token transaction pool
  • tokenBlockChain: Instance of token-blockchain

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.getBlockFromDB(hash, cb)

Get Block from database using hash.

  • hash: the hash of a block
  • cb: callback function

secjsTokenBlock.getBlocksFromDB(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.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

Current Tags

  • 1.0.32                                ...           latest (2 years ago)

31 Versions

  • 1.0.32                                ...           2 years ago
  • 1.0.31                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.30                                ...           2 years ago
  • 1.0.29                                ...           2 years ago
  • 1.0.28                                ...           2 years ago
  • 1.0.27                                ...           2 years ago
  • 1.0.26                                ...           2 years ago
  • 1.0.25                                ...           2 years ago
  • 1.0.24                                ...           2 years ago
  • 1.0.23                                ...           2 years ago
  • 1.0.22                                ...           2 years ago
  • 1.0.21                                ...           2 years ago
  • 1.0.20                                ...           2 years ago
  • 1.0.19                                ...           2 years ago
  • 1.0.18                                ...           2 years ago
  • 1.0.17                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.13                                ...           2 years ago
  • 1.0.12                                ...           2 years ago
  • 1.0.11                                ...           2 years ago
  • 1.0.10                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |