question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DAF5 & DAF7 : There is no option for providing a web3provider in daf-resolve

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mirceaniscommented, Jul 20, 2020

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 the agent.

We plan to have upgrade guides ready before merging it back into main but feedback is very welcome.

0reactions
mirceaniscommented, Aug 18, 2020

It is not part of the daf7-beta yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found