Mining

Mining

class Mining(**kwargs)

Implements the mining api endpoints.

generate(block_count: int, **kwargs) GenerateBlocksModel

Generate blocks by mining.

Parameters:
  • block_count (int) – The number of blocks to mine.

  • **kwargs – Extra keyword arguments.

Returns:

A list of generated blocks.

Return type:

GenerateBlocksModel

Raises:

APIError – Error thrown by node API. See message for details.

stop_mining(**kwargs) None

Stop mining.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

GenerateBlocksModel

class GenerateBlocksModel(*, blocks: List[uint256])

A pydantic model for generated blocks.

blocks: List[uint256]

A list of hashes of generated blocks.