SECPow
This library is for sec blockchain pow mining and verification
new SECPow(config)
Param | Type | Description |
---|---|---|
config | Object |
JSON format configurations for constructor |
None
secPow.verifyPOW(block, callback) => Verify correctness of pow result
Kind: instance method of SECPow
Param | Type | Description |
---|---|---|
block | Object |
single block data |
callback | function |
callback function |
None
secPow.mineLight(block, difficulty, callback) => 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 |
Number
secPow.calcDifficulty(parentDiff, parentBlockNumber, parentTimeStamp, currentTimestamp) => 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 |
None
secPow.stopMining() => Stop the mining operation