Class: SpartacusPlugin

module:kadence/spartacus~ SpartacusPlugin

Implements the spartacus decorations to the node object

new SpartacusPlugin(node [, privateKey] [, options])

Creates the plugin instance given a node and optional identity
Parameters:
Name Type Argument Default Description
node KademliaNode
privateKey buffer <optional>
SECP256K1 private key
options object <optional>
{}
Properties
Name Type Argument Default Description
checkPublicKeyHash boolean <optional>
true
Source:

Methods


deserialize()

Parses and verifies the signature payload, then passes through to the JsonRpcDeserializer if successful
Implements:
Source:

serialize()

Processes with JsonRpcSerializer then signs the result and appends an additional payload containing signature+identity information
Implements:
Source:

setValidationPeriod(period)

Sets the validation period for nodes
Parameters:
Name Type Description
period number Milliseconds to honor a proven contact response
Source:

validate(node, request, response, next)

Checks if the sender is addressable at the claimed contact information and cross checks signatures between the original sender and the node addressed. This is intended to prevent reflection attacks and general DDoS via spam.
Parameters:
Name Type Description
node KademliaNode
request AbstractNode~request
response AbstractNode~response
next AbstractNode~next
Source: