Home Reference Source
public class | source

NodesWaitlist

You can directly use an instance of this class. nodesWaitlist

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public
public

emitter: *

public
public

Method Summary

Public Methods
public

async addNewNodeToWaitlist(addresses: *, port: *, nodeType: *, nodeConsensusType: *, connected: *, level: *, backedBy: *, socket: *, forceInsertingWaitlist: boolean): {"result": *, "waitlist": *}

public

deleteWaitlistByConsensusNode(nodeConsensusType: *)

public

getJSONList(listType: *, fallback: *): *

public
public

isAddressFallback(address: *): boolean

public

resetWaitlist(listType: *)

Private Methods
private
private

async _deleteUselessWaitlist(listType: *): boolean

It will delete useless waitlist WEB_PEER It will delete addresses that tried way too much

private
private

_desinitializeNode(socket: *)

private

_findNodesWaitlist(address: *, port: *, listType: *): *

private

_initializeNode(socket: *)

private

_removeSocket(socket: *, list: *)

private

_searchNodesWaitlist(address: *, port: *, listType: *): {"index": *, "waitlist": *}

private

_sortList(list: *)

Public Constructors

public constructor() source

Public Members

public MAX_ERROR_TRIALS_FALLBACK: number source

public MAX_ERROR_TRIALS_SIMPLE: number source

public MAX_FULLNODE_WAITLIST_CONNECTIONS: number source

public MAX_LIGHTNODE_WAITLIST_CONNECTIONS: number source

public NodesWaitlistObject: * source

public emitter: * source

public waitListFullNodes: *[] source

public waitListLightNodes: *[] source

Public Methods

public async addNewNodeToWaitlist(addresses: *, port: *, nodeType: *, nodeConsensusType: *, connected: *, level: *, backedBy: *, socket: *, forceInsertingWaitlist: boolean): {"result": *, "waitlist": *} source

Params:

NameTypeAttributeDescription
addresses *
port *
nodeType *
nodeConsensusType *
connected *
level *
backedBy *
socket *
forceInsertingWaitlist boolean
  • optional
  • default: false

Return:

{"result": *, "waitlist": *}

public deleteWaitlistByConsensusNode(nodeConsensusType: *) source

Params:

NameTypeAttributeDescription
nodeConsensusType *

public getJSONList(listType: *, fallback: *): * source

Params:

NameTypeAttributeDescription
listType *
fallback *

Return:

*

public initializeWaitlist() source

public isAddressFallback(address: *): boolean source

Params:

NameTypeAttributeDescription
address *

Return:

boolean

public resetWaitlist(listType: *) source

Params:

NameTypeAttributeDescription
listType *

Private Methods

private async _deleteObsoleteFullNodesWaitlist() source

private async _deleteUselessWaitlist(listType: *): boolean source

It will delete useless waitlist WEB_PEER It will delete addresses that tried way too much

Params:

NameTypeAttributeDescription
listType *

Return:

boolean

private _deleteUselessWaitlists() source

private _desinitializeNode(socket: *) source

Params:

NameTypeAttributeDescription
socket *

private _findNodesWaitlist(address: *, port: *, listType: *): * source

Params:

NameTypeAttributeDescription
address *
port *
listType *

Return:

*

private _initializeNode(socket: *) source

Params:

NameTypeAttributeDescription
socket *

private _removeSocket(socket: *, list: *) source

Params:

NameTypeAttributeDescription
socket *
list *

private _searchNodesWaitlist(address: *, port: *, listType: *): {"index": *, "waitlist": *} source

Params:

NameTypeAttributeDescription
address *
port *
listType *

Return:

{"index": *, "waitlist": *}

private _sortList(list: *) source

Params:

NameTypeAttributeDescription
list *