Home Reference Source
public class | source

MiniBlockchain

Extends:

inheritBlockchain → MiniBlockchain

Direct Subclass:

MiniBlockchainAdvanced

Indirect Subclass:

MiniBlockchainLight

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public

Method Summary

Public Methods
public

getBalances(address: *): *

public

async includeBlockchainBlock(block: *, resetMining: *, socketsAvoidBroadcast: *): Promise<*>

operate the mini-blockchain accountant tree mini-blockchain, will update reward and take in consideration all transactions

public

async simulateNewBlock(block: *, revertAutomatically: *, revertActions: *, callback: *, showUpdate: boolean): boolean

Private Methods
private
private

async _loadBlockchain(): *

Load blocks and check the Accountant Tree

Public Constructors

public constructor() source

Public Members

public accountantTree: * source

public blockCreator: * source

public inheritBlockchain: * source

public transactions: * source

Public Methods

public getBalances(address: *): * source

Params:

NameTypeAttributeDescription
address *

Return:

*

public async includeBlockchainBlock(block: *, resetMining: *, socketsAvoidBroadcast: *): Promise<*> source

operate the mini-blockchain accountant tree mini-blockchain, will update reward and take in consideration all transactions

Params:

NameTypeAttributeDescription
block *
resetMining *
socketsAvoidBroadcast *

Return:

Promise<*>

public async simulateNewBlock(block: *, revertAutomatically: *, revertActions: *, callback: *, showUpdate: boolean): boolean source

Params:

NameTypeAttributeDescription
block *
revertAutomatically *
revertActions *
callback *
showUpdate boolean
  • optional
  • default: true

Return:

boolean

Private Methods

private _createBlockchainElements() source

private async _loadBlockchain(): * source

Load blocks and check the Accountant Tree

Return:

*

boolean