From 991a4c11dfb96fb101db622f1d8b126f5671dc92 Mon Sep 17 00:00:00 2001 From: Shaanjot Gill Date: Tue, 5 Sep 2023 20:39:58 +0530 Subject: [PATCH 1/8] single issuer flag, multiple endorser and ledgers, ACA-Py 0.10.1 release related changes Signed-off-by: Shaanjot Gill --- .../traction_innkeeper/__init__.py | 21 ++ .../v1_0/creddef_storage/models.py | 13 ++ .../v1_0/endorser/routes.py | 12 +- .../v1_0/innkeeper/config.py | 2 + .../v1_0/innkeeper/models.py | 19 +- .../v1_0/innkeeper/routes.py | 62 ++++- .../v1_0/innkeeper/tenant_manager.py | 17 +- .../v1_0/innkeeper/utils.py | 9 + .../traction_innkeeper/v1_0/oca/models.py | 10 + .../traction_innkeeper/v1_0/oca/routes.py | 10 + .../v1_0/schema_storage/models.py | 5 + .../traction_innkeeper/v1_0/tenant/routes.py | 36 ++- scripts/.env-example | 1 + scripts/docker-compose.yml | 5 +- scripts/multi-ledger-config.yml | 12 + scripts/plugin-config.yml | 12 +- .../components/innkeeper/tenants/Tenants.vue | 1 + .../tenants/editConfig/editConfigForm.vue | 108 +++++---- .../components/profile/issuance/Endorser.vue | 215 +++++++++++++++--- .../components/profile/issuance/PublicDid.vue | 155 +++++++++---- .../frontend/src/helpers/constants.ts | 5 + .../frontend/src/plugins/i18n/locales/en.json | 3 + .../store/innkeeper/innkeeperTenantsStore.ts | 13 ++ .../frontend/src/store/tenantStore.ts | 91 +++++++- .../src/types/acapyApi/acapyInterface.ts | 5 + .../api/responses/innkeeper/tenant.ts | 2 + .../test/__mocks__/api/responses/tenant.ts | 1 + .../test/__mocks__/store/innkeeper/tenants.ts | 1 + .../frontend/test/store/tenantStore.test.ts | 9 + 29 files changed, 708 insertions(+), 147 deletions(-) create mode 100644 scripts/multi-ledger-config.yml diff --git a/plugins/traction_innkeeper/traction_innkeeper/__init__.py b/plugins/traction_innkeeper/traction_innkeeper/__init__.py index e69de29bb..2c4db4aec 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/__init__.py +++ b/plugins/traction_innkeeper/traction_innkeeper/__init__.py @@ -0,0 +1,21 @@ +from aries_cloudagent.messaging.valid import ( + INDY_SCHEMA_ID_VALIDATE, + INDY_SCHEMA_ID_EXAMPLE, + INDY_REV_REG_SIZE_VALIDATE, + INDY_REV_REG_SIZE_EXAMPLE, + INDY_CRED_DEF_ID_VALIDATE, + INDY_CRED_DEF_ID_EXAMPLE, +) + +INDY_SCHEMA_ID = { + "validate": INDY_SCHEMA_ID_VALIDATE, + "example": INDY_SCHEMA_ID_EXAMPLE, +} +INDY_REV_REG_SIZE = { + "validate": INDY_REV_REG_SIZE_VALIDATE, + "example": INDY_REV_REG_SIZE_EXAMPLE, +} +INDY_CRED_DEF_ID = { + "validate": INDY_CRED_DEF_ID_VALIDATE, + "example": INDY_CRED_DEF_ID_EXAMPLE, +} diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/creddef_storage/models.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/creddef_storage/models.py index 60d1d4052..05a317369 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/creddef_storage/models.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/creddef_storage/models.py @@ -11,6 +11,19 @@ ) from marshmallow import EXCLUDE, fields +try: + from aries_cloudagent.messaging.valid import ( + INDY_SCHEMA_ID, + INDY_REV_REG_SIZE, + INDY_CRED_DEF_ID, + ) +except ImportError: + from ... import ( + INDY_SCHEMA_ID, + INDY_REV_REG_SIZE, + INDY_CRED_DEF_ID, + ) + class CredDefStorageRecord(BaseRecord): """Traction CredDef Storage Record.""" diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/endorser/routes.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/endorser/routes.py index 0a1ba314c..6e070ef43 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/endorser/routes.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/endorser/routes.py @@ -2,7 +2,7 @@ import logging from aiohttp import web -from aiohttp_apispec import docs, response_schema +from aiohttp_apispec import docs, response_schema, request_schema from aries_cloudagent.admin.request_context import AdminRequestContext from aries_cloudagent.connections.models.conn_record import ConnRecordSchema from aries_cloudagent.messaging.models.base import BaseModelError @@ -41,6 +41,15 @@ async def wrapper(request): return wrapper +# class EndorserLedgerRequestSchema(OpenAPISchema): +# """Request schema for endorser/ledger configuration.""" + +# ledger_id = fields.Str( +# required=True, +# description="Ledger identifier", +# ) + + class EndorserInfoResponseSchema(OpenAPISchema): """Response schema for endorser information/configuration.""" @@ -56,6 +65,7 @@ class EndorserInfoResponseSchema(OpenAPISchema): @docs(tags=[SWAGGER_CATEGORY], summary="Set connection with configured endorser") +# @request_schema(EndorserLedgerRequestSchema) @response_schema(ConnRecordSchema(), 200, description="") @error_handler async def endorser_connection_set(request: web.BaseRequest): diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/config.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/config.py index 350df4a28..05a01ee12 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/config.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/config.py @@ -37,6 +37,7 @@ class InnkeeperWalletConfig(BaseModel): print_token: bool = False connect_to_endorser: List[EndorserLedgerConfig] = [] create_public_did: List[str] = [] + enable_ledger_switch: bool = False class Config: alias_generator = _alias_generator @@ -51,6 +52,7 @@ def default(cls): wallet_name="traction_innkeeper_v1_0", print_key=False, print_token=False, + enable_ledger_switch=False, connect_to_endorser=[], create_public_did=[], ) diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/models.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/models.py index 439d95172..665f31c6b 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/models.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/models.py @@ -257,9 +257,11 @@ def __init__( state: str = None, tenant_name: str = None, wallet_id: str = None, + curr_ledger_id: str = None, connected_to_endorsers: List = [], created_public_did: List = [], auto_issuer: bool = False, + enable_ledger_switch=False, **kwargs, ): """Construct record.""" @@ -273,6 +275,8 @@ def __init__( self.connected_to_endorsers = connected_to_endorsers self.created_public_did = created_public_did self.auto_issuer = auto_issuer + self.enable_ledger_switch = enable_ledger_switch + self.curr_ledger_id = curr_ledger_id @property def tenant_id(self) -> Optional[str]: @@ -290,6 +294,8 @@ def record_value(self) -> dict: "connected_to_endorsers", "created_public_did", "auto_issuer", + "enable_ledger_switch", + "curr_ledger_id", ) } @@ -380,6 +386,17 @@ class Meta: default=False, ) + enable_ledger_switch = fields.Bool( + required=False, + description="True if tenant can switch endorser/ledger", + default=False, + ) + + curr_ledger_id = fields.Str( + required=False, + description="Current ledger identifier", + ) + class TenantAuthenticationApiRecord(BaseRecord): """Innkeeper Tenant Authentication - API Record Schema""" @@ -434,7 +451,7 @@ async def retrieve_by_auth_api_id( session, tenant_authentication_api_id, for_update=for_update ) return record - + @classmethod async def query_by_tenant_id( cls, diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py index 0609b128b..1123db413 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py @@ -20,9 +20,11 @@ from marshmallow import fields from . import TenantManager +from .config import InnkeeperWalletConfig from .utils import ( approve_reservation, create_api_key, + EndorserLedgerConfigSchema, ReservationException, TenantApiKeyException, TenantConfigSchema, @@ -90,6 +92,22 @@ async def wrapper(request): return wrapper +class DefaultConfigValuesSchema(OpenAPISchema): + """Response schema for default config values.""" + + connected_to_endorsers = fields.List( + fields.Nested(EndorserLedgerConfigSchema()), + description="Endorser config", + ) + created_public_did = fields.List( + fields.Str( + description="Ledger identifier", + required=False, + ), + description="Public DID config", + ) + + class ReservationRequestSchema(OpenAPISchema): """Request schema for tenant reservation.""" @@ -430,15 +448,19 @@ async def tenant_create_token(request: web.BaseRequest): # If neither wallet_key or api_key provided raise an error if not wallet_key and not api_key: raise web.HTTPUnauthorized(reason="Wallet Key or API Key not provided") - + # If both wallet_key and api_key provided raise an error if wallet_key and api_key: - raise web.HTTPUnprocessableEntity(reason="Wallet Key and API Key cannot be provided together") + raise web.HTTPUnprocessableEntity( + reason="Wallet Key and API Key cannot be provided together" + ) # if an API key is provided verify it is valid - if api_key: + if api_key: async with profile.session() as session: - tenant_keys = await TenantAuthenticationApiRecord.query_by_tenant_id(session, tenant_id) + tenant_keys = await TenantAuthenticationApiRecord.query_by_tenant_id( + session, tenant_id + ) LOGGER.warning(f"tenant_keys = {tenant_keys}") # if no keys found raise an error if not tenant_keys: @@ -484,6 +506,27 @@ async def innkeeper_tenant_reservation(request: web.BaseRequest): return res +@docs( + tags=[SWAGGER_CATEGORY], +) +@response_schema(DefaultConfigValuesSchema(), 200, description="") +@innkeeper_only +@error_handler +async def tenant_default_config_settings(request: web.BaseRequest): + context: AdminRequestContext = request["context"] + mgr = context.inject(TenantManager) + innkeeper_wallet_config: InnkeeperWalletConfig = mgr._config.innkeeper_wallet + return web.json_response( + { + "connected_to_endorsers": list( + endorser_config.serialize() + for endorser_config in innkeeper_wallet_config.connect_to_endorser + ), + "created_public_did": innkeeper_wallet_config.create_public_did, + } + ) + + @docs( tags=[SWAGGER_CATEGORY], ) @@ -497,6 +540,8 @@ async def tenant_config_update(request: web.BaseRequest): body = await request.json() connect_to_endorser = body.get("connect_to_endorser") create_public_did = body.get("create_public_did") + enable_ledger_switch = body.get("enable_ledger_switch") or False + curr_ledger_id = body.get("curr_ledger_id") mgr = context.inject(TenantManager) profile = mgr.profile tenant_id = request.match_info["tenant_id"] @@ -506,6 +551,10 @@ async def tenant_config_update(request: web.BaseRequest): tenant_record.connected_to_endorsers = connect_to_endorser if create_public_did or create_public_did == []: tenant_record.created_public_did = create_public_did + if enable_ledger_switch: + tenant_record.enable_ledger_switch = enable_ledger_switch + if curr_ledger_id: + tenant_record.curr_ledger_id = curr_ledger_id await tenant_record.save(session) return web.json_response(tenant_record.serialize()) @@ -838,6 +887,11 @@ async def register(app: web.Application): "/innkeeper/tenants/{tenant_id}", innkeeper_tenant_get, allow_head=False ), web.put("/innkeeper/tenants/{tenant_id}/config", tenant_config_update), + web.get( + "/innkeeper/default-config", + tenant_default_config_settings, + allow_head=False, + ), web.post("/innkeeper/authentications/api", innkeeper_authentications_api), web.get( "/innkeeper/authentications/api/", diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/tenant_manager.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/tenant_manager.py index 54147a8d8..9d521233b 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/tenant_manager.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/tenant_manager.py @@ -69,6 +69,13 @@ async def create_wallet( del extra_settings["tenant.auto_issuer"] else: auto_issuer = self._config.reservation.auto_issuer + if "tenant.enable_ledger_switch" in extra_settings: + enable_ledger_switch = extra_settings.get("tenant.enable_ledger_switch") + del extra_settings["tenant.enable_ledger_switch"] + else: + enable_ledger_switch = ( + self._config.innkeeper_wallet.enable_ledger_switch + ) # we must stick with managed until AcaPy has full support for unmanaged. # transport/inbound/session.py only deals with managed. key_management_mode = WalletRecord.MODE_MANAGED @@ -114,6 +121,7 @@ async def create_wallet( connected_to_endorsers=connect_to_endorsers, created_public_did=created_public_did, auto_issuer=auto_issuer, + enable_ledger_switch=enable_ledger_switch, ) return tenant, wallet_record, token @@ -136,6 +144,7 @@ async def create_tenant( created_public_did: List = [], auto_issuer: bool = False, tenant_id: str = None, + enable_ledger_switch: bool = False, ): try: async with self._profile.session() as session: @@ -155,6 +164,7 @@ async def create_tenant( for endorser_config in connected_to_endorsers ), created_public_did=created_public_did, + enable_ledger_switch=enable_ledger_switch, auto_issuer=auto_issuer, ) await tenant.save(session, reason="New tenant") @@ -210,6 +220,9 @@ async def create_innkeeper(self): print(f"tenant.endorser_config = {tenant_record.connected_to_endorsers}") print(f"tenant.public_did_config = {tenant_record.created_public_did}") print(f"tenant.auto_issuer = {str(tenant_record.auto_issuer)}") + print( + f"tenant.enable_ledger_switch = {str(tenant_record.enable_ledger_switch)}" + ) _key = wallet_record.wallet_key if config.print_key else "********" print(f"wallet.wallet_key = {_key}\n") if config.print_token: @@ -292,9 +305,7 @@ async def get_wallet_and_tenant(self, wallet_id: str): raise StorageNotFoundError(f"Tenant not found with wallet_id '{wallet_id}'") return wallet_record, tenant_record - def check_api_key( - self, api_key: str, apiRecord: TenantAuthenticationApiRecord - ): + def check_api_key(self, api_key: str, apiRecord: TenantAuthenticationApiRecord): if api_key is None or apiRecord is None: return None diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/utils.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/utils.py index 837562107..29ce5bebb 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/utils.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/utils.py @@ -47,6 +47,15 @@ class TenantConfigSchema(OpenAPISchema): description="True if tenant can make itself issuer, false if only innkeeper can", default=False, ) + enable_ledger_switch = fields.Bool( + required=False, + description="True if tenant can switch endorser/ledger", + default=False, + ) + curr_ledger_id = fields.Str( + required=False, + description="Current ledger identifier", + ) def generate_reservation_token_data(expiry_minutes: int): diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/models.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/models.py index 42c2fb96c..8103bbf2e 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/models.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/models.py @@ -10,6 +10,16 @@ ) from marshmallow import EXCLUDE, fields +try: + from aries_cloudagent.messaging.valid import ( + INDY_SCHEMA_ID, + INDY_CRED_DEF_ID, + UUIDFour, + ) +except ImportError: + from ... import INDY_SCHEMA_ID, INDY_CRED_DEF_ID + from aries_cloudagent.messaging.valid import UUIDFour + class OcaRecord(BaseRecord): """Traction OCA Record.""" diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/routes.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/routes.py index 32effe3fa..8fca3785a 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/routes.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/oca/routes.py @@ -22,6 +22,16 @@ from aries_cloudagent.storage.error import StorageNotFoundError, StorageError from marshmallow import fields, ValidationError +try: + from aries_cloudagent.messaging.valid import ( + INDY_SCHEMA_ID, + INDY_CRED_DEF_ID, + UUIDFour, + ) +except ImportError: + from ... import INDY_SCHEMA_ID, INDY_CRED_DEF_ID + from aries_cloudagent.messaging.valid import UUIDFour + from . import OcaService from .models import OcaRecordSchema from .oca_service import PublicDIDRequiredError, PublicDIDMismatchError diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/schema_storage/models.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/schema_storage/models.py index 2cde3c33f..abad657ba 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/schema_storage/models.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/schema_storage/models.py @@ -7,6 +7,11 @@ ) from marshmallow import EXCLUDE, fields +try: + from aries_cloudagent.messaging.valid import INDY_SCHEMA_ID +except ImportError: + from ... import INDY_SCHEMA_ID + class SchemaStorageRecord(BaseRecord): """Traction Schema Storage Record.""" diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py index e92955480..eca1d0f2a 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py @@ -65,6 +65,13 @@ class TenantApiKeyRequestSchema(OpenAPISchema): ) +class TenantLedgerIdConfigSchema(OpenAPISchema): + ledger_id = fields.Str( + description="Ledger identifier", + required=True, + ) + + @docs( tags=[SWAGGER_CATEGORY], ) @@ -121,11 +128,38 @@ async def tenant_config_get(request: web.BaseRequest): endorser_config = tenant_record.connected_to_endorsers public_did_config = tenant_record.created_public_did tenant_issuer_flag = tenant_record.auto_issuer + enable_ledger_switch = tenant_record.enable_ledger_switch + curr_ledger_id = tenant_record.curr_ledger_id return web.json_response( { "connect_to_endorser": endorser_config, "create_public_did": public_did_config, "auto_issuer": tenant_issuer_flag, + "enable_ledger_switch": enable_ledger_switch, + "curr_ledger_id": curr_ledger_id, + } + ) + + +@docs(tags=[SWAGGER_CATEGORY], summary="Set tenant curr_ledger_id setting") +@request_schema(TenantLedgerIdConfigSchema) +@response_schema(TenantLedgerIdConfigSchema(), 200, description="") +@error_handler +async def tenant_config_ledger_id_set(request: web.BaseRequest): + context: AdminRequestContext = request["context"] + wallet_id = context.profile.settings.get("wallet.id") + body = await request.json() + curr_ledger_id = body.get("ledger_id") + mgr = context.inject(TenantManager) + profile = mgr.profile + async with profile.session() as session: + tenant_record = await TenantRecord.query_by_wallet_id(session, wallet_id) + if curr_ledger_id: + tenant_record.curr_ledger_id = curr_ledger_id + await tenant_record.save(session) + return web.json_response( + { + "ledger_id": curr_ledger_id, } ) @@ -333,7 +367,7 @@ async def register(app: web.Application): web.get("/tenant/wallet", tenant_wallet_get, allow_head=False), web.put("/tenant/wallet", tenant_wallet_update), web.get("/tenant/config", tenant_config_get, allow_head=False), - + web.put("/tenant/config/set-ledger-id", tenant_config_ledger_id_set), web.post("/tenant/authentications/api", tenant_api_key), web.get("/tenant/authentications/api/", tenant_api_key_list, allow_head=False), web.get("/tenant/authentications/api/{tenant_authentication_api_id}", tenant_api_key_get, allow_head=False), diff --git a/scripts/.env-example b/scripts/.env-example index f35e99b14..259f46041 100644 --- a/scripts/.env-example +++ b/scripts/.env-example @@ -38,6 +38,7 @@ ACAPY_WALLET_TYPE=askar ACAPY_WALLET_STORAGE_TYPE=postgres_storage ACAPY_LABEL="Traction Agent" ACAPY_GENESIS_URL=http://test.bcovrin.vonx.io/genesis +ACAPY_GENESIS_TRANSACTIONS_LIST=multi-ledger-config.yml ACAPY_READ_ONLY_LEDGER=false ACAPY_ADMIN_API_KEY=change-me diff --git a/scripts/docker-compose.yml b/scripts/docker-compose.yml index d4c8fa1fc..da47f5a50 100755 --- a/scripts/docker-compose.yml +++ b/scripts/docker-compose.yml @@ -46,7 +46,7 @@ services: - ACAPY_AUTO_PROVISION=${ACAPY_AUTO_PROVISION} - ACAPY_WALLET_TYPE=${ACAPY_WALLET_TYPE} - ACAPY_WALLET_STORAGE_TYPE=${ACAPY_WALLET_STORAGE_TYPE} - - ACAPY_GENESIS_URL=${ACAPY_GENESIS_URL} + - ACAPY_GENESIS_TRANSACTIONS_LIST=${ACAPY_GENESIS_TRANSACTIONS_LIST} - ACAPY_READ_ONLY_LEDGER=${ACAPY_READ_ONLY_LEDGER} - ACAPY_LABEL=${ACAPY_LABEL} - ACAPY_ADMIN_API_KEY=${ACAPY_ADMIN_API_KEY} @@ -75,8 +75,6 @@ services: - ACAPY_NOTIFY_REVOCATION=${ACAPY_NOTIFY_REVOCATION} - ACAPY_MONITOR_REVOCATION_NOTIFICATION=${ACAPY_MONITOR_REVOCATION_NOTIFICATION} - ACAPY_ENDORSER_ROLE=${ACAPY_ENDORSER_ROLE} - - ACAPY_ENDORSER_PUBLIC_DID=${ACAPY_ENDORSER_PUBLIC_DID} - - ACAPY_ENDORSER_ALIAS=${ACAPY_ENDORSER_ALIAS} - ACAPY_AUTO_REQUEST_ENDORSEMENT=${ACAPY_AUTO_REQUEST_ENDORSEMENT} - ACAPY_AUTO_WRITE_TRANSACTIONS=${ACAPY_AUTO_WRITE_TRANSACTIONS} - ACAPY_AUTO_PROMOTE_AUTHOR_DID=${ACAPY_AUTO_PROMOTE_AUTHOR_DID} @@ -90,6 +88,7 @@ services: command: ["-c", "sleep 5; ./ngrok-wait.sh"] volumes: - "./plugin-config.yml:/home/aries/plugin-config.yml" + - "./multi-ledger-config.yml:/home/aries/multi-ledger-config.yml" extra_hosts: - host.docker.internal:host-gateway diff --git a/scripts/multi-ledger-config.yml b/scripts/multi-ledger-config.yml new file mode 100644 index 000000000..f7d54766d --- /dev/null +++ b/scripts/multi-ledger-config.yml @@ -0,0 +1,12 @@ +- id: bcovrin-test-1 + is_production: true + is_write: true + genesis_url: 'http://test.bcovrin.vonx.io/genesis' + endorser_did: 'SVfHGCEEvEFmpBPcxgNqRR' + endorser_alias: 'endorser-1' +- id: bcovrin-test-2 + is_production: true + is_write: true + genesis_url: 'http://test.bcovrin.vonx.io/genesis' + endorser_did: 'FBmi5JLf5g58kDnNXMy4QM' + endorser_alias: 'endorser-2' \ No newline at end of file diff --git a/scripts/plugin-config.yml b/scripts/plugin-config.yml index 7ef0bb922..f10202f07 100644 --- a/scripts/plugin-config.yml +++ b/scripts/plugin-config.yml @@ -17,12 +17,16 @@ traction_innkeeper: print_token: true connect_to_endorser: [ { - "endorser_alias": "endorser", - "ledger_id": "bcovrin-test", + "endorser_alias": "endorser-1", + "ledger_id": "bcovrin-test-1", + }, + { + "endorser_alias": "endorser-2", + "ledger_id": "bcovrin-test-2", } ] - create_public_did: ["bcovrin-test"] + create_public_did: ["bcovrin-test-1", "bcovrin-test-2"] reservation: auto_approve: true expiry_minutes: 2880 - auto_issuer: true + auto_issuer: false diff --git a/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue b/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue index 52712335c..bccc0d097 100644 --- a/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue +++ b/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue @@ -121,6 +121,7 @@ const formattedTenants = computed(() => created_public_did: ten.created_public_did, created: formatDateLong(ten.created_at), created_at: ten.created_at, + enable_ledger_switch: ten.enable_ledger_switch, })) ); diff --git a/services/tenant-ui/frontend/src/components/innkeeper/tenants/editConfig/editConfigForm.vue b/services/tenant-ui/frontend/src/components/innkeeper/tenants/editConfig/editConfigForm.vue index d48fec33f..7eb86a996 100644 --- a/services/tenant-ui/frontend/src/components/innkeeper/tenants/editConfig/editConfigForm.vue +++ b/services/tenant-ui/frontend/src/components/innkeeper/tenants/editConfig/editConfigForm.vue @@ -1,30 +1,45 @@