Consensus

Consensus

class Consensus(**kwargs)

Implements the consensus api endpoints.

deployment_flags(**kwargs) List[DeploymentFlagsModel]

Get the active deployment flags.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

A list of active deployment flags..

Return type:

List[DeploymentFlagsModel]

Raises:

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

get_best_blockhash(**kwargs) uint256

Gets the best block hash.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

The block hash.

Return type:

uint256

Raises:

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

get_blockhash(height: int, **kwargs) uint256

Gets the block hash at the specified block

Parameters:
  • height (int) – The requested height for block hash retrieval.

  • **kwargs – Extra keyword arguments.

Returns:

The block hash.

Return type:

uint256

Raises:

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

DeploymentFlagsModel

class DeploymentFlagsModel(*, deploymentName: str, deploymentIndex: int, stateValue: int, thresholdState: str, height: int, sinceHeight: int, confirmationPeriod: int, periodStartHeight: int, periodEndHeight: int, votes: int, blocks: int, versions: dict, threshold: int, timeStart: str, timeTimeOut: str)

A pydantic model representing deployment flags.

deployment_name: str

The deployment flag name.

deployment_index: int

The deployment index.

state_value: int

The deployment flag state value.

threshold_state: str

The deployment flag threshold state.

height: int

The block height.

since_height: int

The flag’s activation height.

confirmation_period: int

The confirmation period size.

period_start_height: int

The activation period start height.

period_end_height: int

The activation period ending height.

votes: int

The number of votes.

blocks: int

Blocks.

versions: dict

Versions.

threshold: int

The threshold.

time_start: str

The start time.

time_time_out: str

The timeout time.