Mining

Mining

class Mining(**kwargs)

Implements the mining api endpoints.

generate(block_count: int, **kwargs) → pystratis.api.mining.responsemodels.generateblocksmodel.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

A pydantic model for generated blocks.