aries_cloudagent.ledger package¶
Submodules¶
aries_cloudagent.ledger.base module¶
Ledger base class.
-
class
aries_cloudagent.ledger.base.BaseLedger[source]¶ Bases:
abc.ABCBase class for ledger.
-
LEDGER_TYPE= None¶
Save a new record recording the acceptance of the TAA.
Fetch the current AML and TAA from the ledger.
-
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_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 the current transaction author agreement, fetching it if necessary.
-
register_nym(did: str, verkey: str, alias: str = None, role: str = None)[source]¶ Register a nym on the ledger.
Parameters: - did – DID to register on the ledger.
- verkey – The verification key of the keypair.
- alias – Human-friendly alias to assign to the DID.
- role – For permissioned ledgers, what role should the new DID have.
-
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.LedgerErrorThe current request cannot proceed.
-
exception
aries_cloudagent.ledger.error.ClosedPoolError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerErrorIndy pool is closed.
-
exception
aries_cloudagent.ledger.error.LedgerConfigError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerErrorBase class for ledger configuration errors.
-
exception
aries_cloudagent.ledger.error.LedgerError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseErrorBase class for ledger errors.
-
exception
aries_cloudagent.ledger.error.LedgerTransactionError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerErrorThe 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:
objectTrap IndyError and raise an appropriate LedgerError instead.
-
classmethod
wrap_error(err_value: <sphinx.ext.autodoc.importer._MockObject object at 0x7ffa2fc65080>, message: str = None, error_cls: Type[aries_cloudagent.ledger.error.LedgerError] = <class 'aries_cloudagent.ledger.error.LedgerError'>) → aries_cloudagent.ledger.error.LedgerError[source]¶ Create an instance of LedgerError from an IndyError.
-
classmethod
-
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.BaseLedgerIndy ledger class.
-
LEDGER_TYPE= 'indy'¶
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.
-
credential_definition_id2schema_id(credential_definition_id)[source]¶ From a credential definition, get the identifier for its schema.
Parameters: credential_definition_id – The identifier of the credential definition from which to identify a schema
-
fetch_credential_definition(credential_definition_id: str)[source]¶ Get a credential definition from the ledger by id.
Parameters: credential_definition_id – The cred def id of the cred def to fetch
-
fetch_schema_by_id(schema_id: str)[source]¶ Get schema from ledger.
Parameters: schema_id – The schema id (or stringified sequence number) to retrieve Returns: Indy schema dict
-
fetch_schema_by_seq_no(seq_no: int)[source]¶ Fetch a schema by its sequence number.
Parameters: seq_no – schema ledger sequence number Returns: Indy schema dict
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 (or stringified sequence number) to retrieve
Get the current transaction author agreement, fetching it if necessary.
-
register_nym(did: str, verkey: str, alias: str = None, role: str = None)[source]¶ Register a nym on the ledger.
Parameters: - did – DID to register on the ledger.
- verkey – The verification key of the keypair.
- alias – Human-friendly alias to assign to the DID.
- role – For permissioned ledgers, what role should the new DID have.
-
send_credential_definition(schema_id: str, tag: str = None)[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
-
send_schema(schema_name: str, schema_version: str, attribute_names: Sequence[str])[source]¶ Send schema to ledger.
Parameters: - schema_name – The schema name
- schema_version – The schema version
- attribute_names – A list of schema attributes
-
aries_cloudagent.ledger.provider module¶
Default ledger provider classes.
-
class
aries_cloudagent.ledger.provider.LedgerProvider[source]¶ Bases:
aries_cloudagent.config.base.BaseProviderProvider for the default ledger implementation.
-
LEDGER_CLASSES= {'indy': 'aries_cloudagent.ledger.indy.IndyLedger'}¶
-