aries_cloudagent.ledger package¶
Subpackages¶
Submodules¶
aries_cloudagent.ledger.base module¶
Ledger base class.
-
class
aries_cloudagent.ledger.base.
BaseLedger
[source]¶ Bases:
abc.ABC
Base class for ledger.
-
LEDGER_TYPE
= None¶
-
get_endpoint_for_did
(did: str) → str[source]¶ Fetch the endpoint for a ledger DID.
Parameters: did – The DID to look up on the ledger or in the cache
-
aries_cloudagent.ledger.error module¶
Ledger related errors.
-
exception
aries_cloudagent.ledger.error.
BadLedgerRequestError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
The current request cannot proceed.
-
exception
aries_cloudagent.ledger.error.
ClosedPoolError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
Indy pool is closed.
-
exception
aries_cloudagent.ledger.error.
LedgerConfigError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
Base class for ledger configuration errors.
-
exception
aries_cloudagent.ledger.error.
LedgerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base class for ledger errors.
-
exception
aries_cloudagent.ledger.error.
LedgerTransactionError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
The ledger rejected the transaction.
aries_cloudagent.ledger.indy module¶
Indy ledger implementation.
-
class
aries_cloudagent.ledger.indy.
IndyErrorHandler
(message: str = None, error_cls: Type[aries_cloudagent.ledger.error.LedgerError] = <class 'aries_cloudagent.ledger.error.LedgerError'>)[source]¶ Bases:
object
Trap IndyError and raise an appropriate LedgerError instead.
-
class
aries_cloudagent.ledger.indy.
IndyLedger
(pool_name: str, wallet: aries_cloudagent.wallet.base.BaseWallet, *, keepalive: int = 0, cache: aries_cloudagent.cache.base.BaseCache = None, cache_duration: int = 600)[source]¶ Bases:
aries_cloudagent.ledger.base.BaseLedger
Indy ledger class.
-
LEDGER_TYPE
= 'indy'¶
-
TAA_ACCEPTED_RECORD_TYPE
= 'taa_accepted'¶
Save a new record recording the acceptance of the TAA.
-
check_existing_schema
(public_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) → str[source]¶ Check if a schema has already been published.
-
create_pool_config
(genesis_transactions: str, recreate: bool = False)[source]¶ Create the pool ledger configuration.
-
fetch_credential_definition
(credential_definition_id: str)[source]¶ Get a credential definition from the ledger by id.
Parameters: credential_definition_id – The schema id of the schema to fetch cred def for
-
fetch_schema
(schema_id: str)[source]¶ Get schema from ledger.
Parameters: schema_id – The schema id to retrieve
Fetch the current AML and TAA from the ledger.
-
get_credential_definition
(credential_definition_id: str)[source]¶ Get a credential definition from the cache if available, otherwise the ledger.
Parameters: credential_definition_id – The schema id of the schema to fetch cred def for
-
get_endpoint_for_did
(did: str) → str[source]¶ Fetch the endpoint for a ledger DID.
Parameters: did – The DID to look up on the ledger or in the cache
-
get_indy_storage
() → aries_cloudagent.storage.indy.IndyStorage[source]¶ Get an IndyStorage instance for the current wallet.
-
get_key_for_did
(did: str) → str[source]¶ Fetch the verkey for a ledger DID.
Parameters: did – The DID to look up on the ledger or in the cache
Look up the latest TAA acceptance.
-
get_schema
(schema_id: str)[source]¶ Get a schema from the cache if available, otherwise fetch from the ledger.
Parameters: schema_id – The schema id to retrieve
Get the current transaction author agreement, fetching it if necessary.
-
send_credential_definition
(schema_id: str, tag: str = 'default')[source]¶ Send credential definition to ledger and store relevant key matter in wallet.
Parameters: - schema_id – The schema id of the schema to create cred def for
- tag – Option tag to distinguish multiple credential definitions
-
aries_cloudagent.ledger.provider module¶
Default ledger provider classes.
-
class
aries_cloudagent.ledger.provider.
LedgerProvider
[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Provider for the default ledger implementation.
-
LEDGER_CLASSES
= {'indy': 'aries_cloudagent.ledger.indy.IndyLedger'}¶
-