@biut-block/biutjs-pow

1.0.4 • Public • Published

JavaScript Style Guide

[JavaScript Style Guide]

SECPow

This library is for sec blockchain pow mining and verification

new SECPow(config)

Param Type Description
config Object JSON format configurations for constructor

secPow.verifyPOW(block, callback) => None

Verify correctness of pow result

Kind: instance method of SECPow

Param Type Description
block Object single block data
callback function callback function

secPow.mineLight(block, difficulty, callback) => None

Light client mining function

Kind: instance method of SECPow

Param Type Description
block Object single block data
difficulty Integer difficulty value
callback function callback function

secPow.calcDifficulty(parentDiff, parentBlockNumber, parentTimeStamp, currentTimestamp) => Number

Calculate POW difficulty for next block

Kind: instance method of SECPow

Param Type Description
parentDiff Number parent block difficulty value
parentBlockNumber Integer parent block number
parentTimeStamp Integer parent block generated timestamp
currentTimestamp Integer current generated timestamp

secPow.stopMining() => None

Stop the mining operation

/@biut-block/biutjs-pow/

    Package Sidebar

    Install

    npm i @biut-block/biutjs-pow

    Weekly Downloads

    3

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    19.7 kB

    Total Files

    9

    Last publish

    Collaborators

    • abysmli
    • feiminhao
    • g277321
    • tornadoming
    • zuweihan1992