Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockTemplate

Represents a BlockTemplate received from a Daemon that can be manipulated to perform mining operations

Hierarchy

  • BlockTemplate

Index

Accessors

activateParentBlockVersion

  • get activateParentBlockVersion(): number
  • set activateParentBlockVersion(value: number): void
  • The major block version for which to activate the use of parent blocks

    Returns number

  • The major block version for which to activate the use of parent blocks

    Parameters

    • value: number

    Returns void

block

blockTemplate

  • get blockTemplate(): string
  • The original block template in hexadecimal (blob)

    Returns string

blockTemplateBuffer

  • get blockTemplateBuffer(): Buffer

difficulty

  • get difficulty(): number

height

  • get height(): number

minerNonce

  • get minerNonce(): number
  • set minerNonce(nonce: number): void
  • The extra miner nonce typically used for pool based mining

    Returns number

  • The extra miner nonce typically used for pool based mining

    Parameters

    • nonce: number

    Returns void

minerTransaction

nonce

  • get nonce(): number
  • set nonce(value: number): void

reservedOffset

  • get reservedOffset(): number

Methods

construct

  • construct(nonce: number, branch?: undefined | string): Block
  • Constructs a new "final" block that can be submitted to the network using an original the original block in the block template and the nonce value found

    Parameters

    • nonce: number

      the nonce value for the block

    • Optional branch: undefined | string

    Returns Block

    the block that can be submitted to the network

convert

  • Converts a block into a v1 hashing block typically used by miners during mining operations this method actually creates a merged mining block that merge mines itself

    Parameters

    • Optional block: Block

      the block to convert for miner hashing

    Returns Block

    the mining block

Static from

Static hashMeetsDifficulty

  • hashMeetsDifficulty(hash: string, difficulty: number): boolean
  • Whether the given hash meets the difficulty specified

    Parameters

    • hash: string

      the block POW hash

    • difficulty: number

      the target difficulty

    Returns boolean

Generated using TypeDoc