MultiHostNameRelay

class cometa.pool_params.multi_host_name_relay.MultiHostNameRelay(ptr)[source]

Bases: object

Represents a multi-host name relay for Cardano stake pools.

This relay type points to a DNS SRV record that can resolve to multiple IP addresses, facilitating load balancing and failover for stake pool relays.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

MultiHostNameRelay

__exit__(exc_type, exc_val, exc_tb)[source]
Return type:

None

__repr__()[source]

Return repr(self).

Return type:

str

__str__()[source]

Return str(self).

Return type:

str

classmethod new(dns)[source]

Creates a new multi-host name relay.

Parameters:

dns (str) – The DNS SRV hostname (e.g., “_cardano._tcp.example.com”).

Returns:

A new MultiHostNameRelay instance.

Raises:

CardanoError – If creation fails.

Return type:

MultiHostNameRelay

Example

>>> relay = MultiHostNameRelay.new("relay.example.com")
classmethod from_cbor(reader)[source]

Deserializes a MultiHostNameRelay from CBOR data.

Parameters:

reader (CborReader) – A CborReader positioned at the relay data.

Returns:

A new MultiHostNameRelay deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

MultiHostNameRelay

to_cbor(writer)[source]

Serializes the relay to CBOR format.

Parameters:

writer (CborWriter) – A CborWriter to write the serialized data to.

Raises:

CardanoError – If serialization fails.

Return type:

None

property dns: str

Returns the DNS hostname.

to_cip116_json(writer)[source]

Serializes this relay to CIP-116 compliant JSON.

Parameters:

writer (JsonWriter) – The JsonWriter to write the JSON to.

Raises:

CardanoError – If serialization fails.

Return type:

None