Global

Members

DIFFICULTY :number

Difficulty of the problem solving algorithm
Type:
  • number
Source:

(constant) server :Server

Creates a signaling server which provides the data about peers connected to blockchain
Type:
  • Server
Source:

Methods

clearList()

Clear peer list
Source:

decodeNetworkMapData(buffer) → {Map.<string, (string|int)>}

It returns Map instance with information about others users in pool
Parameters:
Name Type Description
buffer
Source:
Returns:
Type
Map.<string, (string|int)>

generateProof(prevProof) → {Object|*}

This function generates proof for block. Its used in mining process
Parameters:
Name Type Description
prevProof
Source:
Returns:
Type
Object | *

isProofValid(prevProof, currentProof) → {boolean}

This functions checks for valid solution. If current hash starts with DIFFICULTY amount of '0' returns true, otherwise return false
Parameters:
Name Type Description
prevProof
currentProof
Source:
Returns:
Type
boolean

peers() → {Array}

Return the list of connected peers
Source:
Returns:
Type
Array

prepareNetworkMapData(data) → {Buffer}

It prepares Map object to be sent via socket
Parameters:
Name Type Description
data
Source:
Returns:
Type
Buffer

prepareSYN(blockChain) → {Array}

This function prepares data to be Synchronized
Parameters:
Name Type Description
blockChain
Source:
Returns:
Type
Array

start(port, address)

Starts the signaling server
Parameters:
Name Type Description
port
address
Source: