Skip to content

plugins.aea-cli-ipfs.aea_cli_ipfs.registry

Module with methods for ipfs registry.

validate_registry

def validate_registry(registry_data: LocalRegistry) -> None

Validate local registry data.

Arguments:

  • registry_data: json like object containing registry data.

write_local_registry

def write_local_registry(registry_data: LocalRegistry,
                         registry_path: str = LOCAL_REGISTRY_PATH) -> None

Write registry data to file.

Arguments:

  • registry_data: json like object containing registry data.
  • registry_path: local registry path.

load_local_registry

def load_local_registry(
        registry_path: str = LOCAL_REGISTRY_PATH) -> LocalRegistry

Returns local registry data.

get_ipfs_hash_from_public_id

def get_ipfs_hash_from_public_id(
        item_type: str,
        public_id: PublicId,
        registry_path: str = LOCAL_REGISTRY_PATH) -> Optional[str]

Get IPFS hash from local registry.

register_item_to_local_registry

def register_item_to_local_registry(
        item_type: str,
        public_id: Union[str, PublicId],
        package_hash: str,
        registry_path: str = LOCAL_REGISTRY_PATH) -> None

Add PublicId to hash mapping in the local registry.

Arguments:

  • item_type: item type.
  • public_id: public id of package.
  • package_hash: hash of package.
  • registry_path: local registry path.

fetch_ipfs

def fetch_ipfs(item_type: str,
               public_id: PublicId,
               dest: str,
               remote: bool = True) -> Optional[Path]

Fetch a package from IPFS node.