GNodeInstanceGt

Python class corresponding to the GridWorks type g.node.instance.gt.000 (VersionedTypeName).

class gridworks.types.GNodeInstanceGt(*, GNodeInstanceId, GNode, Strategy, Status, SupervisorContainerId, StartTimeUnixS, EndTimeUnixS, AlgoAddress=None, TypeName='g.node.instance.gt', Version='000')

Used to send and receive updates about GNodeInstances.

One of the layers of abstraction connecting a GNode with a running app in a Docker container.

[More info](https://gridworks.readthedocs.io/en/latest/g-node-instance.html).

Parameters:
  • GNodeInstanceId (str) –

  • GNode (GNodeGt) –

  • Strategy (StrategyName) –

  • Status (GniStatus) –

  • SupervisorContainerId (str) –

  • StartTimeUnixS (int) –

  • EndTimeUnixS (int) –

  • AlgoAddress (str | None) –

  • TypeName (Literal['g.node.instance.gt']) –

  • Version (str) –

GNodeInstanceId:
  • Description: Immutable identifier for GNodeInstance (Gni)

  • Format: UuidCanonicalTextual

GNode:
  • Description: The GNode represented by the Gni

Strategy:
  • Description: Used to determine the code running in a GNode actor application

Status:
  • Description: Lifecycle Status for Gni

SupervisorContainerId:
  • Description: The Id of the docker container where the Gni runs

  • Format: UuidCanonicalTextual

StartTimeUnixS:
  • Description: When the gni starts representing the GNode. Specifically, when the Status changes from Pending to Active. Note that this is time in the GNode’s World, which may not be real time if it is a simulation.

  • Format: ReasonableUnixTimeS

EndTimeUnixS:
  • Description: When the gni stops representing the GNode. Specifically, when the Status changes from Active to Done.

AlgoAddress:
  • Description: Algorand address for Gni

  • Format: AlgoAddressStringFormat

class gridworks.types.g_node_instance_gt.check_is_reasonable_unix_time_s(v)

ReasonableUnixTimeS format: time in unix seconds between Jan 1 2000 and Jan 1 3000

Raises:

ValueError – if not ReasonableUnixTimeS format

Parameters:

v (int) –

class gridworks.types.g_node_instance_gt.check_is_uuid_canonical_textual(v)

UuidCanonicalTextual format: A string of hex words separated by hyphens of length 8-4-4-4-12.

Raises:

ValueError – if not UuidCanonicalTextual format

Parameters:

v (str) –

class gridworks.types.g_node_instance_gt.check_is_algo_address_string_format(v)

AlgoAddressStringFormat format: The public key of a private/public Ed25519 key pair, transformed into an Algorand address, by adding a 4-byte checksum to the end of the public key and then encoding in base32.

Raises:

ValueError – if not AlgoAddressStringFormat format

Parameters:

v (str) –

class gridworks.types.GNodeInstanceGt_Maker(g_node_instance_id, g_node, strategy, status, supervisor_container_id, start_time_unix_s, end_time_unix_s, algo_address)
Parameters:
  • g_node_instance_id (str) –

  • g_node (GNodeGt) –

  • strategy (StrategyName) –

  • status (GniStatus) –

  • supervisor_container_id (str) –

  • start_time_unix_s (int) –

  • end_time_unix_s (int) –

  • algo_address (str | None) –

classmethod tuple_to_type(tuple)

Given a Python class object, returns the serialized JSON type object

Parameters:

tuple (GNodeInstanceGt) –

Return type:

str

classmethod type_to_tuple(t)

Given a serialized JSON type object, returns the Python class object

Parameters:

t (str) –

Return type:

GNodeInstanceGt