aea.helpers.multiaddr.base

This module contains multiaddress class.

MultiAddr Objects

class MultiAddr()

Protocol Labs' Multiaddress representation of a network address

__init__

 | __init__(host: str, port: int, public_key: str)

Initialize a multiaddress

Arguments:

  • host: ip host of the address
  • host: port number of the address
  • host: hex encoded public key. Must conform to Bitcoin EC encoding standard for Secp256k1

compute_peerid

 | @staticmethod
 | compute_peerid(public_key: str) -> str

Compute the peer id from a public key.

In particular, compute the base58 representation of libp2p PeerID from Bitcoin EC encoded Secp256k1 public key.

Arguments:

  • public_key: the public key.

Returns:

the peer id.

public_key

 | @property
 | public_key() -> str

Get the public key.

peer_id

 | @property
 | peer_id() -> str

Get the peer id.

format

 | format() -> str

Canonical representation of a multiaddress

__str__

 | __str__() -> str

Default string representation of a mutliaddress.