Module: lib/blockchains/common

Module for common blockchain functions

Source:

Methods

(inner) createSignature(payload, privateKeyType, signKeyType, signAlgorithm)

Creates a JSON Web Signature (JWS) with a private blockchain key

Parameters:
Name Type Description
payload Object

the payload to be signed

privateKeyType string

the hexadecimal private blockchain key

signKeyType string

the type of privatye blockchain key

signAlgorithm string

the siging algorithm

Source:

(inner) determineStartingBlock(highestBlock, currentBlock, startingBlock, rewindBlocks) → {number}

Determines the starting block for a blockchain listener

Parameters:
Name Type Description
highestBlock number

the highest known block of the blockchain

currentBlock number

the block currently being the latest processed

startingBlock number

the block where the listener should start

rewindBlocks number

the number of blocks to look back from highest block

Source:
Returns:

the starting block

Type
number

(inner) getEmptyState() → {Object}

Returns an empty blockchain state

Source:
Returns:

An empty blockchain state

Type
Object

(inner) logStartingBlock(blockCursor, highestBlock)

Logs where the listener will start next

Parameters:
Name Type Description
blockCursor number

block pointer

highestBlock number

the highest known block

Source: