JoinDispatchContract

Python pydantic class corresponding to json type `join.dispatch.contract`.

class gwatn.types.JoinDispatchContract(*, FromGNodeAlias, FromGNodeInstanceId, DispatchContractAppId, SignedProof, TypeName='join.dispatch.contract', Version='000')

Sent from a Scada to its paired AtomicTNode on RabbitMQ.

This is sent as an invitation to join the DispatchContract. Upon receipt of this, the AtomicTNode can check that the DispatchContract has finished the first part of its bootstrapping. This means it is well-funded, and also has the Scada Cert Id and the Scada Addr publicly available. The AtomicTNode can check these against the signature provided by the SCADA in its invitation. An AtomicTNode actor accepts the invitation by finishing the Dispatch Contract bootstrap (which it can only do if its Algorand Account holds the associated TaTradingRights certificate) and then responding to the SCADA via RabbitMQ with a dispatch.contract.confirmed payload.

https://gridworks.readthedocs.io/en/latest/dispatch-contract.html

Parameters:
  • FromGNodeAlias (str) –

  • FromGNodeInstanceId (str) –

  • DispatchContractAppId (int) –

  • SignedProof (str) –

  • TypeName (Literal['join.dispatch.contract']) –

  • Version (str) –

classmethod check_axiom_0(v)

Axiom 0: ScadaCert matches FromGNodeAlias. The name in the ScadaCert should be the GNodeAlias of the TerminalAsset corresponding to the sending SCADA. Therefore, FromGNodeAlias should be equal to the name of the ScadaCert ASA with .scada appended.

Parameters:

v (dict) –

Return type:

dict

FromGNodeAlias:
  • Description:

  • Format: LeftRightDot

FromGNodeInstanceId:
  • Description:

  • Format: UuidCanonicalTextual

DispatchContractAppId:
  • Description:

SignedProof:
  • Description:

  • Format: AlgoMsgPackEncoded

class gwatn.types.join_dispatch_contract.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 gwatn.types.join_dispatch_contract.check_is_left_right_dot(v)

LeftRightDot format: Lowercase alphanumeric words separated by periods, most significant word (on the left) starting with an alphabet character.

Raises:

ValueError – if not LeftRightDot format

Parameters:

v (str) –

class gwatn.types.join_dispatch_contract.check_is_algo_msg_pack_encoded(v)

AlgoMSgPackEncoded format: the format of an transaction sent to the Algorand blockchain.

Raises:

ValueError – if not AlgoMSgPackEncoded format

Parameters:

v (str) –

class gwatn.types.JoinDispatchContract_Maker(from_g_node_alias, from_g_node_instance_id, dispatch_contract_app_id, signed_proof)
Parameters:
  • from_g_node_alias (str) –

  • from_g_node_instance_id (str) –

  • dispatch_contract_app_id (int) –

  • signed_proof (str) –

classmethod tuple_to_type(tuple)

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

Parameters:

tuple (JoinDispatchContract) –

Return type:

str

classmethod type_to_tuple(t)

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

Parameters:

t (str) –

Return type:

JoinDispatchContract