Class: HashCashPlugin

module:kadence/hashcash~ HashCashPlugin

Requires proof of work to process messages and performs said work before issuing RPC messages to peers

new HashCashPlugin(node [, options])

Parameters:
Name Type Argument Description
node object
options object <optional>
Properties
Name Type Argument Default Description
methods Array.<string> <optional>
[] RPC methods to enforce hashcash
difficulty number <optional>
8 Leading zero bits in stamp
timeframe number <optional>
172800000 Timestamp valid window
Source:

Methods


<static> parse(header)

Parses hashcash stamp header into an object
Parameters:
Name Type Description
header string Hashcash header proof stamp
Source:
Returns:
Type
module:kadence/hashcash~HashCashPlugin~stamp

prove()

Add proof of work to outgoing message
Implements:
Source:

verify()

Verifies the proof of work on the request object
Implements:
Source:

Type Definitions


stamp

Properties:
Name Type Description
ver number Hashcash version
bits number Number of zero bits of difficulty
date number UNIX timestamp
resource string Sender and target node identities
ext string Empty string
rand string String encoded random number
counter number Base 16 counter
toString function Reserializes the parsed header
Source: