1.0.14 • Published 5 years ago

@sec-block/secjs-pow v1.0.14

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

JavaScript Style Guide

[JavaScript Style Guide]

SECPow

This library is for sec blockchain pow mining and verification

new SECPow(config)

ParamTypeDescription
configObjectJSON format configurations for constructor

secPow.verifyPOW(block, callback) => None

Verify correctness of pow result

Kind: instance method of SECPow

ParamTypeDescription
blockObjectsingle block data
callbackfunctioncallback function

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

Light client mining function

Kind: instance method of SECPow

ParamTypeDescription
blockObjectsingle block data
difficultyIntegerdifficulty value
callbackfunctioncallback function

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

Calculate POW difficulty for next block

Kind: instance method of SECPow

ParamTypeDescription
parentDiffNumberparent block difficulty value
parentBlockNumberIntegerparent block number
parentTimeStampIntegerparent block generated timestamp
currentTimestampIntegercurrent generated timestamp

secPow.stopMining() => None

Stop the mining operation

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago