Closed Patrik-Stas closed 2 years ago
Updated architecture
This splits Rust portion of AriesVCX repo in 3 layers, 4 crates.
AriesVCX
crate, providing C ABI interface and memory management (providing references to in-memory vcx objects via u32
handles)Generally implemented, but before we close we should:
Updated architecture diagram
aries-vcx
can now be considered consumable stateless aries crate which can simultaneously manage multiple wallets and multiple pool connections.
aries-vcx
can be consumed: https://github.com/hyperledger/aries-vcx/tree/main/agents/rust/aries-vcx-agent
The problem
Currently there's no good way to consume
aries-vcx
from other Rust code.Solution 1 - Aries-vcx as consumable crate
Here I am proposing structuring
aries-vcx
into 4 layers. But that doesn't mean we should have them all exposed from the crate.updateState
, as described on the picture. This would be likely level of abstraction someone would want to operate on if there was intention to use VCX Agency as well.Steps to take:
Rename
api
toapi_c
. Thenapi_c
module to be more "pure", as currently it does more than handling FFI calls, more specifically it:settings.rs
, passing it down to further called functions (seevcx_schema_prepare_for_endorser
for example).Create
api_handle
module. This will contain basically the logic and state shared across threads - currently insrc/*rs
files which takeu32
object "handles" as input/output.Create
api_comfort
module. This should have similar API asapi_handle
however input/outputs should be typed with Rust structures. This layer will contain logic gluing together multiple structures / operations on top of them (for exampleupdateState()
). This layer should not have any state of its own.Create
api_direct
which would include:Pros:
libindy
andlibnullpay
. Butaries-vcx
crate would be "the whole package".