Function
Static Public Summary | ||
public |
BlockError(text: *) |
|
public |
MinerWarning(text: *) |
|
public |
allowFailureUntillEnough(amount: number) allow retry upto "amount" times |
|
public |
block(transactions: *, lastBlock: *, address: *): index, prevHash, time, transactions, nonce Create new block |
|
public |
blockDifficulty(hash: *): number Get hash difficulty from block |
|
public |
calculateBlockHash(block: object): * Generate block hash |
|
public |
async calculateHash(block: *): * |
|
public |
clientResponse(objectPattern: {"type": *, "name": *, "data": *}, encoding: string): * |
|
public |
connect(addresses: *[]) |
|
public |
async connectBootstrap(addresses: *) |
|
public |
controller(ipfs: *) |
|
public |
async core(objectPattern: {"genesis": *}) |
|
public |
async corerequests(objectPattern: {"type": *, "name": *, "params": *}): * |
|
public |
createDAGNode(objectPattern: {"index": *, "prevHash": *, "time": *, "transactions": *, "nonce": *}): * |
|
public |
createNewAddress(name: *) |
|
public |
createRewardTransaction(address: string): id: string, reward: boolean, inputs: *, outputs: *, hash: string Create reward transaction for block mining |
|
public |
debug(text: *) |
|
public |
difficulty(): * |
|
public |
difficulty(hash: *): number Get hash difficulty |
|
public |
fail(text: *) |
|
public |
Create genesis block |
|
public |
getBalanceForAddress(address: *): * |
|
public |
getDifficulty(hash: *): Number Get hash difficulty |
|
public |
getTransactions(withMempool: boolean): * |
|
public |
getTransactionsForAddress(address: *): * |
|
public |
getUnspent(withMempool: boolean): * |
|
public |
getUnspentForAddress(address: *): * |
|
public |
groupCollapsed(text: *, cb: *) |
|
public |
hashLog(nonce: *): * |
|
public |
hashes(nonce: *): * |
|
public |
hexFromMultihash(multihash: *): * |
|
public |
id() |
|
public |
|
|
public |
ipfskeepalive(published: *, ipfs: *, cb: *) |
|
public |
ipfsstar(): {"stop": *, "peers": *} |
|
public |
async lastBlock(): * |
|
public |
async localDAGMultiaddress(): * |
|
public |
log(text: *) |
|
public |
|
|
public |
median(array: *): * |
|
public |
multihashFromHex(hex: *): * |
|
public |
net(): * |
|
public |
async networkAddress(net: *): * |
|
public |
async newGenesisDAGNode(difficulty: *): * Create a new genesis block |
|
public |
async newGenesisDAGNode(difficulty: *): * Create a new genesis block |
|
public |
|
|
public |
async nextBlock(address: *): * |
|
public |
Get the transactions for the next Block |
|
public |
|
|
public |
socketserver(httpServer: *) |
|
public |
succes(text: *) |
|
public |
async textlog(text: *) |
|
public |
|
|
public |
transactionHash(transaction: object): * Generate transaction hash |
|
public |
transactionInputHash(transactionInput: object): * Generate transaction input hash |
|
public |
transformBlock(objectPattern: {"multihash": *, "data": *}): * |
|
public |
validate block |
|
public |
validateBlock(previousBlock: object, block: object, difficulty: number, unspent: number): * validate block |
|
public |
validateTransaction(transaction: *, unspent: *): boolean validate transaction |
|
public |
validateTransactions(transactions: array, unspent: *) validate transactions list for current block |
Static Public
public BlockError(text: *) source
import {BlockError} from 'leofcoin-core/src/lib/errors.js'
Params:
Name | Type | Attribute | Description |
text | * |
public MinerWarning(text: *) source
import {MinerWarning} from 'leofcoin-core/src/lib/errors.js'
Params:
Name | Type | Attribute | Description |
text | * |
public allowFailureUntillEnough(amount: number) source
import {allowFailureUntillEnough} from 'leofcoin-core/src/utils.js'
allow retry upto "amount" times
Params:
Name | Type | Attribute | Description |
amount | number |
public block(transactions: *, lastBlock: *, address: *): index, prevHash, time, transactions, nonce source
import {block} from 'leofcoin-core/src/lib/ccp-block.js'
Create new block
Params:
Name | Type | Attribute | Description |
transactions | * | {array} |
|
lastBlock | * | {object} |
|
address | * | {string} |
Return:
index, prevHash, time, transactions, nonce |
public blockDifficulty(hash: *): number source
import {blockDifficulty} from 'leofcoin-core/src/lib/ccp-block.js'
Get hash difficulty from block
Params:
Name | Type | Attribute | Description |
hash | * |
public calculateBlockHash(block: object): * source
import {calculateBlockHash} from 'leofcoin-core/src/lib/hash.js'
Generate block hash
Params:
Name | Type | Attribute | Description |
block | object | {index, prevHash, time, transactions, nonce} |
Return:
* |
public async calculateHash(block: *): * source
import {calculateHash} from 'leofcoin-core/src/lib/dagchain/dagblock.js'
Params:
Name | Type | Attribute | Description |
block | * |
Return:
* |
public clientResponse(objectPattern: {"type": *, "name": *, "data": *}, encoding: string): * source
import {clientResponse} from 'leofcoin-core/src/server/socket-server.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"type": *, "name": *, "data": *} |
|
|
encoding | string |
|
Return:
* |
public connect(addresses: *[]) source
import {connect} from 'leofcoin-core/src/lib/network/peernet.js'
Params:
Name | Type | Attribute | Description |
addresses | *[] |
|
public async connectBootstrap(addresses: *) source
import {connectBootstrap} from 'leofcoin-core/src/lib/network/peernet.js'
Params:
Name | Type | Attribute | Description |
addresses | * |
public controller(ipfs: *) source
import controller from 'leofcoin-core/src/controller.js'
Params:
Name | Type | Attribute | Description |
ipfs | * |
public async core(objectPattern: {"genesis": *}) source
import {core} from 'leofcoin-core/src/core.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"genesis": *} |
|
public async corerequests(objectPattern: {"type": *, "name": *, "params": *}): * source
import corerequests from 'leofcoin-core/src/server/core-requests.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"type": *, "name": *, "params": *} |
|
Return:
* |
public createDAGNode(objectPattern: {"index": *, "prevHash": *, "time": *, "transactions": *, "nonce": *}): * source
import {createDAGNode} from 'leofcoin-core/src/lib/dagchain/dagblock.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"index": *, "prevHash": *, "time": *, "transactions": *, "nonce": *} |
|
Return:
* |
public createNewAddress(name: *) source
import {createNewAddress} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
name | * |
|
public createRewardTransaction(address: string): id: string, reward: boolean, inputs: *, outputs: *, hash: string source
import {createRewardTransaction} from 'leofcoin-core/src/lib/transaction.js'
Create reward transaction for block mining
Params:
Name | Type | Attribute | Description |
address | string |
Return:
id: string, reward: boolean, inputs: *, outputs: *, hash: string |
public debug(text: *) source
import {debug} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
text | * |
public difficulty(): * source
import {difficulty} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Return:
* |
public difficulty(hash: *): number source
import {difficulty} from 'leofcoin-core/src/lib/ccp-block.js'
Get hash difficulty
Params:
Name | Type | Attribute | Description |
hash | * |
public fail(text: *) source
import {fail} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
text | * |
public genesisBlock(): object source
import {genesisBlock} from 'leofcoin-core/src/lib/ccp-block.js'
Create genesis block
public getBalanceForAddress(address: *): * source
import {getBalanceForAddress} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
address | * |
Return:
* |
public getDifficulty(hash: *): Number source
import {getDifficulty} from 'leofcoin-core/src/utils.js'
Get hash difficulty
Params:
Name | Type | Attribute | Description |
hash | * |
public getTransactions(withMempool: boolean): * source
import {getTransactions} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
withMempool | boolean |
|
Return:
* |
public getTransactionsForAddress(address: *): * source
import {getTransactionsForAddress} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
address | * |
Return:
* |
public getUnspent(withMempool: boolean): * source
import {getUnspent} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
withMempool | boolean |
|
Return:
* |
public getUnspentForAddress(address: *): * source
import {getUnspentForAddress} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
address | * |
Return:
* |
public groupCollapsed(text: *, cb: *) source
import {groupCollapsed} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
text | * | ||
cb | * |
public hashLog(nonce: *): * source
import {hashLog} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
nonce | * |
Return:
* |
public hashes(nonce: *): * source
import {hashes} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
nonce | * |
Return:
* |
public hexFromMultihash(multihash: *): * source
import {hexFromMultihash} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
multihash | * |
Return:
* |
public interval(cb: *, ms: number) source
import {interval} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
cb | * | ||
ms | number |
|
public ipfskeepalive(published: *, ipfs: *, cb: *) source
import ipfskeepalive from 'leofcoin-core/src/ipfs-keep-alive.js'
Params:
Name | Type | Attribute | Description |
published | * | ||
ipfs | * | ||
cb | * |
public ipfsstar(): {"stop": *, "peers": *} source
import ipfsstar from 'leofcoin-core/src/lib/network/ipfs-star.js'
Params:
Name | Type | Attribute | Description |
options.subscribe | method | pubsub subscriber |
|
options.publish | method | pubsub publisher |
Return:
{"stop": *, "peers": *} |
public async lastBlock(): * source
import {lastBlock} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Return:
* |
public async localDAGMultiaddress(): * source
import {localDAGMultiaddress} from 'leofcoin-core/src/params.js'
Return:
* |
public log(text: *) source
import {log} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
text | * |
public longestChain() source
import {longestChain} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
public median(array: *): * source
import {median} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
array | * |
Return:
* |
public multihashFromHex(hex: *): * source
import {multihashFromHex} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
hex | * |
Return:
* |
public async networkAddress(net: *): * source
import {networkAddress} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
net | * |
Return:
* |
public async newGenesisDAGNode(difficulty: *): * source
import {newGenesisDAGNode} from 'leofcoin-core/src/lib/dagchain/genesis.js'
Create a new genesis block
Params:
Name | Type | Attribute | Description |
difficulty | * |
Return:
* |
public async newGenesisDAGNode(difficulty: *): * source
import {newGenesisDAGNode} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Create a new genesis block
Params:
Name | Type | Attribute | Description |
difficulty | * |
Return:
* |
public newWallet(name: string) source
import {newWallet} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
name | string |
|
public async nextBlock(address: *): * source
import {nextBlock} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
address | * |
Return:
* |
public nextBlockTransactions(): object source
import {nextBlockTransactions} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Get the transactions for the next Block
public socketserver(httpServer: *) source
import socketserver from 'leofcoin-core/src/server/socket-server.js'
Params:
Name | Type | Attribute | Description |
httpServer | * |
public succes(text: *) source
import {succes} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
text | * |
public async textlog(text: *) source
import {textlog} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
text | * |
public timeout(ms: number, cb: *) source
import {timeout} from 'leofcoin-core/src/utils.js'
Params:
Name | Type | Attribute | Description |
ms | number |
|
|
cb | * |
public transactionHash(transaction: object): * source
import {transactionHash} from 'leofcoin-core/src/lib/hash.js'
Generate transaction hash
Params:
Name | Type | Attribute | Description |
transaction | object | {id, type, inputs, outputs} |
Return:
* |
public transactionInputHash(transactionInput: object): * source
import {transactionInputHash} from 'leofcoin-core/src/lib/hash.js'
Generate transaction input hash
Params:
Name | Type | Attribute | Description |
transactionInput | object | {transaction, index, amount, address} |
Return:
* |
public transformBlock(objectPattern: {"multihash": *, "data": *}): * source
import {transformBlock} from 'leofcoin-core/src/lib/dagchain/dagchain-interface.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"multihash": *, "data": *} |
|
Return:
* |
public async validate(previousBlock: object, block: object, difficulty: number, unspent: number): * source
import {validate} from 'leofcoin-core/src/lib/dagchain/dagblock.js'
validate block
Return:
* |
public validateBlock(previousBlock: object, block: object, difficulty: number, unspent: number): * source
import {validateBlock} from 'leofcoin-core/src/lib/ccp-block.js'
validate block
Return:
* |
public validateTransaction(transaction: *, unspent: *): boolean source
import {validateTransaction} from 'leofcoin-core/src/lib/transaction.js'
validate transaction
Params:
Name | Type | Attribute | Description |
transaction | * | ||
unspent | * |
public validateTransactions(transactions: array, unspent: *) source
import {validateTransactions} from 'leofcoin-core/src/lib/transaction.js'
validate transactions list for current block
Params:
Name | Type | Attribute | Description |
transactions | array | ||
unspent | * |