### Start the React demo Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Starts the React demo application for the Wallet SDK. ```bash cd demos/next npm i npm run build npm run start ``` -------------------------------- ### Instantiate Cloud Agent and Establish Mediation (Swift) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Code example for initializing the Cloud Agent and starting message fetching in Swift. ```swift let agent = CloudAgent(mediatorDID: did) try await agent.start() agent.startFetchingMessages() ``` -------------------------------- ### Build the source SDK Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Builds the source SDK, including initializing submodules, installing npm dependencies, and running the build process. ```bash cd sdk-ts git submodule update --init --recursive npm i npm run build ``` -------------------------------- ### Install Rust and wasm-pack Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Installs Rust and wasm-pack, which are required for building the SDK and running demonstration applications. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh ``` -------------------------------- ### Start the Verifier Cloud Agent (Linux) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Start the Verifier Cloud Agent on Linux. ```bash ./infrastructure/local/run.sh -n verifier -b -e ./infrastructure/local/.env-verifier -p 9000 -d "$(ip addr show $(ip route show default | awk '/default/ {print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)" ``` -------------------------------- ### Instantiate Cloud Agent and Establish Mediation (Android) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Code example for initializing the Cloud Agent and starting message fetching in Kotlin for Android. ```kotlin val apollo = ApolloImpl() val castor = CastorImpl(apollo) val pluto = Pluto(DbConnection()) (pluto as PlutoImpl).start(context) val mercury = mercury = MercuryImpl( castor, DIDCommWrapper(castor, pluto, apollo), ApiImpl(httpClient()) ) val pollux = PolluxImpl(castor) val seed = apollo.createRandomSeed() val handler = BasicMediatorHandler( mediatorDID = DID(), mercury = mercury, store = BasicMediatorHandler.PlutoMediatorRepositoryImpl(pluto) ) agent = CloudAgent( apollo = apollo, castor = castor, pluto = pluto, mercury = mercury, pollux = pollux, seed = seed, mediatorHandler = handler ) agent.start() agent.startFetchingMessages() ``` -------------------------------- ### Create a Credential Offer with an existing connection Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Issuer Agent: Example request to trigger the creation of a credential-offer using an existing connection. ```bash curl --location --request POST 'http://localhost:8000/cloud-agent/issue-credentials/credential-offers' \ --header 'Content-Type: application/json' \ --data-raw '{ "claims": { "emailAddress":"sampleEmail", "familyName":"Alice", "dateOfIssuance":"2023-01-01T02:02:02Z", "drivingLicenseID":"42", "drivingClass":1 }, "connectionId": [[connectionId]], "issuingDID": [[publishedPrismDID]], "schemaId": [[schemaId]], "automaticIssuance": true }' ``` -------------------------------- ### Start the Issuer Cloud Agent (Linux) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Start the Issuer Cloud Agent on Linux. ```bash ./infrastructure/local/run.sh -n issuer -b -e ./infrastructure/local/.env-issuer -p 8000 -d "$(ip addr show $(ip route show default | awk '/default/ {print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)" ``` -------------------------------- ### Swift Sample APP Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Steps to connect using the Swift Sample App. ```swift let message = try agent.parseOOBInvitation(url: oobUrl) try await agent.acceptDIDCommInvitation(invitation: message) ``` -------------------------------- ### Android Sample APP Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Steps to connect using the Android Sample App. ```kotlin val invitation = agent.parseInvitation(oobUrl) agent.acceptOutOfBandInvitation(invitation) ``` -------------------------------- ### Typescript Sample APP Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Steps to connect using the Typescript Sample App. ```typescript const parsed = await props.agent.parseOOBInvitation(new URL([[OOB URL]])); await props.agent.acceptDIDCommInvitation(parsed); ``` -------------------------------- ### Fetch Mediator Invitation Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md API request to get the mediator's invitation details. ```bash curl --location \ --request GET 'localhost:8080/invitation' \ --header 'Content-Type: application/json' ``` -------------------------------- ### Start the Verifier Cloud Agent (Mac OSX) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Start the Verifier Cloud Agent on Mac OSX. ```bash ./infrastructure/local/run.sh -n verifier -b -e ./infrastructure/local/.env-verifier -p 9000 -d "$(ipconfig getifaddr $(route get default | grep interface | awk '{print $2}'))" ``` -------------------------------- ### Instantiate Cloud Agent and Establish Mediation (TypeScript) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Code example for initializing the Cloud Agent and automatically achieving mediation using the SDK. ```typescript const mediatorDID = SDK.Domain.DID.fromString( [[MEDIATOR DID PEER]] ); const api = new SDK.ApiImpl(); const apollo = new SDK.Apollo(); const castor = new SDK.Castor(apollo); const didcomm = new SDK.DIDCommWrapper(apollo, castor, pluto); const mercury = new SDK.Mercury(castor, didcomm, api); const store = new SDK.PublicMediatorStore(pluto); const handler = new SDK.BasicMediatorHandler(mediatorDID, mercury, store); const manager = new SDK.ConnectionsManager(castor, mercury, pluto, handler); const seed = apollo.createRandomSeed() const agent = new SDK.Agent( apollo, castor, pluto, mercury, handler, manager, seed.seed ); /** * This internally will attempt to load an existing mediator from the * database. If it does not exist it will try to achieve mediation * automatically, by creating a PeerDID and sending a MediationRequest. * After this step the mediator starts capturing messages for the PeerDID we specied. */ await agent.start() ``` -------------------------------- ### Clone the Swift SDK repository Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Clones the Swift SDK repository. ```bash git clone https://github.com/hyperledger/identus-edge-agent-sdk-swift ``` -------------------------------- ### Start the Issuer Cloud Agent (Mac OSX) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Start the Issuer Cloud Agent on Mac OSX. ```bash ./infrastructure/local/run.sh -n issuer -b -e ./infrastructure/local/.env-issuer -p 8000 -d "$(ipconfig getifaddr $(route get default | grep interface | awk '{print $2}'))" ``` -------------------------------- ### Create a PRISM DID Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Create a PRISM DID by making an API request to your Issuer API. ```bash curl --location \ --request POST 'http://localhost:8000/cloud-agent/did-registrar/dids' \ --header 'Accept: application/json' \ --data-raw '{ "documentTemplate": { "publicKeys": [ { "id": "auth-1", "purpose": "authentication" }, { "id": "issue-1", "purpose": "assertionMethod" } ], "services": [] } }' ``` -------------------------------- ### Start Mediator (Linux) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Starts the Indentus Mediator using Docker Compose on Linux. It sets the mediator version and service endpoints based on the local IP address. ```bash MEDIATOR_VERSION=1.1.0 SERVICE_ENDPOINTS="http://$(ip addr show $(ip route show default | awk '/default/ {print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1):8080;ws://$(ip addr show $(ip route show default | awk '/default/ {print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1):8080/ws" docker compose up ``` -------------------------------- ### Start Mediator (Mac OSX) Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Starts the Indentus Mediator using Docker Compose on Mac OSX. It sets the mediator version and service endpoints based on the local IP address. ```bash MEDIATOR_VERSION=1.1.0 SERVICE_ENDPOINTS="http://$(ipconfig getifaddr $(route get default | grep interface | awk '{print $2}')):8080;ws://$(ipconfig getifaddr $(route get default | grep interface | awk '{print $2}')):8080/ws" docker compose up ``` -------------------------------- ### Slick Example Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/adrs/decisions/2023-01-18-quill-library-for-sql-statement-generation.md An example demonstrating how to use the Slick library for SQL queries. ```scala import slick.jdbc.PostgresProfile.api._ val db = Database.forConfig("database") case class Person(id: Int, name: String) val q = TableQuery[Person].filter(_.id === 1) val result: Future[Seq[Person]] = db.run(q.result) ``` -------------------------------- ### Swift Credential Offer to Request Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md This Swift code snippet demonstrates handling Credential Offers and preparing a Credential Request using the agent, including creating a new DID. ```swift agent .handleMessagesEvents() .sink(receiveCompletion: { _ in }, receiveValue: { [weak self] in guard let message, message.direction == .received, let msgType = ProtocolTypes(rawValue: message.piuri) else { return } Task.detached { [weak self] in do { switch msgType { case .didcommOfferCredential: let newPrismDID = try await agent.createNewPrismDID() guard let requestCredential = try await agent.prepareRequestCredentialWithIssuer( did: newPrismDID, offer: try OfferCredential(fromMessage: message) ) else { throw UnknownError.somethingWentWrongError() } _ = try await agent.sendMessage(message: try requestCredential.makeMessage()) } catch {} ``` -------------------------------- ### Clone Mediator Repository Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Clones the Hyperledger Indentus Mediator repository from GitHub. ```bash git clone https://github.com/hyperledger/identus-mediator ``` -------------------------------- ### MacOS Installation Source: https://github.com/hyperledger-identus/docs/blob/main/README.md Instructions for installing necessary tools and setting up the project on MacOS. ```shell # Install brew, git, node and yarn # If you have these tools, skip these steps /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install git brew install node brew install yarn # Create new projects directory cd ~ && mkdir projects && cd projects git clone https://github.com/hyperledger-identus/docs.git # Initialize submodules git submodule init # Update submodules git submodule update --remote --recursive # Use this step to checkout custom branch to review from PR # git checkout feature-branch # Deploy local version of the website cd docs yarn install yarn start ``` -------------------------------- ### Publish the DID Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/develop/quick-start.md Publish the DID by replacing {didRef} with the longFormDid output value from the previous step. ```bash curl --location \ --request POST 'http://localhost:8000/cloud-agent/did-registrar/dids/{didRef}/publications' \ --header 'Accept: application/json' ``` -------------------------------- ### DID URL Example using service and path Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/adrs/decisions/2023-04-05-did-linked-resources.md An alternative DID URL example showing how to reference a resource using 'service' and 'path' parameters. ```did-url did:prism:abcdefg/credentialschemas/123e4567-e89b-12d3-a456-426614174000?service=credentialschema ``` -------------------------------- ### Repository Interface: get vs find pattern Source: https://github.com/hyperledger-identus/docs/blob/main/documentation/adrs/decisions/2024-01-16-use-zio-failures-and-defects-effectively.md Demonstrates the difference between getXxx() which throws an exception and findXxx() which returns an Option. ```scala trait ConnectionRepository { def findById(recordId: UUID): URIO[WalletAccessContext, Option[ConnectionRecord]] def getById(recordId: UUID): URIO[WalletAccessContext, ConnectionRecord] } ```