jurischain-node
v1.0.0
Published
Instead of challenging the humans who are working at the terminals, it would be better to challenge the terminals themselves. It's all about balancing out the client's workload so they won't be a victim of a DDoS attack. Inspired by Blockchain technology.
Downloads
3
Maintainers
Readme
Jurischain Node
A Node extension written in C++ to use the Jurischain solution, which is a proof of work library.
TL-DR
npm install jurischain-node
import Jurischain from 'jurischain-node'
const jurischain = new Jurischain(10, 'simple-seed');
if (jurischain.challengeResponse(req['challenge-response'])) {
// grant
} else {
// deny
}
API
The Jurischain class exposes the following API:
constructor(difficult: number, seed: string)
Constructs a new Jurischain instance with the given difficult
and seed
.
challengeResponse(response: string): boolean
Challenges the response and returns a boolean indicating whether the response is correct.
readChallenge(): string
Reads the challenge and returns it as a string.
solveStep(): boolean
Solves one step of the proof of work and returns a boolean indicating whether the solution is correct.
verify(): boolean
Verifies the proof of work and returns a boolean indicating whether the verification was successful.