Class: SpartacusPlugin

kadence/spartacus~ SpartacusPlugin

Implements the spartacus decorations to the node object

new SpartacusPlugin(node [, privateExtendedKey] [, derivationIndex] [, derivationPath])

Creates the plugin instance given a node and optional identity
Parameters:
Name Type Argument Description
node KademliaNode
privateExtendedKey buffer <optional>
HD extended private key
derivationIndex number <optional>
Child key derivation index
derivationPath string <optional>
Child key derivation path
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: