Constructors
constructor
- new SimplyBlock(index: number, timestamp: number, data: any[], previous_hash?: string): SimplyBlock
-
Parameters
-
index: number
-
timestamp: number
-
data: any[]
-
previous_hash: string = ''
Properties
_difficulty
_difficulty: number
_previous_hash
_previous_hash: string
_timestamp
_timestamp: number
Accessors
difficulty
- get difficulty(): number
- set difficulty(value: number): void
-
Returns number
-
Parameters
Returns void
nonce
- get nonce(): number
- set nonce(value: number): void
-
Returns number
-
Parameters
Returns void
previousHash
- get previousHash(): string
- set previousHash(value: string): void
-
Returns string
-
Parameters
Returns void
Methods
mineAsync
- mineAsync(): Promise<unknown>
mineSync
- mineSync(fn?: (nonce: number) => void): number
-
Parameters
-
Optional fn: (nonce: number) => void
Returns number
the nonce of the block
Create a block