Class: HibernatePlugin

kadence/hibernate~ HibernatePlugin

Represents a bandwidth meter which will trigger hibernation

new HibernatePlugin(node [, options])

Parameters:
Name Type Argument Description
node KademliaNode
options object <optional>
Properties
Name Type Argument Default Description
limit string <optional>
5gb The accounting max bandwidth
interval string <optional>
1d The accounting reset interval
reject Array.<string> <optional>
List of methods to reject during hibernation
Source:

Members


hibernating

Properties:
Name Type Description
hibernating boolean Indicates if our limits are reached
Source:

Methods


detect(request, response, next)

Check if hibernating when messages received
Parameters:
Name Type Description
request AbstractNode~request
response AbstractNode~response
next AbstractNode~next
Source:

meter(type)

Return a meter stream that increments the given accounting property
Parameters:
Name Type Description
type string ['inbound', 'outbound', 'unknown']
Source:
Returns:
Type
stream.Transform

start()

Starts the accounting reset timeout
Source: