DIDBackend
Example
Purpose
The whole DID system needs to interact with the chain locally, so it's necessary to initialize the DID Backend, set the rpc server of the chain, the contract address, the data buffer at the initial stage of the DID system, thereby setting the interactive interface with the chain for DID.
Usage
DIDAdapter is the base class, and users need to implement their own subclasses based on it (such as the Web3Adapter in the example0. Web3Adapter is an implementation DIDAdapterter provided by SDK. Users can use or implement DIDAdapter by themselves according to their needs.
InitialCacheCapacity and maxCacheCapacity are the initial and maximum capacities of the buffer, respectively. The SDK has a default value, and users can also set the value based on their own needs.
CacheTtl is the validity period of the cache, the default value of which is 10 minutes.
Last updated