Skip to content


This module contains the behaviours, round and payloads for the 'abstract_round_abci' skill.


def random_selection(elements: List[Any], randomness: float) -> str

Select a random element from a list.

:param: elements: a list of elements to choose among :param: randomness: a random number in the [0,1) interval :return: a randomly chosen element

RandomnessBehaviour Objects

class RandomnessBehaviour(BaseBehaviour, ABC)

Check whether Tendermint nodes are running.


def failsafe_randomness() -> Generator[None, None, RandomnessObservation]

This methods provides a failsafe for randomness retrieval.


derived randomness


def get_randomness_from_api() -> Generator[None, None, RandomnessObservation]

Retrieve randomness from given api specs.


def async_act() -> Generator

Retrieve randomness from API.

Steps: - Do a http request to the API. - Retry until receiving valid values for randomness or retries exceed. - If retrieved values are valid continue else generate randomness from chain.


def clean_up() -> None

Clean up the resources due to a 'stop' event.

It can be optionally implemented by the concrete classes.

SelectKeeperBehaviour Objects

class SelectKeeperBehaviour(BaseBehaviour, ABC)

Select the keeper agent.


def async_act() -> Generator

Do the action.

Steps: - Select a keeper randomly. - Send the transaction with the keeper and wait for it to be mined. - Wait until ABCI application transitions to the next round. - Go to the next behaviour state (set done event).