Skip to content

Latest commit

 

History

History

waltid-wallet-api

Wallet API

by walt.id

Identity wallets to manage Keys, DIDs, Credentials, and NFTs/SBTs

Join community! Follow @walt_id

Watch the Intro Video to learn about features and see a demo. The documentation explains how to create and manage identity wallets.

What it provides

The Wallet-API is designed to provide a broad range of API endpoints that let you offer identity wallets to users capable of handling different keys, DIDs, and credential types and facilitate the receipt and presentation of credentials from various issuers and verifiers using the OIDC4VC protocol standard. Alongside digital identity capabilities, it also supports the integration of web3 wallets. This feature enables your users to view their tokens from different blockchain ecosystems like Ethereum, Polygon, and more.

How to use it

Docker compose

From the root folder, you can run the wallet-api, including the necessary configuration as well as other relevant services and apps like the wallet frontend by the following command:

cd docker-compose && docker compose up

Running the wallet API as single container

docker run \
-p 7001:7001 -it \
-v $(pwd)/wallet-api/config:/waltid-wallet-api/config \
-v $(pwd)/wallet-api/data:/waltid-wallet-api/data \
-t waltid/wallet-api

Build the container

Update the wallet-api container by running the following commands from the root folder:

docker build -t waltid/wallet-api -f waltid-services/waltid-wallet-api/Dockerfile .

Database configuration

Currently, the following databases can be used:

  • sqlite
  • postgres
  • microsoft sql server

The configuration file db.conf contain the datasource info required to connect to the respective database engine. For more details about database and datasource, refer to https://github.com/JetBrains/Exposed/wiki/DataBase-and-DataSource.

Switching databases

Switching to use a database engine requires the following steps:

  1. update config/db.config to point to the correct datasource configuration
  2. start the database engine
  3. in your IDE, run src/main/kotlin/id/walt/webwallet/Main.kt

Sqlite

  1. config/db.config:
jdbcUrl = "jdbc:sqlite:data/wallet.db"
driverClassName = "org.sqlite.JDBC"
  1. the database file will be created by default at the data/wallet.db location

Postgres

  1. config/db.config:
jdbcUrl = "jdbc:postgresql://127.0.0.1:5432/waltid"
driverClassName = "org.postgresql.Driver"
username = "postgres"
password = "postgres"
  1. start postgres:
docker run --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -p 5432:5432 -d postgres

Microsoft Sql Server

  1. config/db.config:
jdbcUrl = "jdbc:sqlserver://localhost:1433;databaseName=master"
driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
  1. start sql server:
docker run --name mssql -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=p@ssw0rd" -p 1433:1433 --hostname mssql -d mcr.microsoft.com/mssql/server:2022-latest

Join the community

License

Licensed under the Apache License, Version 2.0.