DAF5 & DAF7 : There is no option for providing a web3provider in daf-resolve
See original GitHub issueHi Team,
I am using DAF 5 But this issue is even applicable for DAF 7.
I was trying to create a didResolver without using a rcpUrl approach and creating by passing a web3 Provider
I can find that there is only hardcoded support for infura RPCUrl in current implementation when it comes to creating an instance using import { DafResolver } from ‘daf-resolver’
which internally getting an rpcURL option in constructor and only have rpcUrl as an option,
constructor(options: Options) { this.didResolver = new Resolver({ ...ethrDidResolver({ networks: [ { name: 'mainnet', rpcUrl: 'https://mainnet.infura.io/v3/' + options.infuraProjectId }, { name: 'rinkeby', rpcUrl: 'https://rinkeby.infura.io/v3/' + options.infuraProjectId }, ], }), ...webDidResolver(), nacl: naclDidResolver, }) }
similar logic is even available in recent daf-resolve versions
Could you please expend the options interface with an option for web3provider object like we have in ‘daf-ethr-did’, this module has both the option while creating a IdentityProvider as mentioned below.
const identityProviders = [ new EthrDid.IdentityProvider({ identityStore: new IdentityStore('rinkeby-ethr', dbConnection), kms, //: new KeyManagementSystem(new KeyStore(dbConnection, new DafLocalStorage.KeyStore('localKeys'))), network: 'rinkeby', web3Provider: web3Provider, // rpcUrl: 'https://rinkeby.infura.io/v3/' + infuraProjectId, }), ]
so if we can get the similar support in daf-resolver then we can optionally use a web3 provider instead of a rpcUrl .
let didResolver: Daf.Resolver = new DafResolver({ provider: web3Provider})
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top GitHub Comments
I think it will be included in DAF 7; if not in the initial release, then perhaps in a smaller one immediately after since it won’t be a breaking change, but an enhancement. There is no deadline for the DAF7 release. We encourage you to try it out in beta phase and provide feedback if it affects you, since a lot of the
actionHandler
logic has now been redefined as direct methods callable on theagent
.We plan to have upgrade guides ready before merging it back into main but feedback is very welcome.
It is not part of the daf7-beta yet.