openwallet-foundation / credo-ts-docs

Documentation for Credo
https://credo.js.org
18 stars 33 forks source link

[Request]: Expanded documentation for Askar WalletConfig #128

Open daidoji opened 1 year ago

daidoji commented 1 year ago

Documentation Request

Right now there exists https://aries.js.org/guides/0.4/tutorials/agent-config#walletconfigstorage which isn't quite helpful, although there are many examples throughout the docs of path: uri: and other options in postgres for example scattered here and there.

In trying to determine whether I could use the :memory: database with sqlite for testing I found these two options along with references on google to inMemory (which didn't seem to work). This section having a robust breakdown of the various storage backends and wallets one could use with PG, sqlite, or any other backing that might come up and a strict interface would certainly help clear up some of this for newcomers.

  1. Expand this section in the linked docs to include basic storage options for sqlite (and maybe move some of the Postgres options).
  2. Document somewhere how to use the in-memory database from sqlite either here or in its own section. (In my research passing uri: 'sqlite://:memory:' as a storage config key seemed to work at initializing agents at the least. attached file from basic config example from the docs with this for testing).

minimal_memory_example.ts.txt

Version

0.4.x

Which platform are you most interested in for documentation?

Contribute (optional)

TimoGlastra commented 1 year ago

@genaris to add some pointers on the different options

genaris commented 1 year ago

I think current documentation for wallet configuration is still based on the structure used for Indy SDK, while there are some particular parameters that depend on each wallet implementation. This is a conflicting point when it comes to storage configuration, as the parameters used in Indy are a bit different from the ones used in Askar.

The in-memory wallet @daidoji is referring to is a particular case of sqlite configuration for Askar (not sure if Indy allows for this as well), accessible when the storage configuration object does include an inMemory field set to true (no need to set anything else in the uri field). This is only for test purposes and was not deeply explored, but after the fix in https://github.com/hyperledger/aries-framework-javascript/pull/1498 it should work.

I think it would be nice to reference both Askar and Indy SDK wallet implementation details in https://aries.js.org/guides/0.4/tutorials/agent-config#walletconfigstorage and maybe rework a bit the Postgres section to be not so tied to indy-sdk.